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

treatment of MASTER lines #89

Closed joaomcteixeira closed 3 years ago

joaomcteixeira commented 3 years ago

Hi,

Sorry for not raising an issue for this, I thought going straight to a PR, in case you agree, it can be merged directly without further discussion.

I wanted to get the backbone of a specific PDB file.

pdb_fetch 5d8v | pdb_keepcoord | pdb_selatom -CA,C,N,O | pdb_delresname -HOH | pdb_selaltloc -A | pdb_reatom -1 | pdb_tidy > 5d8vBB.pdb

This gives a very clean file except for the MASTER line at the end:

ATOM    331  C   GLY A  83       5.965  20.737   8.504  0.55  4.29           C  
ATOM    332  O   GLY A  83       7.215  20.811   8.519  0.55  4.32           O  
TER     333      GLY A  83                                                      
MASTER      378    0    9    5    3    0   29    6  847    1   76    7          
END   

Yet, I believe after so many modifications, the MASTER line is a bit meaningless there. I thought the same way pdb_tidy is removing CONECT lines, as discussed in #72, it maybe should remove MASTER as well.

What do you think? If you agree, this PR already provides the modifications and some tests.

Also, I added the MASTER to the docstring of pdb_keepcoords, because it was keeping the MASTER without telling that to the user.

codecov[bot] commented 3 years ago

Codecov Report

Merging #89 (d4347eb) into master (30a7a7a) will increase coverage by 0.08%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #89      +/-   ##
==========================================
+ Coverage   81.92%   82.00%   +0.08%     
==========================================
  Files          46       46              
  Lines        3663     3663              
  Branches      763      763              
==========================================
+ Hits         3001     3004       +3     
+ Misses        470      469       -1     
+ Partials      192      190       -2     
Impacted Files Coverage Δ
pdbtools/pdb_keepcoord.py 93.33% <ø> (ø)
pdbtools/pdb_tidy.py 74.79% <100.00%> (+2.43%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 30a7a7a...d4347eb. Read the comment docs.

JoaoRodrigues commented 3 years ago

Thank you!