Skip to content

Commit

Permalink
Fix #2582: polymer persistence length example fix
Browse files Browse the repository at this point in the history
Added name to AUTHOR file
  • Loading branch information
ss62171 committed Mar 7, 2020
1 parent 1f4e492 commit 6226217
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions package/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ Chronological list of authors
- Hao Tian
- Hugo MacDermott-Opeskin
- Anshul Angaria
- Shubham Sharma



Expand Down
1 change: 1 addition & 0 deletions package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Fixes
argument. The directives parsed into bonds, angles, impropers, and dihedrals now
match TPRParser. (PR #2408)
* Added parmed to setup.py
* Fixed example docs for polymer persistence length (#2582)

Enhancements
* New analysis.hole2 module for HOLE interfacing. Contains a function (hole)
Expand Down
10 changes: 5 additions & 5 deletions package/MDAnalysis/analysis/polymer.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@
# so we can select the chains by using the .fragments attribute
chains = u.atoms.fragments
# select only the backbone atoms for each chain
backbones = [chain.select_atoms('not name O* H') for chain in chains]
backbones = [chain.select_atoms('not name O* H*') for chain in chains]
# sort the chains, removing any non-backbone atoms
sorted_backbones = [polymer.sort_backbone(bb) for bb in backbones]
lp = polymer.PersistenceLength(sorted_backbones)
persistence_length = polymer.PersistenceLength(sorted_backbones)
# Run the analysis, this will average over all polymer chains
# and all timesteps in trajectory
lp = lp.run()
print('The persistence length is: {}'.format(lp.pl))
persistence_length = persistence_length.run()
print('The persistence length is: {}'.format(persistence_length.lp))
# always check the visualisation of this:
lp.plot()
persistence_length.plot()
"""
from __future__ import division, absolute_import
Expand Down

0 comments on commit 6226217

Please sign in to comment.