Class BiologicalAssemblyTransformation
- java.lang.Object
-
- org.biojava.nbio.structure.quaternary.BiologicalAssemblyTransformation
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Comparable<BiologicalAssemblyTransformation>
public class BiologicalAssemblyTransformation extends java.lang.Object implements java.lang.Cloneable, java.lang.Comparable<BiologicalAssemblyTransformation>, java.io.Serializable
The transformation needed for generation of biological assemblies from the contents of a PDB/mmCIF file. It contains both the actual transformation (rotation+translation) and the chain identifier to which it should be applied.- Author:
- Peter Rose, Andreas Prlic, rickb, Jose Duarte
- See Also:
CrystalTransform, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BiologicalAssemblyTransformation()Default ConstructorBiologicalAssemblyTransformation(BiologicalAssemblyTransformation src)Copy Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BiologicalAssemblyTransformationcombine(BiologicalAssemblyTransformation matrix1, BiologicalAssemblyTransformation matrix2)Returns the combination (product) of two biological assembly transformations.intcompareTo(BiologicalAssemblyTransformation other)static java.util.List<BiologicalAssemblyTransformation>fromMultiXML(java.lang.String xml)static BiologicalAssemblyTransformationfromXML(java.lang.String xml)java.lang.StringgetChainId()Returns the chain identifier (asym id) that this transformation should be applied to.java.lang.StringgetId()Returns the identifier for this biological assembly transformation.javax.vecmath.Matrix4dgetTransformationMatrix()Return the transformation (both rotational and translational component) as a 4x4 transformation matrix.booleanisIdentity()Tells whether this transformation is in identity.static java.lang.StringrotMatrixToString(javax.vecmath.Matrix4d m)voidsetChainId(java.lang.String chainId)Sets the chain identifier (asym id) that this transformation should be applied to.voidsetId(java.lang.String id)Sets the identifier for this biological assembly transformation.voidsetRotationMatrix(double[][] m)voidsetTransformationMatrix(javax.vecmath.Matrix4d transformation)Sets the transformation using a 4x4 transformation matrixvoidsetTranslation(double[] t)java.lang.StringtoString()java.lang.StringtoXML()voidtoXML(PrettyXMLWriter xml)voidtransformPoint(double[] point)Applies the transformation to given point.static java.lang.StringtranslVecToString(javax.vecmath.Matrix4d m)
-
-
-
Constructor Detail
-
BiologicalAssemblyTransformation
public BiologicalAssemblyTransformation()
Default Constructor
-
BiologicalAssemblyTransformation
public BiologicalAssemblyTransformation(BiologicalAssemblyTransformation src)
Copy Constructor- Parameters:
src-
-
-
Method Detail
-
setId
public void setId(java.lang.String id)
Sets the identifier for this biological assembly transformation. This is usually the model number used in the biological assembly files.- Parameters:
id-
-
getId
public java.lang.String getId()
Returns the identifier for this biological assembly transformation.- Returns:
- biological assembly transformation identifier
-
setChainId
public void setChainId(java.lang.String chainId)
Sets the chain identifier (asym id) that this transformation should be applied to.- Parameters:
chainId-
-
getChainId
public java.lang.String getChainId()
Returns the chain identifier (asym id) that this transformation should be applied to.- Returns:
- chain identifier
-
setTransformationMatrix
public void setTransformationMatrix(javax.vecmath.Matrix4d transformation)
Sets the transformation using a 4x4 transformation matrix- Parameters:
transformation-
-
getTransformationMatrix
public javax.vecmath.Matrix4d getTransformationMatrix()
Return the transformation (both rotational and translational component) as a 4x4 transformation matrix. The transformation is in orthonormal (cartesian coordinates). If required to be converted to crystal coordinates then useCrystalCell.transfToCrystal(Matrix4d)Note that this is a reference to the variable, thus it remains linked to this object's transformation field. The user must deep copy it if need changing it.- Returns:
- 4x4 transformation matrix
-
setRotationMatrix
public void setRotationMatrix(double[][] m)
-
setTranslation
public void setTranslation(double[] t)
-
transformPoint
public void transformPoint(double[] point)
Applies the transformation to given point.
-
combine
public static BiologicalAssemblyTransformation combine(BiologicalAssemblyTransformation matrix1, BiologicalAssemblyTransformation matrix2)
Returns the combination (product) of two biological assembly transformations.- Parameters:
matrix1-matrix2-- Returns:
- combined transformation
-
isIdentity
public boolean isIdentity()
Tells whether this transformation is in identity.- Returns:
-
toXML
public java.lang.String toXML() throws java.io.IOException- Throws:
java.io.IOException
-
toXML
public void toXML(PrettyXMLWriter xml) throws java.io.IOException
- Throws:
java.io.IOException
-
fromXML
public static BiologicalAssemblyTransformation fromXML(java.lang.String xml) throws org.xml.sax.SAXException, java.io.IOException, javax.xml.parsers.ParserConfigurationException
- Throws:
org.xml.sax.SAXExceptionjava.io.IOExceptionjavax.xml.parsers.ParserConfigurationException
-
fromMultiXML
public static java.util.List<BiologicalAssemblyTransformation> fromMultiXML(java.lang.String xml) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException
- Throws:
javax.xml.parsers.ParserConfigurationExceptionorg.xml.sax.SAXExceptionjava.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
rotMatrixToString
public static java.lang.String rotMatrixToString(javax.vecmath.Matrix4d m)
-
translVecToString
public static java.lang.String translVecToString(javax.vecmath.Matrix4d m)
-
compareTo
public int compareTo(BiologicalAssemblyTransformation other)
- Specified by:
compareToin interfacejava.lang.Comparable<BiologicalAssemblyTransformation>
-
-