# Essential Dynamics Analysis¶

## Synopsis¶

This example shows how to perform essential dynamics analysis of molecular
dynamics (MD) trajectories. A `EDA`

instance that stores covariance
matrix and principal modes that describes the essential dynamics of the system
observed in the simulation will be built. `EDA`

and principal modes
(`Mode`

) can be used as input to functions in `dynamics`

module
for further analysis.

User needs to provide trajectory in DCD file format and PDB file of the system.

Example input:

## Setup environment¶

We start by importing everything from ProDy:

```
In [1]: from prody import *
In [2]: from pylab import *
In [3]: ion()
```

## Parse reference structure¶

The PDB file provided with this example contains and X-ray structure which will be useful in a number of places, so let’s start with parsing this file first:

```
In [4]: structure = parsePDB('mdm2.pdb')
In [5]: structure
Out[5]: <AtomGroup: mdm2 (1449 atoms)>
```

This function returned a `AtomGroup`

instance that
stores all atomic data parsed from the PDB file.

## EDA calculations¶

Essential dynamics analysis (EDA or PCA) of a trajectory can be performed in two ways.

### Small files¶

If you are analyzing a small trajectory, you can use an `Ensemble`

instance obtained by parsing the trajectory at once using `parseDCD()`

:

```
In [6]: ensemble = parseDCD('mdm2.dcd')
In [7]: ensemble.setCoords(structure)
In [8]: ensemble.setAtoms(structure.calpha)
In [9]: ensemble
Out[9]: <Ensemble: mdm2 (0:500:1) (500 conformations; selected 85 of 1449 atoms)>
In [10]: ensemble.superpose()
@> Superposing [ 1%]
@> Superposing [ 2%]
@> Superposing [ 3%]
@> Superposing [ 4%] 1s
@> Superposing [ 5%] 1s
@> Superposing [ 6%] 1s
@> Superposing [ 7%] 1s
@> Superposing [ 8%] 1s
@> Superposing [ 9%] 1s
@> Superposing [ 10%] 1s
@> Superposing [ 11%] 1s
@> Superposing [ 12%] 1s
@> Superposing [ 13%] 1s
@> Superposing [ 14%] 1s
@> Superposing [ 15%] 1s
@> Superposing [ 16%] 1s
@> Superposing [ 17%] 1s
@> Superposing [ 18%] 1s
@> Superposing [ 19%] 1s
@> Superposing [ 20%] 1s
@> Superposing [ 21%] 1s
@> Superposing [ 22%] 1s
@> Superposing [ 23%] 1s
@> Superposing [ 24%] 1s
@> Superposing [ 25%] 1s
@> Superposing [ 26%] 1s
@> Superposing [ 27%] 1s
@> Superposing [ 28%] 1s
@> Superposing [ 29%] 1s
@> Superposing [ 30%] 1s
@> Superposing [ 31%] 1s
@> Superposing [ 32%] 1s
@> Superposing [ 33%] 1s
@> Superposing [ 34%] 1s
@> Superposing [ 35%] 1s
@> Superposing [ 36%] 1s
@> Superposing [ 37%] 1s
@> Superposing [ 38%] 1s
@> Superposing [ 39%] 1s
@> Superposing [ 40%] 1s
@> Superposing [ 41%] 1s
@> Superposing [ 42%] 1s
@> Superposing [ 43%] 1s
@> Superposing [ 44%] 1s
@> Superposing [ 45%] 1s
@> Superposing [ 46%] 1s
@> Superposing [ 47%] 1s
@> Superposing [ 48%] 1s
@> Superposing [ 49%] 1s
@> Superposing [ 50%] 1s
@> Superposing [ 51%] 1s
@> Superposing [ 52%] 1s
@> Superposing [ 53%] 1s
@> Superposing [ 54%] 1s
@> Superposing [ 55%] 1s
@> Superposing [ 56%] 1s
@> Superposing [ 57%] 1s
@> Superposing [ 58%] 1s
@> Superposing [ 59%] 1s
@> Superposing [ 60%] 1s
@> Superposing [ 61%] 1s
@> Superposing [ 62%] 1s
@> Superposing [ 63%] 1s
@> Superposing [ 64%] 1s
@> Superposing [ 65%] 1s
@> Superposing [ 66%] 1s
@> Superposing [ 67%] 1s
@> Superposing [ 68%] 1s
@> Superposing [ 69%] 1s
@> Superposing [ 70%] 1s
@> Superposing [ 71%] 1s
@> Superposing [ 72%] 1s
@> Superposing [ 73%] 1s
@> Superposing [ 74%] 1s
@> Superposing [ 75%] 1s
@> Superposing [ 76%] 1s
@> Superposing [ 77%] 1s
@> Superposing [ 78%] 1s
@> Superposing [ 79%] 1s
@> Superposing [ 80%] 1s
@> Superposing [ 81%] 1s
@> Superposing [ 82%] 1s
@> Superposing [ 83%] 1s
@> Superposing [ 84%] 1s
@> Superposing [ 85%] 1s
@> Superposing [ 86%] 1s
@> Superposing [ 87%] 1s
@> Superposing [ 88%] 1s
@> Superposing [ 89%] 1s
@> Superposing [ 90%] 1s
@> Superposing [ 91%] 1s
@> Superposing [ 92%] 1s
@> Superposing [ 93%] 1s
@> Superposing [ 94%] 1s
@> Superposing [ 95%] 1s
@> Superposing [ 96%] 1s
@> Superposing [ 97%] 1s
@> Superposing [ 98%] 1s
@> Superposing [ 99%] 1s
In [11]: eda_ensemble = EDA('MDM2 Ensemble')
In [12]: eda_ensemble.buildCovariance( ensemble )
@> Building covariance [100%] 0s
In [13]: eda_ensemble.calcModes()
In [14]: eda_ensemble
Out[14]: <EDA: MDM2 Ensemble (20 modes; 85 atoms)>
```

### Large files¶

If you are analyzing a large trajectory, you can pass the trajectory instance
to the `PCA.buildCovariance()`

method as follows:

```
In [15]: dcd = DCDFile('mdm2.dcd')
In [16]: dcd.link(structure)
In [17]: dcd.setAtoms(structure.calpha)
In [18]: dcd
Out[18]: <DCDFile: mdm2 (linked to AtomGroup mdm2; next 0 of 500 frames; selected 85 of 1449 atoms)>
In [19]: eda_trajectory = EDA('MDM2 Trajectory')
In [20]: eda_trajectory.buildCovariance( dcd )
@> Building covariance [ 1%]
@> Building covariance [ 2%]
@> Building covariance [ 3%]
@> Building covariance [ 4%] 1s
@> Building covariance [ 5%] 1s
@> Building covariance [ 6%] 1s
@> Building covariance [ 7%] 1s
@> Building covariance [ 8%] 1s
@> Building covariance [ 9%] 1s
@> Building covariance [ 10%] 1s
@> Building covariance [ 11%] 1s
@> Building covariance [ 12%] 1s
@> Building covariance [ 13%] 1s
@> Building covariance [ 14%] 1s
@> Building covariance [ 15%] 1s
@> Building covariance [ 16%] 1s
@> Building covariance [ 17%] 1s
@> Building covariance [ 18%] 1s
@> Building covariance [ 19%] 1s
@> Building covariance [ 20%] 1s
@> Building covariance [ 21%] 1s
@> Building covariance [ 22%] 1s
@> Building covariance [ 23%] 1s
@> Building covariance [ 24%] 1s
@> Building covariance [ 25%] 1s
@> Building covariance [ 26%] 1s
@> Building covariance [ 27%] 1s
@> Building covariance [ 28%] 1s
@> Building covariance [ 29%] 1s
@> Building covariance [ 30%] 1s
@> Building covariance [ 31%] 1s
@> Building covariance [ 32%] 1s
@> Building covariance [ 33%] 1s
@> Building covariance [ 34%] 1s
@> Building covariance [ 35%] 1s
@> Building covariance [ 36%] 1s
@> Building covariance [ 37%] 1s
@> Building covariance [ 38%] 1s
@> Building covariance [ 39%] 1s
@> Building covariance [ 40%] 1s
@> Building covariance [ 41%] 1s
@> Building covariance [ 42%] 1s
@> Building covariance [ 43%] 1s
@> Building covariance [ 44%] 1s
@> Building covariance [ 45%] 1s
@> Building covariance [ 46%] 1s
@> Building covariance [ 47%] 1s
@> Building covariance [ 48%] 1s
@> Building covariance [ 49%] 1s
@> Building covariance [ 50%] 1s
@> Building covariance [ 51%] 1s
@> Building covariance [ 52%] 1s
@> Building covariance [ 53%] 1s
@> Building covariance [ 54%] 1s
@> Building covariance [ 55%] 1s
@> Building covariance [ 56%] 1s
@> Building covariance [ 57%] 1s
@> Building covariance [ 58%] 1s
@> Building covariance [ 59%] 1s
@> Building covariance [ 60%] 1s
@> Building covariance [ 61%] 1s
@> Building covariance [ 62%] 1s
@> Building covariance [ 63%] 1s
@> Building covariance [ 64%] 1s
@> Building covariance [ 65%] 1s
@> Building covariance [ 66%] 1s
@> Building covariance [ 67%] 1s
@> Building covariance [ 68%] 1s
@> Building covariance [ 69%] 1s
@> Building covariance [ 70%] 1s
@> Building covariance [ 71%] 1s
@> Building covariance [ 72%] 1s
@> Building covariance [ 73%] 1s
@> Building covariance [ 74%] 1s
@> Building covariance [ 75%] 1s
@> Building covariance [ 76%] 1s
@> Building covariance [ 77%] 1s
@> Building covariance [ 78%] 1s
@> Building covariance [ 79%] 1s
@> Building covariance [ 80%] 1s
@> Building covariance [ 81%] 1s
@> Building covariance [ 82%] 1s
@> Building covariance [ 83%] 1s
@> Building covariance [ 84%] 1s
@> Building covariance [ 85%] 1s
@> Building covariance [ 86%] 1s
@> Building covariance [ 87%] 1s
@> Building covariance [ 88%] 1s
@> Building covariance [ 89%] 1s
@> Building covariance [ 90%] 1s
@> Building covariance [ 91%] 1s
@> Building covariance [ 92%] 1s
@> Building covariance [ 93%] 1s
@> Building covariance [ 94%] 1s
@> Building covariance [ 95%] 1s
@> Building covariance [ 96%] 1s
@> Building covariance [ 97%] 1s
@> Building covariance [ 98%] 1s
@> Building covariance [ 99%] 1s
@> Building covariance [100%] 0s
In [21]: eda_trajectory.calcModes()
In [22]: eda_trajectory
Out[22]: <EDA: MDM2 Trajectory (20 modes; 85 atoms)>
```

### Comparison¶

```
In [23]: printOverlapTable(eda_ensemble[:3], eda_trajectory[:3])
Overlap Table
EDA MDM2 Trajectory
#1 #2 #3
EDA MDM2 Ensemble #1 +1.00 0.00 0.00
EDA MDM2 Ensemble #2 0.00 +1.00 0.00
EDA MDM2 Ensemble #3 0.00 0.00 +1.00
```

Overlap values of +1 along the diagonal of the table shows that top ranking 3 essential (principal) modes are the same.

## Multiple files¶

It is also possible to analyze multiple trajectory files without concatenating them. In this case we will use data from two independent simulations

```
In [24]: trajectory = Trajectory('mdm2.dcd')
In [25]: trajectory.addFile('mdm2sim2.dcd')
In [26]: trajectory
Out[26]: <Trajectory: mdm2 (2 files; next 0 of 1000 frames; 1449 atoms)>
In [27]: trajectory.link(structure)
In [28]: trajectory.setCoords(structure)
In [29]: trajectory.setAtoms(structure.calpha)
In [30]: trajectory
Out[30]: <Trajectory: mdm2 (linked to AtomGroup mdm2; 2 files; next 0 of 1000 frames; selected 85 of 1449 atoms)>
In [31]: eda = EDA('mdm2')
In [32]: eda.buildCovariance( trajectory )
@> Building covariance [ 1%]
@> Building covariance [ 2%]
@> Building covariance [ 3%]
@> Building covariance [ 4%] 1s
@> Building covariance [ 5%] 1s
@> Building covariance [ 6%] 1s
@> Building covariance [ 7%] 1s
@> Building covariance [ 8%] 1s
@> Building covariance [ 9%] 1s
@> Building covariance [ 10%] 1s
@> Building covariance [ 11%] 1s
@> Building covariance [ 12%] 1s
@> Building covariance [ 13%] 1s
@> Building covariance [ 14%] 1s
@> Building covariance [ 15%] 1s
@> Building covariance [ 16%] 1s
@> Building covariance [ 17%] 1s
@> Building covariance [ 18%] 1s
@> Building covariance [ 19%] 1s
@> Building covariance [ 20%] 1s
@> Building covariance [ 21%] 1s
@> Building covariance [ 22%] 1s
@> Building covariance [ 23%] 1s
@> Building covariance [ 24%] 1s
@> Building covariance [ 25%] 1s
@> Building covariance [ 26%] 1s
@> Building covariance [ 27%] 1s
@> Building covariance [ 28%] 1s
@> Building covariance [ 29%] 1s
@> Building covariance [ 30%] 1s
@> Building covariance [ 31%] 1s
@> Building covariance [ 32%] 1s
@> Building covariance [ 33%] 1s
@> Building covariance [ 34%] 1s
@> Building covariance [ 35%] 1s
@> Building covariance [ 36%] 1s
@> Building covariance [ 37%] 1s
@> Building covariance [ 38%] 1s
@> Building covariance [ 39%] 1s
@> Building covariance [ 40%] 1s
@> Building covariance [ 41%] 1s
@> Building covariance [ 42%] 1s
@> Building covariance [ 43%] 1s
@> Building covariance [ 44%] 1s
@> Building covariance [ 45%] 1s
@> Building covariance [ 46%] 1s
@> Building covariance [ 47%] 1s
@> Building covariance [ 48%] 1s
@> Building covariance [ 49%] 1s
@> Building covariance [ 50%] 1s
@> Building covariance [ 51%] 1s
@> Building covariance [ 52%] 1s
@> Building covariance [ 53%] 1s
@> Building covariance [ 54%] 1s
@> Building covariance [ 55%] 1s
@> Building covariance [ 56%] 1s
@> Building covariance [ 57%] 1s
@> Building covariance [ 58%] 1s
@> Building covariance [ 59%] 1s
@> Building covariance [ 60%] 1s
@> Building covariance [ 61%] 1s
@> Building covariance [ 62%] 1s
@> Building covariance [ 63%] 1s
@> Building covariance [ 64%] 1s
@> Building covariance [ 65%] 1s
@> Building covariance [ 66%] 1s
@> Building covariance [ 67%] 1s
@> Building covariance [ 68%] 1s
@> Building covariance [ 69%] 1s
@> Building covariance [ 70%] 1s
@> Building covariance [ 71%] 1s
@> Building covariance [ 72%] 1s
@> Building covariance [ 73%] 1s
@> Building covariance [ 74%] 1s
@> Building covariance [ 75%] 1s
@> Building covariance [ 76%] 1s
@> Building covariance [ 77%] 1s
@> Building covariance [ 78%] 1s
@> Building covariance [ 79%] 1s
@> Building covariance [ 80%] 1s
@> Building covariance [ 81%] 1s
@> Building covariance [ 82%] 1s
@> Building covariance [ 83%] 1s
@> Building covariance [ 84%] 1s
@> Building covariance [ 85%] 1s
@> Building covariance [ 86%] 1s
@> Building covariance [ 87%] 1s
@> Building covariance [ 88%] 1s
@> Building covariance [ 89%] 1s
@> Building covariance [ 90%] 1s
@> Building covariance [ 91%] 1s
@> Building covariance [ 92%] 1s
@> Building covariance [ 93%] 1s
@> Building covariance [ 94%] 1s
@> Building covariance [ 95%] 1s
@> Building covariance [ 96%] 1s
@> Building covariance [ 97%] 1s
@> Building covariance [ 98%] 1s
@> Building covariance [ 99%] 1s
@> Building covariance [100%] 0s
In [33]: eda.calcModes()
In [34]: eda
Out[34]: <EDA: mdm2 (20 modes; 85 atoms)>
```

### Save your work¶

You can save your work using ProDy function `saveModel()`

. This will
allow you to avoid repeating calculations when you return to your work later:

```
In [35]: saveModel(eda)
Out[35]: 'mdm2.eda.npz'
```

`loadModel()`

function can be used to load this object without any loss.

## Analysis¶

Let’s print fraction of variance for top raking 4 essential modes:

```
In [36]: for mode in eda_trajectory[:4]:
....: print calcFractVariance(mode).round(2)
....:
0.26
0.11
0.08
0.06
```

You can find more analysis functions in Dynamics Analysis.

## Plotting¶

Now, let’s project the trajectories onto top three essential modes:

```
In [37]: mdm2ca_sim1 = trajectory[:500]
In [38]: mdm2ca_sim1.superpose()
@> Superposing [ 1%]
@> Superposing [ 2%]
@> Superposing [ 3%]
@> Superposing [ 4%] 1s
@> Superposing [ 5%] 1s
@> Superposing [ 6%] 1s
@> Superposing [ 7%] 1s
@> Superposing [ 8%] 1s
@> Superposing [ 9%] 1s
@> Superposing [ 10%] 1s
@> Superposing [ 11%] 1s
@> Superposing [ 12%] 1s
@> Superposing [ 13%] 1s
@> Superposing [ 14%] 1s
@> Superposing [ 15%] 1s
@> Superposing [ 16%] 1s
@> Superposing [ 17%] 1s
@> Superposing [ 18%] 1s
@> Superposing [ 19%] 1s
@> Superposing [ 20%] 1s
@> Superposing [ 21%] 1s
@> Superposing [ 22%] 1s
@> Superposing [ 23%] 1s
@> Superposing [ 24%] 1s
@> Superposing [ 25%] 1s
@> Superposing [ 26%] 1s
@> Superposing [ 27%] 1s
@> Superposing [ 28%] 1s
@> Superposing [ 29%] 1s
@> Superposing [ 30%] 1s
@> Superposing [ 31%] 1s
@> Superposing [ 32%] 1s
@> Superposing [ 33%] 1s
@> Superposing [ 34%] 1s
@> Superposing [ 35%] 1s
@> Superposing [ 36%] 1s
@> Superposing [ 37%] 1s
@> Superposing [ 38%] 1s
@> Superposing [ 39%] 1s
@> Superposing [ 40%] 1s
@> Superposing [ 41%] 1s
@> Superposing [ 42%] 1s
@> Superposing [ 43%] 1s
@> Superposing [ 44%] 1s
@> Superposing [ 45%] 1s
@> Superposing [ 46%] 1s
@> Superposing [ 47%] 1s
@> Superposing [ 48%] 1s
@> Superposing [ 49%] 1s
@> Superposing [ 50%] 1s
@> Superposing [ 51%] 1s
@> Superposing [ 52%] 1s
@> Superposing [ 53%] 1s
@> Superposing [ 54%] 1s
@> Superposing [ 55%] 1s
@> Superposing [ 56%] 1s
@> Superposing [ 57%] 1s
@> Superposing [ 58%] 1s
@> Superposing [ 59%] 1s
@> Superposing [ 60%] 1s
@> Superposing [ 61%] 1s
@> Superposing [ 62%] 1s
@> Superposing [ 63%] 1s
@> Superposing [ 64%] 1s
@> Superposing [ 65%] 1s
@> Superposing [ 66%] 1s
@> Superposing [ 67%] 1s
@> Superposing [ 68%] 1s
@> Superposing [ 69%] 1s
@> Superposing [ 70%] 1s
@> Superposing [ 71%] 1s
@> Superposing [ 72%] 1s
@> Superposing [ 73%] 1s
@> Superposing [ 74%] 1s
@> Superposing [ 75%] 1s
@> Superposing [ 76%] 1s
@> Superposing [ 77%] 1s
@> Superposing [ 78%] 1s
@> Superposing [ 79%] 1s
@> Superposing [ 80%] 1s
@> Superposing [ 81%] 1s
@> Superposing [ 82%] 1s
@> Superposing [ 83%] 1s
@> Superposing [ 84%] 1s
@> Superposing [ 85%] 1s
@> Superposing [ 86%] 1s
@> Superposing [ 87%] 1s
@> Superposing [ 88%] 1s
@> Superposing [ 89%] 1s
@> Superposing [ 90%] 1s
@> Superposing [ 91%] 1s
@> Superposing [ 92%] 1s
@> Superposing [ 93%] 1s
@> Superposing [ 94%] 1s
@> Superposing [ 95%] 1s
@> Superposing [ 96%] 1s
@> Superposing [ 97%] 1s
@> Superposing [ 98%] 1s
@> Superposing [ 99%] 1s
In [39]: mdm2ca_sim2 = trajectory[500:]
In [40]: mdm2ca_sim2.superpose()
@> Superposing [ 1%]
@> Superposing [ 2%]
@> Superposing [ 3%]
@> Superposing [ 4%] 1s
@> Superposing [ 5%] 1s
@> Superposing [ 6%] 1s
@> Superposing [ 7%] 1s
@> Superposing [ 8%] 1s
@> Superposing [ 9%] 1s
@> Superposing [ 10%] 1s
@> Superposing [ 11%] 1s
@> Superposing [ 12%] 1s
@> Superposing [ 13%] 1s
@> Superposing [ 14%] 1s
@> Superposing [ 15%] 1s
@> Superposing [ 16%] 1s
@> Superposing [ 17%] 1s
@> Superposing [ 18%] 1s
@> Superposing [ 19%] 1s
@> Superposing [ 20%] 1s
@> Superposing [ 21%] 1s
@> Superposing [ 22%] 1s
@> Superposing [ 23%] 1s
@> Superposing [ 24%] 1s
@> Superposing [ 25%] 1s
@> Superposing [ 26%] 1s
@> Superposing [ 27%] 1s
@> Superposing [ 28%] 1s
@> Superposing [ 29%] 1s
@> Superposing [ 30%] 1s
@> Superposing [ 31%] 1s
@> Superposing [ 32%] 1s
@> Superposing [ 33%] 1s
@> Superposing [ 34%] 1s
@> Superposing [ 35%] 1s
@> Superposing [ 36%] 1s
@> Superposing [ 37%] 1s
@> Superposing [ 38%] 1s
@> Superposing [ 39%] 1s
@> Superposing [ 40%] 1s
@> Superposing [ 41%] 1s
@> Superposing [ 42%] 1s
@> Superposing [ 43%] 1s
@> Superposing [ 44%] 1s
@> Superposing [ 45%] 1s
@> Superposing [ 46%] 1s
@> Superposing [ 47%] 1s
@> Superposing [ 48%] 1s
@> Superposing [ 49%] 1s
@> Superposing [ 50%] 1s
@> Superposing [ 51%] 1s
@> Superposing [ 52%] 1s
@> Superposing [ 53%] 1s
@> Superposing [ 54%] 1s
@> Superposing [ 55%] 1s
@> Superposing [ 56%] 1s
@> Superposing [ 57%] 1s
@> Superposing [ 58%] 1s
@> Superposing [ 59%] 1s
@> Superposing [ 60%] 1s
@> Superposing [ 61%] 1s
@> Superposing [ 62%] 1s
@> Superposing [ 63%] 1s
@> Superposing [ 64%] 1s
@> Superposing [ 65%] 1s
@> Superposing [ 66%] 1s
@> Superposing [ 67%] 1s
@> Superposing [ 68%] 1s
@> Superposing [ 69%] 1s
@> Superposing [ 70%] 1s
@> Superposing [ 71%] 1s
@> Superposing [ 72%] 1s
@> Superposing [ 73%] 1s
@> Superposing [ 74%] 1s
@> Superposing [ 75%] 1s
@> Superposing [ 76%] 1s
@> Superposing [ 77%] 1s
@> Superposing [ 78%] 1s
@> Superposing [ 79%] 1s
@> Superposing [ 80%] 1s
@> Superposing [ 81%] 1s
@> Superposing [ 82%] 1s
@> Superposing [ 83%] 1s
@> Superposing [ 84%] 1s
@> Superposing [ 85%] 1s
@> Superposing [ 86%] 1s
@> Superposing [ 87%] 1s
@> Superposing [ 88%] 1s
@> Superposing [ 89%] 1s
@> Superposing [ 90%] 1s
@> Superposing [ 91%] 1s
@> Superposing [ 92%] 1s
@> Superposing [ 93%] 1s
@> Superposing [ 94%] 1s
@> Superposing [ 95%] 1s
@> Superposing [ 96%] 1s
@> Superposing [ 97%] 1s
@> Superposing [ 98%] 1s
@> Superposing [ 99%] 1s
# We project independent trajectories in different color
In [41]: showProjection(mdm2ca_sim1, eda[:3], color='red', marker='.');
In [42]: showProjection(mdm2ca_sim2, eda[:3], color='blue', marker='.');
# Now let's mark the beginning of the trajectory with a circle
In [43]: showProjection(mdm2ca_sim1[0], eda[:3], color='red', marker='o', ms=12);
In [44]: showProjection(mdm2ca_sim2[0], eda[:3], color='blue', marker='o', ms=12);
# Now let's mark the end of the trajectory with a square
In [45]: showProjection(mdm2ca_sim1[-1], eda[:3], color='red', marker='s', ms=12);
In [46]: showProjection(mdm2ca_sim2[-1], eda[:3], color='blue', marker='s', ms=12);
```

You can find more plotting functions in Dynamics Analysis and Measurement Tools modules.

## Visualization¶

The above projection is shown for illustration. Interpreting the essential modes and projection of snapshots onto them is case dependent. One should know what kind of motion the top essential modes describe. You can use Normal Mode Wizard for visualizing essential mode shapes and fluctuations along these modes.

We can write essential modes in NMD Format for NMWiz as follows:

```
In [47]: writeNMD('mdm2_eda.nmd', eda[:3], structure.select('calpha'))
Out[47]: 'mdm2_eda.nmd'
```