Class MmtfUtils
- java.lang.Object
-
- org.biojava.nbio.structure.io.mmtf.MmtfUtils
-
-
Constructor Summary
Constructors Constructor Description MmtfUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addSeqRes(Chain modelChain, String sequence)
Add the missing groups to the SeqResGroups.static void
calculateDsspSecondaryStructure(Structure bioJavaStruct)
Generate the secondary structure for a Biojava structure object.static double[]
convertToDoubleArray(javax.vecmath.Matrix4d transformationMatrix)
Convert a four-d matrix to a double array.static String
dateToIsoString(Date inputDate)
Covert a Date object to ISO time format.static void
fixMicroheterogenity(Structure bioJavaStruct)
This sets all microheterogeneous groups (previously alternate location groups) as separate groups.static List<Atom>
getAtomsForGroup(Group inputGroup)
Get a list of atoms for a group.static double[][]
getNcsAsArray(javax.vecmath.Matrix4d[] ncsOperators)
Get a list of length N*16 of a list of Matrix4d*N.static javax.vecmath.Matrix4d[]
getNcsAsMatrix4d(double[][] ncsOperMatrixList)
Get a list of N 4*4 matrices from a single list of doubles of length 16*N.static int
getNumBondsInGroup(List<Atom> atomsInGroup)
Find the number of bonds in a groupstatic int
getNumGroups(Structure structure)
Count the total number of groups in the structurestatic int
getSecStructType(Group group)
Get the secondary structure as defined by DSSP.static SecStrucType
getSecStructTypeFromDsspIndex(int dsspIndex)
Set the DSSP type based on a numerical index.static String
getSpaceGroupAsString(SpaceGroup spaceGroup)
Get the string representation of a space group.static MmtfSummaryDataBean
getStructureInfo(Structure structure)
Get summary information for the structure.static Map<double[],int[]>
getTransformMap(BioAssemblyInfo bioassemblyInfo, Map<String,Integer> chainIdToIndexMap)
Convert a bioassembly information into a map of transform, chainindices it relates to.static float[]
getUnitCellAsArray(PDBCrystallographicInfo xtalInfo)
Get the length six array of the unit cell information.static void
insertSeqResGroup(Chain chain, Group group, int sequenceIndexId)
Insert the group in the given position in the sequence.static void
setSecStructType(Group group, int dsspIndex)
Get the secondary structure as defined by DSSP.static String[]
techniquesToStringArray(Set<ExperimentalTechnique> experimentalTechniques)
Converts the set of experimental techniques to an array of strings.
-
-
-
Constructor Detail
-
MmtfUtils
public MmtfUtils()
-
-
Method Detail
-
fixMicroheterogenity
public static void fixMicroheterogenity(Structure bioJavaStruct)
This sets all microheterogeneous groups (previously alternate location groups) as separate groups. This is required because mmtf groups cannot have multiple HET codes.- Parameters:
bioJavaStruct
-
-
calculateDsspSecondaryStructure
public static void calculateDsspSecondaryStructure(Structure bioJavaStruct)
Generate the secondary structure for a Biojava structure object.- Parameters:
bioJavaStruct
- the Biojava structure for which it is to be calculate.
-
getSpaceGroupAsString
public static String getSpaceGroupAsString(SpaceGroup spaceGroup)
Get the string representation of a space group.- Parameters:
spaceGroup
- the input SpaceGroup object- Returns:
- the space group as a string.
-
getUnitCellAsArray
public static float[] getUnitCellAsArray(PDBCrystallographicInfo xtalInfo)
Get the length six array of the unit cell information.- Parameters:
xtalInfo
- the input PDBCrystallographicInfo object- Returns:
- the length six float array
-
techniquesToStringArray
public static String[] techniquesToStringArray(Set<ExperimentalTechnique> experimentalTechniques)
Converts the set of experimental techniques to an array of strings.- Parameters:
experimentalTechniques
- the input set of experimental techniques- Returns:
- the array of strings describing the methods used.
-
dateToIsoString
public static String dateToIsoString(Date inputDate)
Covert a Date object to ISO time format.- Parameters:
inputDate
- The input date object- Returns:
- the time in ISO time format
-
getTransformMap
public static Map<double[],int[]> getTransformMap(BioAssemblyInfo bioassemblyInfo, Map<String,Integer> chainIdToIndexMap)
Convert a bioassembly information into a map of transform, chainindices it relates to.- Parameters:
bioassemblyInfo
- the bioassembly info object for this structurechainIdToIndexMap
- the map of chain ids to the index that chain corresponds to.- Returns:
- the bioassembly information (as primitive types).
-
convertToDoubleArray
public static double[] convertToDoubleArray(javax.vecmath.Matrix4d transformationMatrix)
Convert a four-d matrix to a double array. Row-packed.- Parameters:
transformationMatrix
- the input matrix4d object- Returns:
- the double array (16 long).
-
getNumGroups
public static int getNumGroups(Structure structure)
Count the total number of groups in the structure- Parameters:
structure
- the input structure- Returns:
- the total number of groups
-
getAtomsForGroup
public static List<Atom> getAtomsForGroup(Group inputGroup)
Get a list of atoms for a group. Only add each atom once.- Parameters:
inputGroup
- the Biojava Group to consider- Returns:
- the atoms for the input Biojava Group
-
getNumBondsInGroup
public static int getNumBondsInGroup(List<Atom> atomsInGroup)
Find the number of bonds in a group- Parameters:
atomsInGroup
- the list of atoms in the group- Returns:
- the number of atoms in the group
-
getSecStructType
public static int getSecStructType(Group group)
Get the secondary structure as defined by DSSP.- Parameters:
group
- the input group to be calculated- Returns:
- the integer index of the group type.
-
setSecStructType
public static void setSecStructType(Group group, int dsspIndex)
Get the secondary structure as defined by DSSP.- Parameters:
group
- the input group to be calculateddsspIndex
- integer index of the group type.
-
getSecStructTypeFromDsspIndex
public static SecStrucType getSecStructTypeFromDsspIndex(int dsspIndex)
Set the DSSP type based on a numerical index.- Parameters:
dsspIndex
- the integer index of the type to set- Returns:
- the instance of the SecStrucType object holding this secondary structure type.
-
getStructureInfo
public static MmtfSummaryDataBean getStructureInfo(Structure structure)
Get summary information for the structure.- Parameters:
structure
- the structure for which to get the information.
-
getNcsAsMatrix4d
public static javax.vecmath.Matrix4d[] getNcsAsMatrix4d(double[][] ncsOperMatrixList)
Get a list of N 4*4 matrices from a single list of doubles of length 16*N.- Parameters:
ncsOperMatrixList
- the input list of doubles- Returns:
- the list of 4*4 matrics
-
getNcsAsArray
public static double[][] getNcsAsArray(javax.vecmath.Matrix4d[] ncsOperators)
Get a list of length N*16 of a list of Matrix4d*N.- Parameters:
ncsOperators
- theMatrix4d
list- Returns:
- the list of length N*16 of the list of matrices
-
insertSeqResGroup
public static void insertSeqResGroup(Chain chain, Group group, int sequenceIndexId)
Insert the group in the given position in the sequence.- Parameters:
chain
- the chain to add the seq res group togroup
- the group to addsequenceIndexId
- the index to add it in
-
-