Skip to content

Commit

Permalink
add @davidercruz as author and small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
orbeckst committed Mar 6, 2020
1 parent 4012363 commit b0d3d62
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions _posts/2020-03-06-on-the-fly-transformations.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ shine is coupling it to a visualization widget such as
Now it's time to learn how to use the trajectory transformations in MDAnalysis. During the
following steps, we will apply some transformations on a 1 ns trajectory of a simple
19-residue peptide embeded in a 128-DMPC membrane, showing the
[Gromacs](https://www.gromacs.org) `trjconv` command and the equivalent MDAnalysis code
[Gromacs](http://www.gromacs.org) `trjconv` command and the equivalent MDAnalysis code
and output. To keep things lightweight, frames are were taken every 100 ps, and water
molecules were removed. This can be easily done with MDAnalysis.

Expand Down Expand Up @@ -143,9 +143,8 @@ and rotations of the molecule, allowing us to have a better look at the structur
our simulations.
If we want to do this using `trjconv` we would do have to do this in two steps:

gmx trjconv -f pept_in_memb.xtc -s pept_in_memb.tpr -pbc mol -center -o midstep.xtc

gmx trjconv -f midstep.xtc -s pept_in_memb.tpr -fit rot+trans -o output.xtc
gmx trjconv -f pept_in_memb.xtc -s pept_in_memb.tpr -pbc mol -center -o midstep.xtc
gmx trjconv -f midstep.xtc -s pept_in_memb.tpr -fit rot+trans -o output.xtc

And we choose `Protein` as the group to be centered and for the least squares fitting.

Expand Down Expand Up @@ -220,14 +219,14 @@ it becomes particularly useful when observing protein insertion.
The beauty of MDAnalysis transformations is the ability to easily create custom transformations.
All transformations must have the following structure:

```Python
```python
def custom_transform(args): # arguments at this point are not mandatory
#do some things

def wrapped(ts):
# this wrapped function must only take a Timestep as argument
# this is where the actual changes to the timestep must be done
# This wrapped function must only take a Timestep as argument
# and perform the actual changes to the timestep

return ts

return wrapped
Expand Down Expand Up @@ -315,9 +314,12 @@ nv.show_mdanalysis(u)
The two examples of custom transformations shown here are very simple. But
more complex things can be done, and we encourage you to try them!

This has been a quick demonstration on the power of the new on-the-fly transformations
of MDAnalysis. There are more transformations available for you to explore and a whole
lot more for you to create for your own molecular system. More information on trajectory
transformations can be found in the [online docs of MDAnalysis](https://www.mdanalysis.org/mdanalysis).
nv.show_mdanalysis(u)
```
This has been a quick demonstration on the power of the new on-the-fly transformations of
MDAnalysis. There are more transformations available for you to explore and a whole lot
more for you to create for your own molecular system. More [information on trajectory
transformations]({{ site.docs.mdanalysis.url
}}/documentation_pages/trajectory_transformations.html) can be found in the online docs of
MDAnalysis .


@davidercruz

0 comments on commit b0d3d62

Please sign in to comment.