Skip to content

Write correct fields in PDB TER record - #989

Merged
peterjc merged 2 commits into
biopython:masterfrom
lennax:2292
Mar 24, 2017
Merged

peterjc merged 2 commits into
biopython:masterfrom
lennax:2292

Conversation

@lennax

@lennax lennax commented Nov 12, 2016 •

Copy link
Copy Markdown
Contributor

Slight modification of original PDBIO.diff
Closes https://redmine.open-bio.org/issues/2292

Bio.PDBIO is happy to write TER records as "TER\n", which is inconsistent with PDB format specification.

The PDB format requires that TER records have some fields similar to ATOM records:
'''The TER record has the same residue name, chain identifier, sequence number and insertion code as the terminal residue. The serial number of the TER record is one number greater than the serial number of the ATOM/HETATM preceding the TER.'''

[See http://www.wwpdb.org/documentation/format23/sect9.html#TER]

It leads to problem with programs that require correct TER records (like multiple structural alignment program MUSTANG), and crash when they are not found.

PDBIO.diff - Proposed patch to PDBIO.py (656 Bytes) Michal J., 05/13/2007 05:31 PM

@peterjc

peterjc commented Nov 12, 2016

Copy link
Copy Markdown
Member

@etal or @JoaoRodrigues - could you review this please?

@peterjc

peterjc commented Nov 12, 2016

Copy link
Copy Markdown
Member

We'd also need to get in touch with Michal to get his agreement to dual licence the contribution - and ask if he wants to be included in the NEWS and CONTRIB file.

@JoaoRodrigues JoaoRodrigues self-assigned this Jan 26, 2017
@JoaoRodrigues

Copy link
Copy Markdown
Member

I'll have a look.

@peterjc

peterjc commented Jan 27, 2017

Copy link
Copy Markdown
Member

Looks like a test needs updating:

======================================================================
FAIL: test_pdbio_write_truncated (test_PDB.ParseTest)
Test parsing of truncated lines
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/biopython/biopython/Tests/test_PDB.py", line 524, in test_pdbio_write_truncated
    self.assertEqual(record_set, set())
AssertionError: Items in the first set but not the second:
'TER   '
----------------------------------------------------------------------

@codecov-io

codecov-io commented Feb 4, 2017 •

Copy link
Copy Markdown

Codecov Report

Merging #989 into master will increase coverage by 0.22%.

@@            Coverage Diff             @@
##           master     #989      +/-   ##
==========================================
+ Coverage   80.31%   80.53%   +0.22%     
==========================================
  Files         319      320       +1     
  Lines       48754    49003     +249     
==========================================
+ Hits        39157    39465     +308     
+ Misses       9597     9538      -59
Impacted Files Coverage Δ
Bio/PDB/PDBIO.py 74.45% <100%> (+0.01%) ✅
Bio/PDB/DSSP.py 54.54% <ø> (-4.08%) ❌
Bio/motifs/transfac.py 82% <ø> (-0.82%) ❌
Bio/motifs/matrix.py 76.31% <ø> (-0.41%) ❌
Bio/SearchIO/ExonerateIO/_base.py 97.58% <ø> (-0.17%) ❌
Bio/SeqIO/QualityIO.py 88.94% <ø> (-0.03%) ❌
Bio/SeqIO/_index.py 94.45% <ø> (ø) ✅
Bio/SeqRecord.py 92.23% <ø> (ø) ✅
Bio/ExPASy/cellosaurus.py 89.18% <ø> (ø)
Bio/SeqIO/InsdcIO.py 94.4% <ø> (+0.02%) ✅
... and 18 more

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 c1f93f3...10daaf6. Read the comment docs.

@peterjc

peterjc commented Feb 4, 2017

Copy link
Copy Markdown
Member

Thanks Lenna. I have emailed Michal at the address he used on our RedMine (and CC'd you) to ask about acknowledgement and licensing.

@peterjc

peterjc commented Mar 24, 2017

Copy link
Copy Markdown
Member

I was able track down Michal earlier this month, he is @mgajda on GitHub, and has kindly agreed by email to dual license this contribution under both Biopython License Agreement AND the BSD
3-Clause License (see #898) and to being named as a contributor.

@peterjc
peterjc merged commit 681723e into biopython:master Mar 24, 2017
peterjc added a commit that referenced this pull request Mar 24, 2017
See preceeding commit from pull request #989, rescued
from https://redmine.open-bio.org/issues/2292 by Lenna,
originally contributed by Michal in 2007.
@peterjc

peterjc commented Mar 24, 2017

Copy link
Copy Markdown
Member

Thank you Lenna & Michal, my apologies again that this was forgotten about for so long.

MarkusPiotrowski pushed a commit to MarkusPiotrowski/biopython that referenced this pull request Oct 31, 2017
See preceeding commit from pull request biopython#989, rescued
from https://redmine.open-bio.org/issues/2292 by Lenna,
originally contributed by Michal in 2007.
@peterjc peterjc mentioned this pull request Aug 14, 2019
8 of 9 tasks
@peterjc peterjc mentioned this pull request Aug 3, 2021
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants