haddocking / pdb-tools

A dependency-free cross-platform swiss army knife for PDB files.
https://haddocking.github.io/pdb-tools/
Apache License 2.0
372 stars 113 forks source link

Behaviour in `selaltloc` #115

Closed joaomcteixeira closed 2 years ago

joaomcteixeira commented 2 years ago

While working for https://github.com/haddocking/haddock3/pull/144 I found that pdb_selaltloc is likely doing more than what it should. (Or maybe I am wrong).

pdb_selaltloc properly corrects for altLoc, but it also:

I would like selaltloc to do just alternative locations. It would be easier if all altLocs had a letter in its right position for the PDB line. But, as we can see from the pdbtools test example, that is not the case:

https://github.com/haddocking/pdb-tools/blob/2fecdebd7520505b68ab515c54fa7c128e7a8090/tests/data/dummy_altloc2.pdb#L43-L58

@JoaoRodrigues Can't we really rewrite selaltloc to rely only on altLoc and occupancy? Are there any edge cases that hinder this?

I wrote a mini-pdb-example demonstrating my point. You can run pdb_selaltloc on it. I would expect only residue 1 is corrected and nothing more.

Download it here -> wget https://pastebin.com/raw/KU3FxXF9 -O selaltloc_example.pdb

amjjbonvin commented 2 years ago

pdb_selaltloc properly corrects for altLoc, but it also:

removes residues when residue numbers are repeated removes insertions

This is bad - we have other tools for that. This behaviour must be corrected