diff --git a/CHANGELOG.md b/CHANGELOG.md index f5d82a24c6..79ea06ec5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,32 @@ +BioJava 5.1.0 +============= +### New feature +* ABI tracer ported from legacy biojava, #769, thanks @MaxGreil + +### Bug fixes +* Performance improvement for secondary structure calculation, #789 +* Fixed issue #731 +* Improved alt locs docs and some fixes, #778 +* Jmol dep updated to 14.29.17 +* Fixed issue #712 +* Fixed issue #791 +* Fixed issue #797 +* Fixed issue #784 + +BioJava 5.0.2 +============= +### Bug fixes +* Fixed issue #770 +* Upgraded to latest mmtf-java 1.0.8 + +BioJava 5.0.1 +============= +### Bug fixes +* Fixed issue #767 +* Fixed issue #761 +* Pom fixes for mvn site +* Some logging fixes + BioJava 5.0.0 ============= diff --git a/biojava-aa-prop/pom.xml b/biojava-aa-prop/pom.xml index fe4b22fc76..157632d1e5 100644 --- a/biojava-aa-prop/pom.xml +++ b/biojava-aa-prop/pom.xml @@ -2,7 +2,7 @@ biojava org.biojava - 5.1.0 + 5.1.1 4.0.0 biojava-aa-prop @@ -70,12 +70,12 @@ org.biojava biojava-core - 5.1.0 + 5.1.1 org.biojava biojava-structure - 5.1.0 + 5.1.1 diff --git a/biojava-alignment/pom.xml b/biojava-alignment/pom.xml index edef4a4126..ac55ba88ee 100644 --- a/biojava-alignment/pom.xml +++ b/biojava-alignment/pom.xml @@ -4,7 +4,7 @@ biojava org.biojava - 5.1.0 + 5.1.1 biojava-alignment biojava-alignment @@ -47,7 +47,7 @@ org.biojava biojava-core - 5.1.0 + 5.1.1 compile diff --git a/biojava-core/pom.xml b/biojava-core/pom.xml index 1af462e7f2..ab8fc3c17f 100644 --- a/biojava-core/pom.xml +++ b/biojava-core/pom.xml @@ -3,7 +3,7 @@ biojava org.biojava - 5.1.0 + 5.1.1 4.0.0 biojava-core diff --git a/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/embl/EmblId.java b/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/embl/EmblId.java index 4c93427767..f89c79762c 100644 --- a/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/embl/EmblId.java +++ b/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/embl/EmblId.java @@ -20,8 +20,6 @@ */ package org.biojava.nbio.core.sequence.io.embl; -import jdk.nashorn.internal.ir.annotations.Immutable; - /** * This class contains the processed data of embl file * Primary accession number @@ -35,7 +33,6 @@ * @author Noor Aldeen Al Mbaidin * @since 5.0.0 */ -@Immutable public class EmblId { diff --git a/biojava-genome/pom.xml b/biojava-genome/pom.xml index 8c290fb3ce..b6b630f93c 100644 --- a/biojava-genome/pom.xml +++ b/biojava-genome/pom.xml @@ -3,7 +3,7 @@ biojava org.biojava - 5.1.0 + 5.1.1 4.0.0 biojava-genome @@ -85,13 +85,13 @@ org.biojava biojava-core - 5.1.0 + 5.1.1 compile org.biojava biojava-alignment - 5.1.0 + 5.1.1 compile diff --git a/biojava-integrationtest/pom.xml b/biojava-integrationtest/pom.xml index cd9ce7282e..699780916d 100644 --- a/biojava-integrationtest/pom.xml +++ b/biojava-integrationtest/pom.xml @@ -4,7 +4,7 @@ biojava org.biojava - 5.1.0 + 5.1.1 biojava-integrationtest jar @@ -28,7 +28,7 @@ org.biojava biojava-structure - 5.1.0 + 5.1.1 diff --git a/biojava-integrationtest/src/test/java/org/biojava/nbio/structure/test/io/TestBioassemblies.java b/biojava-integrationtest/src/test/java/org/biojava/nbio/structure/test/io/TestBioassemblies.java index a18d453d7d..f98dbfb2d3 100644 --- a/biojava-integrationtest/src/test/java/org/biojava/nbio/structure/test/io/TestBioassemblies.java +++ b/biojava-integrationtest/src/test/java/org/biojava/nbio/structure/test/io/TestBioassemblies.java @@ -104,6 +104,41 @@ public void test4TTX() throws IOException, StructureException { assertEquals(2, multiModelBioAssemblies.get(2).getPolyChains().size()); assertEquals(2, flattenedBioAssemblies.get(2).getPolyChains().size()); + // all 3 flattened bioassemblies have operator id 1 in their new chain ids + assertEquals("1", flattenedBioAssemblies.get(0).getPolyChains().get(0).getId().split("_")[1]); + assertEquals("1", flattenedBioAssemblies.get(1).getPolyChains().get(0).getId().split("_")[1]); + assertEquals("1", flattenedBioAssemblies.get(2).getPolyChains().get(0).getId().split("_")[1]); + + StructureIO.setAtomCache(prevAtomCache); + + } + + + /** + * A test for an entry with cartesian product in assembly operators + * @throws StructureException + * @throws IOException + */ + @Test + public void test1M4X() throws IOException, StructureException { + + AtomCache prevAtomCache = StructureIO.getAtomCache(); + AtomCache cache = new AtomCache(); + cache.setUseMmCif(true); + StructureIO.setAtomCache(cache); + + Structure flattenedBioAssembly5 = StructureIO.getBiologicalAssembly("1M4X" , 5); + + // checking that we have 1 model only + assertEquals(1, flattenedBioAssembly5.nrModels()); + + // bioassembly 5 expands to 90 chains (3 chains x 5 operators x 6 operators), the expression is '(1-5)(61-88)' + assertEquals(90, flattenedBioAssembly5.getPolyChains().size()); + + // the operator ids are composed for this case, e.g. A_5x61 + assertTrue(flattenedBioAssembly5.getPolyChains().get(0).getId().contains("x")); + assertEquals(2, flattenedBioAssembly5.getPolyChains().get(0).getId().split("_").length); + StructureIO.setAtomCache(prevAtomCache); } diff --git a/biojava-modfinder/pom.xml b/biojava-modfinder/pom.xml index b726e28519..1697958d07 100644 --- a/biojava-modfinder/pom.xml +++ b/biojava-modfinder/pom.xml @@ -4,7 +4,7 @@ biojava org.biojava - 5.1.0 + 5.1.1 biojava-modfinder biojava-modfinder @@ -31,7 +31,7 @@ org.biojava biojava-structure - 5.1.0 + 5.1.1 jar compile diff --git a/biojava-ontology/pom.xml b/biojava-ontology/pom.xml index 41cfe229df..685477fa67 100644 --- a/biojava-ontology/pom.xml +++ b/biojava-ontology/pom.xml @@ -4,7 +4,7 @@ org.biojava biojava - 5.1.0 + 5.1.1 biojava-ontology diff --git a/biojava-protein-disorder/pom.xml b/biojava-protein-disorder/pom.xml index ca7c3130a5..d63fe7281f 100644 --- a/biojava-protein-disorder/pom.xml +++ b/biojava-protein-disorder/pom.xml @@ -3,7 +3,7 @@ biojava org.biojava - 5.1.0 + 5.1.1 biojava-protein-disorder jar @@ -63,7 +63,7 @@ org.biojava biojava-core - 5.1.0 + 5.1.1 @@ -84,6 +84,10 @@ org.apache.logging.log4j log4j-core + + javax.xml.bind + jaxb-api + diff --git a/biojava-structure-gui/pom.xml b/biojava-structure-gui/pom.xml index 7f0e8d9eac..5045b8b44b 100644 --- a/biojava-structure-gui/pom.xml +++ b/biojava-structure-gui/pom.xml @@ -3,7 +3,7 @@ biojava org.biojava - 5.1.0 + 5.1.1 4.0.0 biojava-structure-gui @@ -27,13 +27,13 @@ org.biojava biojava-structure - 5.1.0 + 5.1.1 compile org.biojava biojava-core - 5.1.0 + 5.1.1 compile diff --git a/biojava-structure/pom.xml b/biojava-structure/pom.xml index 88ee84457e..9f23bf431f 100644 --- a/biojava-structure/pom.xml +++ b/biojava-structure/pom.xml @@ -4,7 +4,7 @@ biojava org.biojava - 5.1.0 + 5.1.1 biojava-structure biojava-structure @@ -40,13 +40,13 @@ org.biojava biojava-alignment - 5.1.0 + 5.1.1 compile org.biojava biojava-core - 5.1.0 + 5.1.1 compile @@ -62,6 +62,25 @@ 1.1.0 + + + javax.xml.bind + jaxb-api + + + com.sun.xml.bind + jaxb-core + + + com.sun.xml.bind + jaxb-impl + + + javax.activation + activation + + diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/asa/AsaCalculator.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/asa/AsaCalculator.java index cc47ff079c..dc34ff8782 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/asa/AsaCalculator.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/asa/AsaCalculator.java @@ -112,7 +112,7 @@ public void run() { * @param nThreads * @param hetAtoms if true HET residues are considered, if false they aren't, equivalent to * NACCESS' -h option - * @see StructureTools.getAllNonHAtomArray + * @see StructureTools#getAllNonHAtomArray */ public AsaCalculator(Structure structure, double probe, int nSpherePoints, int nThreads, boolean hetAtoms) { this.atoms = StructureTools.getAllNonHAtomArray(structure, hetAtoms); @@ -320,19 +320,17 @@ private Point3d[] generateSpherePoints(int nSpherePoints) { * Returns list of indices of atoms within probe distance to atom k. * @param k index of atom for which we want neighbor indices */ - private ArrayList findNeighborIndices(int k) { + private Integer[] findNeighborIndices(int k) { // looking at a typical protein case, number of neighbours are from ~10 to ~50, with an average of ~30 // Thus 40 seems to be a good compromise for the starting capacity - ArrayList neighbor_indices = new ArrayList(40); + ArrayList neighbor_indices = new ArrayList<>(40); double radius = radii[k] + probe + probe; for (int i=0;i findNeighborIndices(int k) { } - return neighbor_indices; + Integer[] indicesArray = new Integer[neighbor_indices.size()]; + indicesArray = neighbor_indices.toArray(indicesArray); + return indicesArray; } private double calcSingleAsa(int i) { Point3d atom_i = atomCoords[i]; - ArrayList neighbor_indices = findNeighborIndices(i); - int n_neighbor = neighbor_indices.size(); + Integer[] neighbor_indices = findNeighborIndices(i); + int n_neighbor = neighbor_indices.length; int j_closest_neighbor = 0; double radius = probe + radii[i]; @@ -370,8 +370,8 @@ private double calcSingleAsa(int i) { } for (int j: cycled_indices) { - Point3d atom_j = atomCoords[neighbor_indices.get(j)]; - double r = radii[neighbor_indices.get(j)] + probe; + Point3d atom_j = atomCoords[neighbor_indices[j]]; + double r = radii[neighbor_indices[j]] + probe; double diff_sq = test_point.distanceSquared(atom_j); if (diff_sq < r*r) { j_closest_neighbor = j; @@ -388,7 +388,7 @@ private double calcSingleAsa(int i) { /** * Gets the radius for given amino acid and atom - * @param aa + * @param amino * @param atom * @return */ diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/cluster/SubunitExtractor.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/cluster/SubunitExtractor.java index e18b0def24..b418884ce0 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/cluster/SubunitExtractor.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/cluster/SubunitExtractor.java @@ -48,8 +48,8 @@ private SubunitExtractor() { /** * Extract the information of each protein Chain in a Structure and converts - * them into a List of Subunit. The name of the Subunits is set to the - * {@link Chain#getName()}. + * them into a List of Subunit. The name of the Subunits is set to + * {@link Chain#getId()}. * * * @param structure @@ -75,7 +75,7 @@ public static List extractSubunits(Structure structure, logger.debug("Chain " + c.getId() + "; CA Atoms: " + ca.length + "; SEQRES: " + c.getSeqResSequence()); if (ca.length==0) continue; - subunits.add(new Subunit(ca, c.getName(), null, structure)); + subunits.add(new Subunit(ca, c.getId(), null, structure)); } } diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/DownloadChemCompProvider.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/DownloadChemCompProvider.java index 06d7534091..d1dcbb08f7 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/DownloadChemCompProvider.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/DownloadChemCompProvider.java @@ -284,8 +284,9 @@ public ChemComp getChemComp(String recordName) { } catch (IOException e) { - logger.error("Could not parse chemical component file {}. Error: {}. " - + "There will be no chemical component info available for {}", filename, e.getMessage(), recordName); + logger.warn( + "Could not download chemical component file {} for {}. Error: {}. Now trying to use the local chemical component definitions.", + filename, recordName, e.getMessage()); } finally{ diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/model/PdbxStructOperList.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/model/PdbxStructOperList.java index 34effb0657..3a0819f4f4 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/model/PdbxStructOperList.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/model/PdbxStructOperList.java @@ -20,15 +20,11 @@ */ package org.biojava.nbio.structure.io.mmcif.model; - -import org.biojava.nbio.structure.jama.Matrix; - import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import java.io.Serializable; -import java.util.Arrays; /** * The bean for pdbx_struct_oper_list category @@ -59,8 +55,7 @@ public class PdbxStructOperList implements Serializable{ @Override public String toString() { - return "PdbxStructOperList [id=" + id + ", type=" + type + ", matrix=" - + matrix + ", vector=" + Arrays.toString(vector) + "]"; + return "PdbxStructOperList [id=" + id + ", type=" + type + "]"; } @@ -104,18 +99,12 @@ public String toString() { // from here fields that are not in the cif category - - @IgnoreField - private Matrix matrix; - @IgnoreField - private double[] vector; public PdbxStructOperList(){ - matrix = Matrix.identity(3,3); - vector = new double[3]; } + @XmlAttribute public String getType() { return type; @@ -125,21 +114,6 @@ public void setType(String type) { this.type = type; } - public Matrix getMatrix() { - return matrix; - } - - public void setMatrix(Matrix matrix) { - this.matrix = matrix; - } - @XmlAttribute - public double[] getVector() { - return vector; - } - - public void setVector(double[] vector) { - this.vector = vector; - } @XmlAttribute public String getId() { return id; @@ -150,32 +124,32 @@ public void setId(String id) { } public void setMatrix11(String val){ - matrix.set(0,0,Double.parseDouble(val)); + this.matrix11 = val; } public void setMatrix21(String val){ - matrix.set(1,0,Double.parseDouble(val)); + this.matrix21 = val; } public void setMatrix31(String val){ - matrix.set(2,0,Double.parseDouble(val)); + this.matrix31 = val; } public void setMatrix12(String val){ - matrix.set(0,1,Double.parseDouble(val)); + this.matrix12 = val; } public void setMatrix22(String val){ - matrix.set(1,1,Double.parseDouble(val)); + this.matrix22 = val; } public void setMatrix32(String val){ - matrix.set(2,1,Double.parseDouble(val)); + this.matrix32 = val; } public void setMatrix13(String val){ - matrix.set(0,2,Double.parseDouble(val)); + this.matrix13 = val; } public void setMatrix23(String val){ - matrix.set(1,2,Double.parseDouble(val)); + this.matrix23 = val; } public void setMatrix33(String val){ - matrix.set(2,2,Double.parseDouble(val)); + this.matrix33 =val; } public void setName(String name) { @@ -186,19 +160,19 @@ public String getVector1() { return vector1; } public void setVector1(String vector1) { - vector[0] = Double.parseDouble(vector1); + this.vector1 = vector1; } public String getVector2() { return vector2; } public void setVector2(String vector2) { - vector[1] = Double.parseDouble(vector2); + this.vector2 = vector2; } public String getVector3() { return vector3; } public void setVector3(String vector3) { - vector[2] = Double.parseDouble(vector3); + this.vector3 = vector3; } public String getName() { return name; @@ -210,39 +184,39 @@ public void setSymmetry_operation(String symmetry_operation) { this.symmetry_operation = symmetry_operation; } @XmlElement - public double getMatrix11(){ - return matrix.get(0,0); + public String getMatrix11(){ + return matrix11; } @XmlElement - public double getMatrix21(){ - return matrix.get(1,0); + public String getMatrix21(){ + return matrix21; } @XmlElement - public double getMatrix31(){ - return matrix.get(2,0); + public String getMatrix31(){ + return matrix31; } @XmlElement - public double getMatrix12(){ - return matrix.get(0,1); + public String getMatrix12(){ + return matrix12; } @XmlElement - public double getMatrix22(){ - return matrix.get(1,1); + public String getMatrix22(){ + return matrix22; } @XmlElement - public double getMatrix32(){ - return matrix.get(2,1); + public String getMatrix32(){ + return matrix32; } @XmlElement - public double getMatrix13(){ - return matrix.get(0,2); + public String getMatrix13(){ + return matrix13; } @XmlElement - public double getMatrix23(){ - return matrix.get(1,2); + public String getMatrix23(){ + return matrix23; } @XmlElement - public double getMatrix33(){ - return matrix.get(2,2); + public String getMatrix33(){ + return matrix33; } } diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmtf/MmtfStructureReader.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmtf/MmtfStructureReader.java index bf3b28d0f0..2e84b42ac2 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmtf/MmtfStructureReader.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmtf/MmtfStructureReader.java @@ -423,7 +423,7 @@ public void setXtalInfo(String spaceGroupString, float[] unitCell, double[][] nc /** * Get the type of group (0,1 or 2) depending on whether it is an amino aicd (1), nucleic acid (2) or ligand (0) - * @param currentGroup + * @param polymerType * @return The type of group. (0,1 or 2) depending on whether it is an amino aicd (1), nucleic acid (2) or ligand (0) */ private int getGroupTypIndicator(PolymerType polymerType) { diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BiologicalAssemblyBuilder.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BiologicalAssemblyBuilder.java index 8c1832cf00..321dd08d28 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BiologicalAssemblyBuilder.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BiologicalAssemblyBuilder.java @@ -30,6 +30,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.vecmath.Matrix4d; import java.util.*; /** @@ -45,9 +46,13 @@ public class BiologicalAssemblyBuilder { private static final Logger logger = LoggerFactory.getLogger(BiologicalAssemblyBuilder.class); private OperatorResolver operatorResolver; - private List psags; - private List modelTransformations; + + /** + * All matrix operators present in _pdbx_struct_oper_list. + * Identifiers (_pdbx_struct_oper_list.id) to matrix operators. + */ + private Map allTransformations; private List modelIndex = new ArrayList(); @@ -216,34 +221,55 @@ private void addChainFlattened(Structure s, Chain newChain, String transformId) * Returns a list of transformation matrices for the generation of a macromolecular * assembly for the specified assembly Id. * - * @param assemblyId Id of the macromolecular assembly to be generated + * @param psa + * @param psags + * @param operators * @return list of transformation matrices to generate macromolecular assembly */ public ArrayList getBioUnitTransformationList(PdbxStructAssembly psa, List psags, List operators) { - //System.out.println("Rebuilding " + psa.getDetails() + " | " + psa.getOligomeric_details() + " | " + psa.getOligomeric_count()); - //System.out.println(psag); init(); - this.psags = psags; - - //psa.getId(); + // first we populate the list of all operators from pdbx_struct_oper_list so that we can then + // get them from getBioUnitTransformationsListUnaryOperators() and getBioUnitTransformationsListBinaryOperators() for (PdbxStructOperList oper: operators){ - BiologicalAssemblyTransformation transform = new BiologicalAssemblyTransformation(); - transform.setId(oper.getId()); - transform.setRotationMatrix(oper.getMatrix().getArray()); - transform.setTranslation(oper.getVector()); -// transform.setTransformationMatrix(oper.getMatrix(), oper.getVector()); - modelTransformations.add(transform); + try { + Matrix4d m = new Matrix4d(); + m.m00 = Double.parseDouble(oper.getMatrix11()); + m.m01 = Double.parseDouble(oper.getMatrix12()); + m.m02 = Double.parseDouble(oper.getMatrix13()); + + m.m10 = Double.parseDouble(oper.getMatrix21()); + m.m11 = Double.parseDouble(oper.getMatrix22()); + m.m12 = Double.parseDouble(oper.getMatrix23()); + + m.m20 = Double.parseDouble(oper.getMatrix31()); + m.m21 = Double.parseDouble(oper.getMatrix32()); + m.m22 = Double.parseDouble(oper.getMatrix33()); + + m.m03 = Double.parseDouble(oper.getVector1()); + m.m13 = Double.parseDouble(oper.getVector2()); + m.m23 = Double.parseDouble(oper.getVector3()); + + m.m30 = 0; + m.m31 = 0; + m.m32 = 0; + m.m33 = 1; + + allTransformations.put(oper.getId(), m); + + } catch (NumberFormatException e) { + logger.warn("Could not parse a matrix value from pdbx_struct_oper_list for id {}. The operator id will be ignored. Error: {}", oper.getId(), e.getMessage()); + } } - ArrayList transformations = getBioUnitTransformationsListUnaryOperators(psa.getId()); - transformations.addAll(getBioUnitTransformationsListBinaryOperators(psa.getId())); + ArrayList transformations = getBioUnitTransformationsListUnaryOperators(psa.getId(), psags); + transformations.addAll(getBioUnitTransformationsListBinaryOperators(psa.getId(), psags)); transformations.trimToSize(); return transformations; } - private ArrayList getBioUnitTransformationsListBinaryOperators(String assemblyId) { + private ArrayList getBioUnitTransformationsListBinaryOperators(String assemblyId, List psags) { ArrayList transformations = new ArrayList(); @@ -261,17 +287,20 @@ private ArrayList getBioUnitTransformationsLis // Example 1M4X: generates all products of transformation matrices (1-60)(61-88) for (String chainId : asymIds) { - int modelNumber = 1; for (OrderedPair operator : operators) { - BiologicalAssemblyTransformation original1 = getModelTransformationMatrix(operator.getElement1()); - BiologicalAssemblyTransformation original2 = getModelTransformationMatrix(operator.getElement2()); - // ModelTransformationMatrix transform = ModelTransformationMatrix.multiply4square_x_4square2(original1, original2); - BiologicalAssemblyTransformation transform = BiologicalAssemblyTransformation.combine(original1, original2); + Matrix4d original1 = allTransformations.get(operator.getElement1()); + Matrix4d original2 = allTransformations.get(operator.getElement2()); + if (original1 == null || original2 == null) { + logger.warn("Could not find matrix operator for operator id {} or {}. Assembly id {} will not contain the composed operator.", operator.getElement1(), operator.getElement2(), assemblyId); + continue; + } + Matrix4d composed = new Matrix4d(original1); + composed.mul(original2); + BiologicalAssemblyTransformation transform = new BiologicalAssemblyTransformation(); transform.setChainId(chainId); - // transform.setId(original1.getId() + "x" + original2.getId()); - transform.setId(String.valueOf(modelNumber)); + transform.setId(operator.getElement1() + "x" + operator.getElement2()); + transform.setTransformationMatrix(composed); transformations.add(transform); - modelNumber++; } } } @@ -281,17 +310,7 @@ private ArrayList getBioUnitTransformationsLis return transformations; } - private BiologicalAssemblyTransformation getModelTransformationMatrix(String operator) { - for (BiologicalAssemblyTransformation transform: modelTransformations) { - if (transform.getId().equals(operator)) { - return transform; - } - } - logger.error("Could not find modelTransformationmatrix for " + operator); - return new BiologicalAssemblyTransformation(); - } - - private ArrayList getBioUnitTransformationsListUnaryOperators(String assemblyId) { + private ArrayList getBioUnitTransformationsListUnaryOperators(String assemblyId, List psags) { ArrayList transformations = new ArrayList(); @@ -306,11 +325,15 @@ private ArrayList getBioUnitTransformationsLis // apply unary operators to the specified chains for (String chainId : asymIds) { for (String operator : operators) { - - BiologicalAssemblyTransformation original = getModelTransformationMatrix(operator); - BiologicalAssemblyTransformation transform = new BiologicalAssemblyTransformation(original); + Matrix4d original = allTransformations.get(operator); + if (original == null) { + logger.warn("Could not find matrix operator for operator id {}. Assembly id {} will not contain the operator.", operator, assemblyId); + continue; + } + BiologicalAssemblyTransformation transform = new BiologicalAssemblyTransformation(); transform.setChainId(chainId); transform.setId(operator); + transform.setTransformationMatrix(original); transformations.add(transform); } } @@ -322,6 +345,6 @@ private ArrayList getBioUnitTransformationsLis private void init(){ operatorResolver= new OperatorResolver(); - modelTransformations = new ArrayList(1); + allTransformations = new HashMap<>(); } } diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/OperatorResolver.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/OperatorResolver.java index 08ad5224b2..b9b11a2f61 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/OperatorResolver.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/OperatorResolver.java @@ -24,7 +24,8 @@ import java.util.List; -/** A class to resolve the operators for transformations +/** + * A class to resolve the operators for transformations * * @author Peter Rose * diff --git a/biojava-survival/pom.xml b/biojava-survival/pom.xml index a90e42d981..ce0c57f6d0 100644 --- a/biojava-survival/pom.xml +++ b/biojava-survival/pom.xml @@ -4,7 +4,7 @@ org.biojava biojava - 5.1.0 + 5.1.1 biojava-survival diff --git a/biojava-ws/pom.xml b/biojava-ws/pom.xml index e7282143aa..c57afd2cd7 100644 --- a/biojava-ws/pom.xml +++ b/biojava-ws/pom.xml @@ -3,7 +3,7 @@ biojava org.biojava - 5.1.0 + 5.1.1 biojava-ws biojava-ws @@ -19,7 +19,7 @@ org.biojava biojava-core - 5.1.0 + 5.1.1 compile diff --git a/pom.xml b/pom.xml index a71b8756e6..ee32f576f7 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.biojava biojava pom - 5.1.0 + 5.1.1 biojava BioJava is an open-source project dedicated to providing a Java framework for processing biological data. It provides analytical and statistical routines, parsers for common file formats and allows the @@ -32,6 +32,7 @@ + 1.8 1.8 UTF-8 @@ -48,7 +49,7 @@ scm:git:git@github.com:biojava/biojava.git https://github.com/biojava/biojava - biojava-5.1.0 + biojava-5.1.1 - 3.0.2 + 3.1.0 maven-scm-plugin - 1.9.5 + 1.10.0 maven-source-plugin @@ -191,7 +188,7 @@ maven-failsafe-plugin - 2.21.0 + 2.22.0 net.sf @@ -201,7 +198,7 @@ org.jvnet.jaxb2.maven2 maven-jaxb2-plugin - 0.13.1 + 0.14.0 org.apache.maven.plugins @@ -224,7 +221,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.0.0 + 3.0.1 -Xdoclint:none @@ -242,7 +239,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.1.0 + 3.1.1 maven-assembly-plugin @@ -280,18 +277,18 @@ org.apache.maven.plugins maven-checkstyle-plugin - 2.17 + 3.0.0 org.apache.maven.plugins maven-resources-plugin - 3.0.2 + 3.1.0 maven-enforcer-plugin - 3.0.0-M1 + 3.0.0-M2 enforce-java @@ -316,12 +313,12 @@ org.apache.maven.plugins maven-surefire-plugin - 2.21.0 + 2.22.0 org.apache.maven.plugins maven-site-plugin - 3.7 + 3.7.1 @@ -507,6 +504,26 @@ forester 1.038 + + javax.xml.bind + jaxb-api + 2.3.0 + + + com.sun.xml.bind + jaxb-core + 2.3.0 + + + com.sun.xml.bind + jaxb-impl + 2.3.0 + + + javax.activation + activation + 1.1.1 + @@ -518,7 +535,7 @@ true true true - 1.8 + ${jdk.version} false true diff --git a/readme.md b/readme.md index efb31d8f41..e7689982f5 100644 --- a/readme.md +++ b/readme.md @@ -1,11 +1,11 @@ # Welcome to -[![Build Status](https://travis-ci.org/biojava/biojava.svg?branch=master)](https://travis-ci.org/biojava/biojava) [![Version](http://img.shields.io/badge/version-5.0.2-blue.svg?style=flat)](https://github.com/biojava/biojava/releases/tag/biojava-5.0.2) [![License](http://img.shields.io/badge/license-LGPL_2.1-blue.svg?style=flat)](https://github.com/biojava/biojava/blob/master/LICENSE) [![Join the chat at https://gitter.im/biojava/biojava](https://badges.gitter.im/biojava/biojava.svg)](https://gitter.im/biojava/biojava?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![Build Status](https://travis-ci.org/biojava/biojava.svg?branch=master)](https://travis-ci.org/biojava/biojava) [![Version](http://img.shields.io/badge/version-5.1.0-blue.svg?style=flat)](https://github.com/biojava/biojava/releases/tag/biojava-5.1.0) [![License](http://img.shields.io/badge/license-LGPL_2.1-blue.svg?style=flat)](https://github.com/biojava/biojava/blob/master/LICENSE) [![Join the chat at https://gitter.im/biojava/biojava](https://badges.gitter.im/biojava/biojava.svg)](https://gitter.im/biojava/biojava?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) BioJava is an open-source project dedicated to providing a Java framework for **processing biological data**. It provides analytical and statistical routines, parsers for common file formats, reference implementations of popular algorithms, and allows the manipulation of sequences and 3D structures. The goal of the biojava project is to facilitate rapid application development for bioinformatics. -Please visit our [homepage](http://www.biojava.org/). +Please visit our [homepage](http://biojava.org/). ### Documentation @@ -28,7 +28,7 @@ If you are using Maven you can add the BioJava repository by adding the followin org.biojava biojava-core - 5.0.2 + 5.1.0