haddocking / pdb-tools

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

Development suggestion: Behaviour of pdb_reres and pdb_shiftres #133

Closed KasperBuskPedersen closed 2 years ago

KasperBuskPedersen commented 2 years ago

Hi

Even though you state clearly that residues above 9999 are not supported for e.g pdb_reres and pdb_shiftres, it would be very nice if you could modify the code to just cycle back to 1 and start over. Currently everything above 9999 is just thrown away, which is not that useful. Usually my usecase is that i want to renumber residues in a protein in the top of a pdb file which also contains water and lipids. By cycling, one could renumber the protein and keep the total atoms.

Alternatively it would be nice with options that could deal with water / non-protein residue numbers.

Thank you in advance Best, Kasper

joaomcteixeira commented 2 years ago

Hi @KasperBuskPedersen

Thanks for your comment. It is an interesting one, and we have discussed this internally several times. It is a hard choice for us because there are countless possibilities within the PDB world. And, if we change the behavior to your suggestion, someone else would complain otherwise.

But, here's an alternative: separate the protein from the rest first; edit the residues accordingly and merge the PDBs back.

pdb_selchain -A,B your.pdb > only_protein.pdb
pdb_selchain -C,D your.pdb > only_water_lipids.pdb
pdb_reres -66 only_protein.pdb > reres_protein.pdb
pdb_merge reres_protein.pdb only_water_lipids.pdb | pdb_tidy > new.pdb

Let us know if worked for you and if we can help you further, Cheers and thanks for using pdb-tools.

KasperBuskPedersen commented 2 years ago

Hi Joao

Okay. Thank you, I will try that.

Cheers, Kasper

joaomcteixeira commented 2 years ago

Hi Kasper, I assume you have solved your issue. We appreciate your time and using pdb-tools :relaxed: I am closing the issue, but feel free to reopen it if you need it. Cheers,