MDAnalysis / binder-notebook

Notebooks for interactive use on https://mybinder.org/
https://mybinder.org/v2/gh/MDAnalysis/binder-notebook/master?filepath=notebooks
GNU General Public License v3.0
4 stars 7 forks source link

FAQ example: creating new chain/segid identifiers #12

Open orbeckst opened 5 years ago

orbeckst commented 5 years ago

Show how to create custom segid identifiers (so that one can write a PDB file with custom ChainIDs).

See also https://github.com/MDAnalysis/mdanalysis/issues/1105 and https://github.com/MDAnalysis/mdanalysis/issues/947

orbeckst commented 5 years ago

@richardjgowers said:

The problem here is assigning new names won’t create new segments. Instead this should work:

newseg = U.add_Segment(segid=‘T’)
U.select_atoms('bynum 1201:2400').residues.segments = newseg