Skip to content

Commit

Permalink
Improve PDB warning message to help with large structures (#4714)
Browse files Browse the repository at this point in the history
* Improve warning message to help with debugging on very large structures.

* Update test assertion.
  • Loading branch information
JoaoRodrigues committed Apr 29, 2024
1 parent 5f25209 commit 2906ac6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Bio/PDB/StructureBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ def init_residue(self, resname: str, field: str, resseq: int, icode: str):
# if this exception is ignored, a residue will be missing
self.residue = None
raise PDBConstructionException(
"Blank altlocs in duplicate residue %s ('%s', %i, '%s')"
% (resname, field, resseq, icode)
"Blank altlocs in duplicate residue %s ('%s', %i, '%s') of chain '%s'"
% (resname, field, resseq, icode, self.chain.id)
)
self.chain.detach_child(res_id)
new_residue = Residue(res_id, resname, self.segid)
Expand Down
2 changes: 1 addition & 1 deletion Tests/test_PDB_PDBParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def test_1_flawedpdb_permissive(self):
"Atom N defined twice in residue <Residue ARG het= resseq=2 icode= > at line 22.",
"disordered atom found with blank altloc before line 34.",
"Residue (' ', 4, ' ') redefined at line 44.",
"Blank altlocs in duplicate residue SER (' ', 4, ' ') at line 44.",
"Blank altlocs in duplicate residue SER (' ', 4, ' ') of chain 'A' at line 44.",
"Residue (' ', 10, ' ') redefined at line 76.",
"Residue (' ', 14, ' ') redefined at line 107.",
"Residue (' ', 16, ' ') redefined at line 136.",
Expand Down

0 comments on commit 2906ac6

Please sign in to comment.