REMARK 465
simonbrent opened this issue · comments
Hi,
We would like to be able to label/render specific residues in a PDB structure based on chain ID:Residue Number combinations. Currently we are basing this on the internal numbering generated by PV but this does not appear to take into account missing residues in the structure (as detailed in REMARK 465) resulting in wrong placement of labels and rendering. Is it possible to render specific atoms on specific residues using chain identifier and PDB residue numbers?
Thanks.
PDB residue numbers and insertion codes are stored for each residue as num
and insCode
. To lookup a residue with a given residue number, you can use residueByRnum
on the chain, e.g. structure.chain('A').residueByRnum(5)
to get the residue with residue number 5. residueByRnum
does not support insertion codes yet, so if you depend on insertion codes you will need to manually loop over the chain. We have recently added support for the sequential atom ids stored in the PDB files. They are stored for each atom as the serial
property. You will need to update to master for this to work as this change is not yet included in any release.
I hope that helps
Ok, thanks
Hello , you say : ' insertion codes you will need to manually loop over the chain'. How can I do this to color residues for chain by custom color code.
Thanks,
To implement a custom color operation, you can follow this guide. Inside the callback, instead of using atom properties, you can get back to the parent residue the atom belongs to by calling atom.residue()
. Then it's up to you to map the the residue properties to the color. Does this answer your question? If not, could you elaborate what you are trying to achieve?