Skip to content

Commit d6a9604

Browse files
committed
Logging for resolution parsing: warn only when they are actually different
1 parent 8af5253 commit d6a9604

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1406,7 +1406,7 @@ public void handleResolutionLine(String line, Pattern pR) {
14061406
try {
14071407
float res = Float.parseFloat(resString);
14081408
final float resInHeader = pdbHeader.getResolution();
1409-
if (resInHeader!=PDBHeader.DEFAULT_RESOLUTION && resInHeader != res) {
1409+
if (resInHeader!=PDBHeader.DEFAULT_RESOLUTION && Math.abs(resInHeader - res) > 0.001) {
14101410
logger.warn("More than 1 resolution value present, will use last one {} and discard previous {} "
14111411
,resString, String.format("%4.2f",resInHeader));
14121412
}

‎biojava-structure/src/main/java/org/biojava/nbio/structure/io/cif/CifStructureConsumerImpl.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,8 @@ public void consumeRefine(Refine refine) {
856856
// we take the last one found so that behaviour is like in PDB file parsing
857857
double lsDResHigh = refine.getLsDResHigh().get(rowIndex);
858858
// TODO this could use a check to keep reasonable values - 1.5 may be overwritten by 0.0
859-
if (pdbHeader.getResolution() != PDBHeader.DEFAULT_RESOLUTION) {
859+
if (pdbHeader.getResolution() != PDBHeader.DEFAULT_RESOLUTION &&
860+
Math.abs(pdbHeader.getResolution() - lsDResHigh) > 0.001) {
860861
logger.warn("More than 1 resolution value present, will use last one {} and discard previous {}",
861862
lsDResHigh, String.format("%4.2f",pdbHeader.getResolution()));
862863
}

0 commit comments

Comments
 (0)