mittinatten/freesasa

freesasa.Structure needs a .insertionCode() method

jaredsagendorf opened this issue · 5 comments

Hello, there are many PDB structures which require not only a residue number and chain label, but also an insertion code in order to uniquely identify a residue. For example, in 2ok0, we have the following residues:

LEU H 82
SER H 82A
SER H 82B
LEU H 82C

Currently, freesasa does not let us distinguish the residues LEU 82/LEU 82C and SER 82A/SER 82B. If we could get the insertion code for an atom, we'd know exactly which residue it belong to. I hope this can be added at some point.

Hi,
Are you using the latest version? This should have been fixed (see #30). If you are using the latest version, could you send me a PDB snippet that doesn't work? (e.g. paste it as code in this thread)
Simon

Hello thanks for the reply. I updated to the latest version, and I do see that the insertion code is now appended to the Structure.residueNumber() string - that's great. Although the documentation is not clear on this point, it would be good to update that.

Insertion codes are still ignored when Structure object is created from freesasa.structureFromBioPDB() however, although I realize this is flagged as an "experimental" method.

Cheers

Thanks for the input! I'll update the documentation, and adding an insertion code method to the Structure class would make sense as well.

I'll see what I can do about BioPDB, the insertion code information should be transferred if it's in the BioPDB structure. I don't use BioPDB myself, and just added it as a convenience, so if you have any other input on how to improve that interface it would be welcome!

I have updated the python module with documentation for the insertion codes, and code to import them from BioPDB. https://github.com/freesasa/freesasa-python. Not sure when this will make into the pypi package, but the online documentation should be updated soon too.

freesasa/freesasa-python@2b84d95

That's great, thanks for the quick response!