| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2c90336 commit 4824817
7 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,26 +2,65 @@ | |||
| 2 | 2 | ||
| 3 | 3 | import org.biojava.nbio.structure.*; | |
| 4 | 4 | import org.biojava.nbio.structure.io.*; | |
| 5 | + import org.biojava.nbio.structure.io.cif.CifFileConverter; | ||
| 6 | + import org.junit.Ignore; | ||
| 5 | 7 | import org.junit.Test; | |
| 6 | 8 | import org.rcsb.cif.CifReader; | |
| 7 | - import org.rcsb.cif.model.CifFile; | ||
| 8 | - import org.rcsb.cif.model.Column; | ||
| 9 | - import org.rcsb.cif.model.ValueKind; | ||
| 10 | 9 | ||
| 11 | - import java.io.ByteArrayInputStream; | ||
| 12 | 10 | import java.io.IOException; | |
| 13 | 11 | import java.io.InputStream; | |
| 14 | - import java.text.ParseException; | ||
| 15 | - import java.text.SimpleDateFormat; | ||
| 16 | - import java.util.Date; | ||
| 12 | + import java.nio.file.Files; | ||
| 13 | + import java.nio.file.Paths; | ||
| 17 | 14 | import java.util.List; | |
| 18 | - import java.util.Locale; | ||
| 19 | - import java.util.Objects; | ||
| 20 | - import java.util.zip.GZIPInputStream; | ||
| 15 | + import java.util.concurrent.atomic.AtomicInteger; | ||
| 21 | 16 | ||
| 22 | 17 | import static org.junit.Assert.*; | |
| 23 | 18 | ||
| 24 | 19 | public class CifFileConsumerImplTest { | |
| 20 | + @Test | ||
| 21 | + public void test2z4j() { | ||
| 22 | + | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | + @Test | ||
| 26 | + @Ignore | ||
| 27 | + public void parseEntireArchive() throws IOException { | ||
| 28 | + AtomicInteger counter = new AtomicInteger(0); | ||
| 29 | + AtomicInteger failed = new AtomicInteger(0); | ||
| 30 | + long start = System.nanoTime(); | ||
| 31 | + int chunkSize = 250; | ||
| 32 | + | ||
| 33 | + Files.walk(Paths.get( | ||
| 34 | + // change to your own paths | ||
| 35 | + // "/var/pdb/" // cif | ||
| 36 | + "/var/bcif/" // bcif | ||
| 37 | + )) | ||
| 38 | + .parallel() | ||
| 39 | + .filter(path -> !Files.isDirectory(path)) | ||
| 40 | + .forEach(path -> { | ||
| 41 | + int count = counter.incrementAndGet(); | ||
| 42 | + if (count % chunkSize == 0) { | ||
| 43 | + long end_chunk = System.nanoTime(); | ||
| 44 | + System.out.println("[" + count + "] @ " + (((end_chunk - start) / | ||
| 45 | + 1_000 / count) + " µs per structure")); | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + try { | ||
| 49 | + // the work is to obtain the CifFile instance and convert into a BioJava structure | ||
| 50 | + // CifFileConverter.convert(CifReader.readText(Files.newInputStream(path))); // cif | ||
| 51 | + CifFileConverter.convert(CifReader.readBinary(Files.newInputStream(path))); // bcif | ||
| 52 | + } catch (Exception e) { | ||
| 53 | + System.err.println("failed for " + path.toFile().getAbsolutePath()); | ||
| 54 | + e.printStackTrace(); | ||
| 55 | + failed.incrementAndGet(); | ||
| 56 | + } | ||
| 57 | + }); | ||
| 58 | + | ||
| 59 | + long end = System.nanoTime(); | ||
| 60 | + System.out.println((end - start) / 1_000_000_000 + " s"); | ||
| 61 | + System.out.println("failed for " + failed.intValue() + " structures"); | ||
| 62 | + } | ||
| 63 | + | ||
| 25 | 64 | private static boolean headerOnly; | |
| 26 | 65 | private static boolean binary; | |
| 27 | 66 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,8 +1,6 @@ | |||
| 1 | 1 | package org.biojava.nbio.structure.test.io.cif; | |
| 2 | 2 | ||
| 3 | 3 | import org.biojava.nbio.structure.*; | |
| 4 | - import org.biojava.nbio.structure.align.util.AtomCache; | ||
| 5 | - import org.biojava.nbio.structure.io.FileParsingParameters; | ||
| 6 | 4 | import org.biojava.nbio.structure.io.cif.CifFileConverter; | |
| 7 | 5 | import org.junit.Test; | |
| 8 | 6 | import org.rcsb.cif.CifReader; | |
@@ -15,11 +13,12 @@ | |||
| 15 | 13 | import java.nio.file.Files; | |
| 16 | 14 | import java.util.Arrays; | |
| 17 | 15 | ||
| 18 | - import static org.junit.Assert.*; | ||
| 16 | + import static org.junit.Assert.assertEquals; | ||
| 17 | + import static org.junit.Assert.assertNotNull; | ||
| 19 | 18 | ||
| 20 | 19 | public class CifFileSupplierImplTest { | |
| 21 | 20 | @Test | |
| 22 | - public void test1SMT() throws IOException, StructureException { | ||
| 21 | + public void test1SMT() throws IOException { | ||
| 23 | 22 | // an x-ray structure | |
| 24 | 23 | testRoundTrip("1SMT"); | |
| 25 | 24 | } | |
@@ -29,18 +28,18 @@ public void test1SMT() throws IOException, StructureException { | |||
| 29 | 28 | * @throws IOException propagated | |
| 30 | 29 | */ | |
| 31 | 30 | @Test | |
| 32 | - public void test2N3J() throws IOException, StructureException { | ||
| 31 | + public void test2N3J() throws IOException { | ||
| 33 | 32 | // an NMR structure (multimodel) with 2 chains | |
| 34 | 33 | testRoundTrip("2N3J"); | |
| 35 | 34 | } | |
| 36 | 35 | ||
| 37 | 36 | @Test | |
| 38 | - public void test1A2C() throws IOException, StructureException { | ||
| 37 | + public void test1A2C() throws IOException { | ||
| 39 | 38 | // a structure with insertion codes | |
| 40 | 39 | testRoundTrip("1A2C"); | |
| 41 | 40 | } | |
| 42 | 41 | ||
| 43 | - private static void testRoundTrip(String pdbId) throws IOException, StructureException { | ||
| 42 | + private static void testRoundTrip(String pdbId) throws IOException { | ||
| 44 | 43 | Structure originalStruct = CifFileConverter.convert(CifReader.readText(new URL("https://files.rcsb.org/download/" + pdbId | |
| 45 | 44 | + ".cif").openStream())); | |
| 46 | 45 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,7 +21,7 @@ | |||
| 21 | 21 | <dependency> | |
| 22 | 22 | <groupId>org.rcsb</groupId> | |
| 23 | 23 | <artifactId>ciftools-java</artifactId> | |
| 24 | - <version>1.0-SNAPSHOT</version> | ||
| 24 | + <version>0.3.0</version> | ||
| 25 | 25 | </dependency> | |
| 26 | 26 | <dependency> | |
| 27 | 27 | <groupId>org.rcsb</groupId> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,50 +1,6 @@ | |||
| 1 | 1 | package org.biojava.nbio.structure.io.cif; | |
| 2 | 2 | ||
| 3 | - import org.rcsb.cif.model.generated.atomsite.AtomSite; | ||
| 4 | - import org.rcsb.cif.model.generated.atomsites.AtomSites; | ||
| 5 | - import org.rcsb.cif.model.generated.auditauthor.AuditAuthor; | ||
| 6 | - import org.rcsb.cif.model.generated.cell.Cell; | ||
| 7 | - import org.rcsb.cif.model.generated.chemcomp.ChemComp; | ||
| 8 | - import org.rcsb.cif.model.generated.chemcompbond.ChemCompBond; | ||
| 9 | - import org.rcsb.cif.model.generated.databasepdbremark.DatabasePDBRemark; | ||
| 10 | - import org.rcsb.cif.model.generated.databasepdbrev.DatabasePDBRev; | ||
| 11 | - import org.rcsb.cif.model.generated.databasepdbrevrecord.DatabasePDBRevRecord; | ||
| 12 | - import org.rcsb.cif.model.generated.entity.Entity; | ||
| 13 | - import org.rcsb.cif.model.generated.entitypoly.EntityPoly; | ||
| 14 | - import org.rcsb.cif.model.generated.entitypolyseq.EntityPolySeq; | ||
| 15 | - import org.rcsb.cif.model.generated.entitysrcgen.EntitySrcGen; | ||
| 16 | - import org.rcsb.cif.model.generated.entitysrcnat.EntitySrcNat; | ||
| 17 | - import org.rcsb.cif.model.generated.exptl.Exptl; | ||
| 18 | - import org.rcsb.cif.model.generated.pdbxauditrevisionhistory.PdbxAuditRevisionHistory; | ||
| 19 | - import org.rcsb.cif.model.generated.pdbxchemcompidentifier.PdbxChemCompIdentifier; | ||
| 20 | - import org.rcsb.cif.model.generated.pdbxdatabasestatus.PdbxDatabaseStatus; | ||
| 21 | - import org.rcsb.cif.model.generated.pdbxentitydescriptor.PdbxEntityDescriptor; | ||
| 22 | - import org.rcsb.cif.model.generated.pdbxentitysrcsyn.PdbxEntitySrcSyn; | ||
| 23 | - import org.rcsb.cif.model.generated.pdbxmolecule.PdbxMolecule; | ||
| 24 | - import org.rcsb.cif.model.generated.pdbxmoleculefeatures.PdbxMoleculeFeatures; | ||
| 25 | - import org.rcsb.cif.model.generated.pdbxnonpolyscheme.PdbxNonpolyScheme; | ||
| 26 | - import org.rcsb.cif.model.generated.pdbxreferenceentitylink.PdbxReferenceEntityLink; | ||
| 27 | - import org.rcsb.cif.model.generated.pdbxreferenceentitylist.PdbxReferenceEntityList; | ||
| 28 | - import org.rcsb.cif.model.generated.pdbxreferenceentitypolylink.PdbxReferenceEntityPolyLink; | ||
| 29 | - import org.rcsb.cif.model.generated.pdbxstructassembly.PdbxStructAssembly; | ||
| 30 | - import org.rcsb.cif.model.generated.pdbxstructassemblygen.PdbxStructAssemblyGen; | ||
| 31 | - import org.rcsb.cif.model.generated.pdbxstructmodresidue.PdbxStructModResidue; | ||
| 32 | - import org.rcsb.cif.model.generated.pdbxstructoperlist.PdbxStructOperList; | ||
| 33 | - import org.rcsb.cif.model.generated.refine.Refine; | ||
| 34 | - import org.rcsb.cif.model.generated.struct.Struct; | ||
| 35 | - import org.rcsb.cif.model.generated.structasym.StructAsym; | ||
| 36 | - import org.rcsb.cif.model.generated.structconf.StructConf; | ||
| 37 | - import org.rcsb.cif.model.generated.structconn.StructConn; | ||
| 38 | - import org.rcsb.cif.model.generated.structconntype.StructConnType; | ||
| 39 | - import org.rcsb.cif.model.generated.structkeywords.StructKeywords; | ||
| 40 | - import org.rcsb.cif.model.generated.structncsoper.StructNcsOper; | ||
| 41 | - import org.rcsb.cif.model.generated.structref.StructRef; | ||
| 42 | - import org.rcsb.cif.model.generated.structrefseq.StructRefSeq; | ||
| 43 | - import org.rcsb.cif.model.generated.structrefseqdif.StructRefSeqDif; | ||
| 44 | - import org.rcsb.cif.model.generated.structsheetrange.StructSheetRange; | ||
| 45 | - import org.rcsb.cif.model.generated.structsite.StructSite; | ||
| 46 | - import org.rcsb.cif.model.generated.structsitegen.StructSiteGen; | ||
| 47 | - import org.rcsb.cif.model.generated.symmetry.Symmetry; | ||
| 3 | + import org.rcsb.cif.model.generated.*; | ||
| 48 | 4 | ||
| 49 | 5 | /** | |
| 50 | 6 | * Defines a rather generic interface which allows to populate some data structure with data parsed from a CIF file. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,59 +12,8 @@ | |||
| 12 | 12 | import org.biojava.nbio.structure.xtal.CrystalCell; | |
| 13 | 13 | import org.biojava.nbio.structure.xtal.SpaceGroup; | |
| 14 | 14 | import org.biojava.nbio.structure.xtal.SymoplibParser; | |
| 15 | - import org.rcsb.cif.model.Category; | ||
| 16 | - import org.rcsb.cif.model.Column; | ||
| 17 | - import org.rcsb.cif.model.generated.atomsite.*; | ||
| 18 | - import org.rcsb.cif.model.generated.atomsites.AtomSites; | ||
| 19 | - import org.rcsb.cif.model.generated.auditauthor.AuditAuthor; | ||
| 20 | - import org.rcsb.cif.model.generated.cell.Cell; | ||
| 21 | - import org.rcsb.cif.model.generated.chemcomp.ChemComp; | ||
| 22 | - import org.rcsb.cif.model.generated.chemcompbond.ChemCompBond; | ||
| 23 | - import org.rcsb.cif.model.generated.databasepdbremark.DatabasePDBRemark; | ||
| 24 | - import org.rcsb.cif.model.generated.databasepdbrev.DatabasePDBRev; | ||
| 25 | - import org.rcsb.cif.model.generated.databasepdbrevrecord.DatabasePDBRevRecord; | ||
| 26 | - import org.rcsb.cif.model.generated.entity.Entity; | ||
| 27 | - import org.rcsb.cif.model.generated.entitypoly.EntityPoly; | ||
| 28 | - import org.rcsb.cif.model.generated.entitypolyseq.EntityPolySeq; | ||
| 29 | - import org.rcsb.cif.model.generated.entitysrcgen.EntitySrcGen; | ||
| 30 | - import org.rcsb.cif.model.generated.entitysrcnat.EntitySrcNat; | ||
| 31 | - import org.rcsb.cif.model.generated.exptl.Exptl; | ||
| 32 | - import org.rcsb.cif.model.generated.pdbxauditrevisionhistory.PdbxAuditRevisionHistory; | ||
| 33 | - import org.rcsb.cif.model.generated.pdbxchemcompidentifier.PdbxChemCompIdentifier; | ||
| 34 | - import org.rcsb.cif.model.generated.pdbxdatabasestatus.PdbxDatabaseStatus; | ||
| 35 | - import org.rcsb.cif.model.generated.pdbxdatabasestatus.RecvdInitialDepositionDate; | ||
| 36 | - import org.rcsb.cif.model.generated.pdbxentitydescriptor.PdbxEntityDescriptor; | ||
| 37 | - import org.rcsb.cif.model.generated.pdbxentitysrcsyn.PdbxEntitySrcSyn; | ||
| 38 | - import org.rcsb.cif.model.generated.pdbxmolecule.PdbxMolecule; | ||
| 39 | - import org.rcsb.cif.model.generated.pdbxmoleculefeatures.PdbxMoleculeFeatures; | ||
| 40 | - import org.rcsb.cif.model.generated.pdbxnonpolyscheme.PdbxNonpolyScheme; | ||
| 41 | - import org.rcsb.cif.model.generated.pdbxreferenceentitylink.PdbxReferenceEntityLink; | ||
| 42 | - import org.rcsb.cif.model.generated.pdbxreferenceentitylist.PdbxReferenceEntityList; | ||
| 43 | - import org.rcsb.cif.model.generated.pdbxreferenceentitypolylink.PdbxReferenceEntityPolyLink; | ||
| 44 | - import org.rcsb.cif.model.generated.pdbxstructassembly.PdbxStructAssembly; | ||
| 45 | - import org.rcsb.cif.model.generated.pdbxstructassemblygen.PdbxStructAssemblyGen; | ||
| 46 | - import org.rcsb.cif.model.generated.pdbxstructmodresidue.PdbxStructModResidue; | ||
| 47 | - import org.rcsb.cif.model.generated.pdbxstructoperlist.PdbxStructOperList; | ||
| 48 | - import org.rcsb.cif.model.generated.refine.LsRFactorRFree; | ||
| 49 | - import org.rcsb.cif.model.generated.refine.LsRFactorRWork; | ||
| 50 | - import org.rcsb.cif.model.generated.refine.Refine; | ||
| 51 | - import org.rcsb.cif.model.generated.struct.Struct; | ||
| 52 | - import org.rcsb.cif.model.generated.structasym.StructAsym; | ||
| 53 | - import org.rcsb.cif.model.generated.structconf.StructConf; | ||
| 54 | - import org.rcsb.cif.model.generated.structconn.StructConn; | ||
| 55 | - import org.rcsb.cif.model.generated.structconntype.StructConnType; | ||
| 56 | - import org.rcsb.cif.model.generated.structkeywords.PdbxKeywords; | ||
| 57 | - import org.rcsb.cif.model.generated.structkeywords.StructKeywords; | ||
| 58 | - import org.rcsb.cif.model.generated.structncsoper.StructNcsOper; | ||
| 59 | - import org.rcsb.cif.model.generated.structref.StructRef; | ||
| 60 | - import org.rcsb.cif.model.generated.structrefseq.PdbxDbAlignBegInsCode; | ||
| 61 | - import org.rcsb.cif.model.generated.structrefseq.PdbxDbAlignEndInsCode; | ||
| 62 | - import org.rcsb.cif.model.generated.structrefseq.StructRefSeq; | ||
| 63 | - import org.rcsb.cif.model.generated.structrefseqdif.StructRefSeqDif; | ||
| 64 | - import org.rcsb.cif.model.generated.structsheetrange.StructSheetRange; | ||
| 65 | - import org.rcsb.cif.model.generated.structsite.StructSite; | ||
| 66 | - import org.rcsb.cif.model.generated.structsitegen.StructSiteGen; | ||
| 67 | - import org.rcsb.cif.model.generated.symmetry.Symmetry; | ||
| 15 | + import org.rcsb.cif.model.*; | ||
| 16 | + import org.rcsb.cif.model.generated.*; | ||
| 68 | 17 | import org.slf4j.Logger; | |
| 69 | 18 | import org.slf4j.LoggerFactory; | |
| 70 | 19 | ||
@@ -145,30 +94,30 @@ public void consumeAtomSite(AtomSite atomSite) { | |||
| 145 | 94 | return; | |
| 146 | 95 | } | |
| 147 | 96 | ||
| 148 | - LabelAsymId labelAsymId = atomSite.getLabelAsymId(); | ||
| 149 | - AuthAsymId authAsymId = atomSite.getAuthAsymId(); | ||
| 97 | + StrColumn labelAsymId = atomSite.getLabelAsymId(); | ||
| 98 | + StrColumn authAsymId = atomSite.getAuthAsymId(); | ||
| 150 | 99 | ||
| 151 | - GroupPDB groupPDB = atomSite.getGroupPDB(); | ||
| 152 | - AuthSeqId authSeqId = atomSite.getAuthSeqId(); | ||
| 100 | + StrColumn groupPDB = atomSite.getGroupPDB(); | ||
| 101 | + IntColumn authSeqId = atomSite.getAuthSeqId(); | ||
| 153 | 102 | ||
| 154 | - LabelCompId labelCompId = atomSite.getLabelCompId(); | ||
| 103 | + StrColumn labelCompId = atomSite.getLabelCompId(); | ||
| 155 | 104 | ||
| 156 | - Id id = atomSite.getId(); | ||
| 157 | - LabelAtomId labelAtomId = atomSite.getLabelAtomId(); | ||
| 105 | + IntColumn id = atomSite.getId(); | ||
| 106 | + StrColumn labelAtomId = atomSite.getLabelAtomId(); | ||
| 158 | 107 | ||
| 159 | - CartnX cartnX = atomSite.getCartnX(); | ||
| 160 | - CartnY cartnY = atomSite.getCartnY(); | ||
| 161 | - CartnZ cartnZ = atomSite.getCartnZ(); | ||
| 108 | + FloatColumn cartnX = atomSite.getCartnX(); | ||
| 109 | + FloatColumn cartnY = atomSite.getCartnY(); | ||
| 110 | + FloatColumn cartnZ = atomSite.getCartnZ(); | ||
| 162 | 111 | ||
| 163 | - Occupancy occupancy = atomSite.getOccupancy(); | ||
| 164 | - BIsoOrEquiv bIsoOrEquiv = atomSite.getBIsoOrEquiv(); | ||
| 112 | + FloatColumn occupancy = atomSite.getOccupancy(); | ||
| 113 | + FloatColumn bIsoOrEquiv = atomSite.getBIsoOrEquiv(); | ||
| 165 | 114 | ||
| 166 | - LabelAltId labelAltId = atomSite.getLabelAltId(); | ||
| 167 | - TypeSymbol typeSymbol = atomSite.getTypeSymbol(); | ||
| 115 | + StrColumn labelAltId = atomSite.getLabelAltId(); | ||
| 116 | + StrColumn typeSymbol = atomSite.getTypeSymbol(); | ||
| 168 | 117 | ||
| 169 | - PdbxPDBInsCode pdbxPDBInsCode = atomSite.getPdbxPDBInsCode(); | ||
| 170 | - LabelSeqId labelSeqId = atomSite.getLabelSeqId(); | ||
| 171 | - PdbxPDBModelNum pdbx_pdb_model_num = atomSite.getPdbxPDBModelNum(); | ||
| 118 | + StrColumn pdbxPDBInsCode = atomSite.getPdbxPDBInsCode(); | ||
| 119 | + IntColumn labelSeqId = atomSite.getLabelSeqId(); | ||
| 120 | + IntColumn pdbx_pdb_model_num = atomSite.getPdbxPDBModelNum(); | ||
| 172 | 121 | ||
| 173 | 122 | for (int atomIndex = 0; atomIndex < atomSite.getRowCount(); atomIndex++) { | |
| 174 | 123 | boolean startOfNewChain = false; | |
@@ -726,6 +675,7 @@ public void consumePdbxAuditRevisionHistory(PdbxAuditRevisionHistory pdbxAuditRe | |||
| 726 | 675 | if (pdbxAuditRevisionHistory.getOrdinal().get(rowIndex) == 1) { | |
| 727 | 676 | String release = pdbxAuditRevisionHistory.getRevisionDate().get(rowIndex); | |
| 728 | 677 | try { | |
| 678 | + // TODO java.lang.NumberFormatException: multiple points - failed for /var/bcif/z4/1z4s.bcif, failed for /var/bcif/he/4hec.bcif | ||
| 729 | 679 | Date releaseDate = DATE_FORMAT.parse(release); | |
| 730 | 680 | pdbHeader.setRelDate(releaseDate); | |
| 731 | 681 | } catch (ParseException e) { | |
@@ -737,6 +687,7 @@ public void consumePdbxAuditRevisionHistory(PdbxAuditRevisionHistory pdbxAuditRe | |||
| 737 | 687 | // the last revision date will "stick" | |
| 738 | 688 | String revision = pdbxAuditRevisionHistory.getRevisionDate().get(rowIndex); | |
| 739 | 689 | try { | |
| 690 | + // TODO java.lang.NumberFormatException: multiple points - failed for /var/bcif/dz/1dzw.bcif, failed for /var/bcif/y2/2y28.bcif | ||
| 740 | 691 | Date revisionDate = DATE_FORMAT.parse(revision); | |
| 741 | 692 | pdbHeader.setModDate(revisionDate); | |
| 742 | 693 | } catch (ParseException e) { | |
@@ -755,11 +706,12 @@ public void consumePdbxChemCompIdentifier(PdbxChemCompIdentifier pdbxChemCompIde | |||
| 755 | 706 | public void consumePdbxDatabaseStatus(PdbxDatabaseStatus pdbxDatabaseStatus) { | |
| 756 | 707 | for (int rowIndex = 0; rowIndex < pdbxDatabaseStatus.getRowCount(); rowIndex++) { | |
| 757 | 708 | // the deposition date field is only available in mmCIF 5.0 | |
| 758 | - RecvdInitialDepositionDate col = pdbxDatabaseStatus.getRecvdInitialDepositionDate(); | ||
| 759 | - if (col.isDefined()) { | ||
| 760 | - String deposition = col.get(rowIndex); | ||
| 709 | + StrColumn recvdInitialDepositionDate = pdbxDatabaseStatus.getRecvdInitialDepositionDate(); | ||
| 710 | + if (recvdInitialDepositionDate.isDefined()) { | ||
| 711 | + String deposition = recvdInitialDepositionDate.get(rowIndex); | ||
| 761 | 712 | ||
| 762 | 713 | try { | |
| 714 | + // TODO failed for /var/bcif/z4/2z4j.bcif java.lang.NumberFormatException: For input string: ".202717E4202717E4" | ||
| 763 | 715 | Date depositionDate = DATE_FORMAT.parse(deposition); | |
| 764 | 716 | pdbHeader.setDepDate(depositionDate); | |
| 765 | 717 | } catch (ParseException e) { | |
@@ -838,7 +790,7 @@ public void consumeRefine(Refine refine) { | |||
| 838 | 790 | } | |
| 839 | 791 | pdbHeader.setResolution((float) lsDResHigh); | |
| 840 | 792 | ||
| 841 | - LsRFactorRFree lsRFactorRFree = refine.getLsRFactorRFree(); | ||
| 793 | + FloatColumn lsRFactorRFree = refine.getLsRFactorRFree(); | ||
| 842 | 794 | // RFREE | |
| 843 | 795 | if (pdbHeader.getRfree() != PDBHeader.DEFAULT_RFREE) { | |
| 844 | 796 | logger.warn("More than 1 Rfree value present, will use last one {} and discard previous {}", | |
@@ -852,7 +804,7 @@ public void consumeRefine(Refine refine) { | |||
| 852 | 804 | } | |
| 853 | 805 | ||
| 854 | 806 | // RWORK | |
| 855 | - LsRFactorRWork lsRFactorRWork = refine.getLsRFactorRWork(); | ||
| 807 | + FloatColumn lsRFactorRWork = refine.getLsRFactorRWork(); | ||
| 856 | 808 | if(pdbHeader.getRwork() != PDBHeader.DEFAULT_RFREE) { | |
| 857 | 809 | logger.warn("More than 1 R work value present, will use last one {} and discard previous {} ", | |
| 858 | 810 | lsRFactorRWork, String.format("%4.2f",pdbHeader.getRwork())); | |
@@ -898,7 +850,7 @@ public void consumeStructConnType(StructConnType structConnType) { | |||
| 898 | 850 | ||
| 899 | 851 | @Override | |
| 900 | 852 | public void consumeStructKeywords(StructKeywords structKeywords) { | |
| 901 | - PdbxKeywords pdbxKeywords = structKeywords.getPdbxKeywords(); | ||
| 853 | + StrColumn pdbxKeywords = structKeywords.getPdbxKeywords(); | ||
| 902 | 854 | // TODO what is the correct format for these? | |
| 903 | 855 | pdbHeader.setDescription(pdbxKeywords.values().collect(Collectors.joining(", "))); | |
| 904 | 856 | pdbHeader.setClassification(pdbxKeywords.values().collect(Collectors.joining(", "))); | |
@@ -978,7 +930,7 @@ public void consumeStructRefSeq(StructRefSeq structRefSeq) { | |||
| 978 | 930 | int dbSeqEnd = structRefSeq.getDbAlignEnd().get(rowIndex); | |
| 979 | 931 | ||
| 980 | 932 | char dbBeginInsCode = ' '; | |
| 981 | - PdbxDbAlignBegInsCode pdbxDbAlignBegInsCodeCol = structRefSeq.getPdbxDbAlignBegInsCode(); | ||
| 933 | + StrColumn pdbxDbAlignBegInsCodeCol = structRefSeq.getPdbxDbAlignBegInsCode(); | ||
| 982 | 934 | if (pdbxDbAlignBegInsCodeCol.isDefined()) { | |
| 983 | 935 | String pdbxDbAlignBegInsCode = pdbxDbAlignBegInsCodeCol.get(rowIndex); | |
| 984 | 936 | if (pdbxDbAlignBegInsCode.length() > 0) { | |
@@ -987,7 +939,7 @@ public void consumeStructRefSeq(StructRefSeq structRefSeq) { | |||
| 987 | 939 | } | |
| 988 | 940 | ||
| 989 | 941 | char dbEndInsCode = ' '; | |
| 990 | - PdbxDbAlignEndInsCode pdbxDbAlignEndInsCodeCol = structRefSeq.getPdbxDbAlignEndInsCode(); | ||
| 942 | + StrColumn pdbxDbAlignEndInsCodeCol = structRefSeq.getPdbxDbAlignEndInsCode(); | ||
| 991 | 943 | if (pdbxDbAlignEndInsCodeCol.isDefined()) { | |
| 992 | 944 | String pdbxDbAlignEndInsCode = pdbxDbAlignEndInsCodeCol.get(rowIndex); | |
| 993 | 945 | if (pdbxDbAlignEndInsCode.length() > 0) { | |
@@ -1157,6 +1109,7 @@ public void finish() { | |||
| 1157 | 1109 | SeqRes2AtomAligner.storeUnAlignedSeqRes(structure, seqResChains, params.isHeaderOnly()); | |
| 1158 | 1110 | } | |
| 1159 | 1111 | ||
| 1112 | + // TODO java.lang.NullPointerException - failed for /var/bcif/hm/2hmz.bcif | ||
| 1160 | 1113 | // Now make sure all altlocgroups have all the atoms in all the groups | |
| 1161 | 1114 | StructureTools.cleanUpAltLocs(structure); | |
| 1162 | 1115 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -276,8 +276,7 @@ public void accept(WrappedAtom wrappedAtom) { | |||
| 276 | 276 | AtomSiteCollector combine(AtomSiteCollector other) { | |
| 277 | 277 | throw new UnsupportedOperationException("impl by calling addAll for all collection - not feeling like writing that code"); | |
| 278 | 278 | } | |
| 279 | - | ||
| 280 | - @SuppressWarnings("Duplicates") | ||
| 279 | + | ||
| 281 | 280 | Category get() { | |
| 282 | 281 | return new CategoryBuilder("atom_site", null) | |
| 283 | 282 | .addColumn(groupPDB.build()) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments