Open GoogleCodeExporter opened 9 years ago
Doing some reading, this might tie in with Issue 193 too, looking at more than
resids when building residues.
Original comment by richardjgowers
on 19 Nov 2014 at 4:50
https://code.google.com/p/mdanalysis/source/detail?r=a5f30fb67db976209e564cb7ee6
d86dcf3518fb5&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!
Original comment by richardjgowers
on 25 Nov 2014 at 3:15
Everything is still a bit buggy, but it's getting there.
In [1]: import MDAnalysis as mda
In [2]: u = mda.Universe('adk.psf','adk_dims.dcd')
In [3]: r1 = u.residues[0]
In [4]: r2 = u.residues[1]
In [5]: ag = u.atoms[:10]
In [6]: len(r1)
Out[6]: 19
In [7]: len(r2)
Out[7]: 24
In [8]: ag.set_resid(2)
In [9]: len(r1)
Out[9]: 9
In [10]: len(r2)
Out[10]: 34
In [11]: r1.set_resid(215)
In [12]: len(r1)
Out[12]: 0
In [13]: rg = u.residues[:10]
In [14]: rg.set_segid('ABC')
In [15]: u.ABC
Out[15]: <Segment 'ABC'>
Original comment by richardjgowers
on 2 Dec 2014 at 10:41
Original comment by richardjgowers
on 12 Feb 2015 at 9:21
Original issue reported on code.google.com by
richardjgowers
on 19 Nov 2014 at 12:56