mittinatten / freesasa

C-library for calculating Solvent Accessible Surface Areas
http://freesasa.github.io/
MIT License
105 stars 37 forks source link

freesasa.Structure needs a .insertionCode() method #39

Closed jaredsagendorf closed 6 years ago

jaredsagendorf commented 6 years ago

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.

mittinatten commented 6 years ago

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

jaredsagendorf commented 6 years ago

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

mittinatten commented 6 years ago

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!

mittinatten commented 6 years ago

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.

https://github.com/freesasa/freesasa-python/commit/2b84d95f3012f1452e55ae0a267d889472bc7138

jaredsagendorf commented 6 years ago

That's great, thanks for the quick response!