Running this with version 5.0.1:
public class DemoCifReader {
private static Logger logger = LoggerFactory.getLogger(DemoCifReader.class);
public static void main(String[] args) throws Exception {
String pdbId = "9a2f";
boolean parseBinary = true;
CifFile cifFile;
if (parseBinary) {
cifFile = CifIO.readFromURL(new URL("https://models.rcsb.org/" + pdbId + ".bcif"));
} else {
cifFile = CifIO.readFromURL(new URL("https://files.rcsb.org/download/" + pdbId + ".cif"));
}
MmCifFile mmCifFile = cifFile.as(StandardSchemata.MMCIF);
MmCifBlock data = mmCifFile.getFirstBlock();
AtomSite atomSite = data.getAtomSite();
FloatColumn biso = atomSite.getBIsoOrEquiv();
FloatColumn cartnX = atomSite.getCartnX();
for (int i=0; i<biso.getRowCount(); i++) {
biso.get(i);
//cartnX.get(i);
if (i%1000 == 0) logger.info(".");
}
}
}
Results in a runtime of more than 5 minutes. It goes through 1000 biso values in ~ 1s.
However the full file is parsed in mere milliseconds in 2 alternative scenarios:
biso.get(i) is commented out and cartnX.get(i) is executed instead
- reading CIF instead of BCIF (set
parseBinary=false)
Any ideas of what might be happening here?
Running this with version 5.0.1:
Results in a runtime of more than 5 minutes. It goes through 1000 biso values in ~ 1s.
However the full file is parsed in mere milliseconds in 2 alternative scenarios:
biso.get(i)is commented out andcartnX.get(i)is executed insteadparseBinary=false)Any ideas of what might be happening here?