Comment #2 on issue 202 by richardjgowers: AtomGroup.set_resnum &
set_resname
https://code.google.com/p/mdanalysis/issues/detail?id=202
https://code.google.com/p/mdanalysis/source/detail?r=a5f30fb67db976209e564cb7ee6d86dcf3518fb5&name=feature-residues
I've pushed a very experimental feature branch which eventually will fix
this.
Stuff that needs discussion:
Creating Residue/Segment objects now adds them to Universe, is this ugly?
or a good way of making sure that nothing gets lost. The idea here is that
everything should live in Universe.
Propagating information between levels. Does changing an Atom's residue
level information (resname, resid) indicate that the Residue should be
changed?
ie Atom.set_resname == Atom.residue.set_resname
Or should resname be read only, and the only Residue level information I
can change be resid, which actually moves the Atom into a new Residue?
To change resname instead
Atom.residue.set_resname(new)
Then if I changed an Atom's segid, does this change
1) Only the atom? (current behaviour)
2) The Residue it belongs to? Then changing all Atoms in the same Residue?
3) The entire segment and all Res & Atom within?
Or should segid be read-only from an Atom and instead only Residues can
change this as the method for moving them into new Segments?
Also, Residues/Segments now lazily built, but this should ideally be
impossible to notice!