Class MmtfUtils


  • public class MmtfUtils
    extends Object
    A utils class of functions needed for Biojava to read and write to mmtf.
    Author:
    Anthony Bradley
    • Method Detail

      • setUpBioJava

        public static AtomCache setUpBioJava​(String extraUrl)
        Set up the configuration parameters for BioJava.
        Parameters:
        extraUrl - the string describing the URL (or file path) from which to get missing CCD entries.
      • 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 structure
        chainIdToIndexMap - 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<AtomgetAtomsForGroup​(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 calculated
        the - 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.
      • 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 - the Matrix4d 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 to
        group - the group to add
        sequenceIndexId - the index to add it in
      • addSeqRes

        public static void addSeqRes​(Chain modelChain,
                                     String sequence)
        Add the missing groups to the SeqResGroups.
        Parameters:
        modelChain - the chain to add the information for
        sequence - the sequence of the construct