Skip to content

Commit 73343ef

Browse files
committed
Resolution defaults to 99 if no value is available.
1 parent 0dea8f5 commit 73343ef

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

biojava-structure/src/main/java/org/biojava/nbio/structure/PDBHeader.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,16 @@ public void setCrystallographicInfo(PDBCrystallographicInfo crystallographicInfo
580580
this.crystallographicInfo = crystallographicInfo;
581581
}
582582

583+
/**
584+
* Returns the resolution (or effective resolution) of the experiment. This is
585+
* related to <code>_refine.ls_d_res_high</code> (DIFFRACTION) or
586+
* <code>_em_3d_reconstruction.resolution</code> (ELECTRON MICROSCOPY) for mmCif
587+
* format, or to <code>REMARK 2</code> or <code>REMARK 3</code> for PDB legacy
588+
* format. If more than one value is available (in rare cases), the last one is
589+
* reported. If no value is available, it defaults to 99.
590+
*
591+
* @return The reported experiment resolution, 99 if no value is available.
592+
*/
583593
public float getResolution() {
584594
return resolution;
585595
}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -651,8 +651,10 @@ public void consumeDatabasePDBRevRecord(DatabasePDBRevRecord databasePDBrevRecor
651651
public void consumeEm3dReconstruction(Em3dReconstruction em3dReconstruction) {
652652
this.em3dReconstruction = em3dReconstruction;
653653

654-
for (int rowIndex = 0; rowIndex < em3dReconstruction.getRowCount(); rowIndex++) {
655-
pdbHeader.setResolution((float) em3dReconstruction.getResolution().get(rowIndex)); //can it have more than 1 value?
654+
for (int rowIndex = 0; rowIndex < em3dReconstruction.getRowCount(); rowIndex++) { //can it have more than 1 value?
655+
final FloatColumn resolution = em3dReconstruction.getResolution();
656+
if (ValueKind.PRESENT.equals(resolution.getValueKind(rowIndex)))
657+
pdbHeader.setResolution((float) resolution.get(rowIndex));
656658
}
657659
//TODO other fields (maybe RFree)?
658660
}

0 commit comments

Comments
 (0)