Skip to content

Commit 28815db

Browse files
committed
handle missing rfree/rwork
1 parent e9c59f6 commit 28815db

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import org.rcsb.cif.model.FloatColumn;
4040
import org.rcsb.cif.model.IntColumn;
4141
import org.rcsb.cif.model.StrColumn;
42+
import org.rcsb.cif.model.ValueKind;
4243
import org.rcsb.cif.schema.mm.AtomSite;
4344
import org.rcsb.cif.schema.mm.AtomSites;
4445
import org.rcsb.cif.schema.mm.AuditAuthor;
@@ -829,7 +830,7 @@ public void consumeRefine(Refine refine) {
829830
logger.warn("More than 1 Rfree value present, will use last one {} and discard previous {}",
830831
lsRFactorRFree, String.format("%4.2f",pdbHeader.getRfree()));
831832
}
832-
if (lsRFactorRFree.isDefined()) {
833+
if (lsRFactorRFree.isDefined() && lsRFactorRFree.getValueKind(rowIndex) == ValueKind.PRESENT) {
833834
pdbHeader.setRfree((float) lsRFactorRFree.get(rowIndex));
834835
} else {
835836
// some entries like 2ifo haven't got this field at all
@@ -842,7 +843,7 @@ public void consumeRefine(Refine refine) {
842843
logger.warn("More than 1 R work value present, will use last one {} and discard previous {} ",
843844
lsRFactorRWork, String.format("%4.2f",pdbHeader.getRwork()));
844845
}
845-
if (lsRFactorRWork.isDefined()) {
846+
if (lsRFactorRWork.isDefined() && lsRFactorRWork.getValueKind(rowIndex) == ValueKind.PRESENT) {
846847
pdbHeader.setRwork((float) lsRFactorRWork.get(rowIndex));
847848
} else {
848849
logger.info("_refine.ls_R_factor_R_work not present, not parsing R-work value");

0 commit comments

Comments
 (0)