salilab / pmi

Python Modeling Interface
https://integrativemodeling.org/nightly/doc/ref/namespaceIMP_1_1pmi.html
12 stars 11 forks source link

Deleting fragment / beads from RMF in PMI 2.0 #246

Open ichem001 opened 6 years ago

ichem001 commented 6 years ago

I have been trying to delete a fragment from an RMF file (basically all 10-residue beads in rigid bodies) in PMI2.

We used to be able to do that in PMI1 by looping through the hierarchy and call IMP.atom.destroy.(p) if p was one such bead. I tried to reproduce that in PMI2 and it did not work - I also tried using IMP.atom.Selection and play with sets of different members and randomly deleting some to check if this is still working but unfortunately that does not work -

@benmwebb has checked the IMP.atom.Representation decorator definition to see if there is a way to delete a representation in PMI2 and it does not seem to be a feature yet.

Thanks

Pellarin commented 5 years ago

It is not a good practice to remove a particle from a PMI2 hierarchy, because:

1) there could be gaussians related to it 2) it could be part of a rigid body, so one has to tear down the corresponding rigid body, and then rebuild it.

I think the cleanest way to achieve it is to generate a new structure/molecule and copy all the needed descriptors/decorator-values, and deleting the old molecule hierarchy node. Let me know if you need more info.