Class AtomContactRDD

  • All Implemented Interfaces:
    java.io.Serializable

    public class AtomContactRDD
    extends java.lang.Object
    implements java.io.Serializable
    Class to hold AtomContact data in an JavaRDD
    Author:
    Anthony Bradley
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      AtomContactRDD​(org.apache.spark.api.java.JavaRDD<org.biojava.nbio.structure.contact.AtomContact> atomContactRdd)
      Construct an AtomContactRDD from a JavaRDD AtomContact.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void cacheData()
      Cache the data - for multi-processing.
      java.lang.Long countInterAtomContacts​(java.lang.String atomNameOne, java.lang.String atomNameTwo)
      Get the number of inter-atom name contacts for a given pair of atoms names.
      java.lang.Long countInterElementContacts​(java.lang.String elementOne, java.lang.String elementTwo)
      Get the number of inter-element contacts for a given pair of element names.
      java.lang.Long countInterGroupContacts​(java.lang.String groupNameOne, java.lang.String groupNameTwo)
      Get the number of inter-group contacts for a given pair of group names.
      AtomContactRDD filterDistance​(double cutoff)
      Filter all contacts greater than a certain distance.
      AtomContactRDD filterElementElementContacts​(java.lang.String elementNameOne, java.lang.String elementNameTwo)
      Filter an AtomContactRDD based on two elements being in contact.
      AtomContactRDD filterElementGroupContacts​(java.lang.String groupName, java.lang.String elementName)
      Filter an AtomContactRDD based on two elements being in contact.
      java.util.Map<java.lang.String,​java.lang.Long> getAllInterAtomElementContacts()
      Get a map counting the number of interactions between atom element names.
      java.util.Map<java.lang.String,​java.lang.Long> getAllInterAtomNameContacts()
      Get a map counting the number of interactions between atom names.
      java.util.Map<java.lang.String,​java.lang.Long> getAllInterGroupContacts()
      Get a map counting the number of interactions between groups.
      org.apache.spark.api.java.JavaRDD<org.biojava.nbio.structure.contact.AtomContact> getAtomContactRDD()
      Get the JavaRDD of AtomContact objects.
      AtomDataRDD getAtoms()
      Get the contacts as an AtomDataRDD
      org.apache.spark.api.java.JavaDoubleRDD getDistanceDistOfAtomInts​(java.lang.String atomName, java.lang.String otherAtomName)
      Get the distance distributions for all of the atom types.
      java.util.List<java.lang.String> getGroupIds()
      Get the associate group ids
      org.apache.spark.api.java.JavaPairRDD<org.biojava.nbio.structure.Atom,​org.biojava.nbio.structure.Atom> getPairs()
      Get the assoicated pairs of atoms found in this
      java.util.List<java.lang.String> getPdbIds()
      Get the associated PDB ids as a list of Strings
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AtomContactRDD

        public AtomContactRDD​(org.apache.spark.api.java.JavaRDD<org.biojava.nbio.structure.contact.AtomContact> atomContactRdd)
        Construct an AtomContactRDD from a JavaRDD AtomContact.
        Parameters:
        atomContactRdd - the input JavaRDD of AtomContact
    • Method Detail

      • cacheData

        public void cacheData()
        Cache the data - for multi-processing.
      • getAtomContactRDD

        public org.apache.spark.api.java.JavaRDD<org.biojava.nbio.structure.contact.AtomContact> getAtomContactRDD()
        Get the JavaRDD of AtomContact objects.
        Returns:
        the JavaRDD of AtomContact objects
      • filterDistance

        public AtomContactRDD filterDistance​(double cutoff)
        Filter all contacts greater than a certain distance.
        Returns:
        the AtomContactRDD after filtering
      • getDistanceDistOfAtomInts

        public org.apache.spark.api.java.JavaDoubleRDD getDistanceDistOfAtomInts​(java.lang.String atomName,
                                                                                 java.lang.String otherAtomName)
        Get the distance distributions for all of the atom types.
        Parameters:
        atomName - the original atom name
        otherAtomName - the other atom name
        Returns:
        the map of atom contact types and the distances
      • getAllInterGroupContacts

        public java.util.Map<java.lang.String,​java.lang.Long> getAllInterGroupContacts()
        Get a map counting the number of interactions between groups. e.g. "LYS_PRO" is the number of lysine-proline interactions.
        Returns:
        a map of strings to counts of interactions
      • countInterGroupContacts

        public java.lang.Long countInterGroupContacts​(java.lang.String groupNameOne,
                                                      java.lang.String groupNameTwo)
        Get the number of inter-group contacts for a given pair of group names.
        Parameters:
        groupNameOne - the name of the first groups
        groupNameTwo - the name of the second group
        Returns:
        the number of contacts between these two groups
      • countInterElementContacts

        public java.lang.Long countInterElementContacts​(java.lang.String elementOne,
                                                        java.lang.String elementTwo)
        Get the number of inter-element contacts for a given pair of element names.
        Parameters:
        elementOne - the name of the first element (e.g. Ca for Calcium)
        elementTwo - the name of the second element (e.g. Ca for Calcium)
        Returns:
        the number of contacts between these two groups
      • countInterAtomContacts

        public java.lang.Long countInterAtomContacts​(java.lang.String atomNameOne,
                                                     java.lang.String atomNameTwo)
        Get the number of inter-atom name contacts for a given pair of atoms names.
        Parameters:
        atomNameOne - the name of the first atom name (e.g. CA for C-alpha)
        atomNameTwo - the name of the second atom name (e.g. CA for C-alpha)
        Returns:
        the number of contacts between these two groups
      • getAllInterAtomNameContacts

        public java.util.Map<java.lang.String,​java.lang.Long> getAllInterAtomNameContacts()
        Get a map counting the number of interactions between atom names. e.g. "CA_CA" is the C-alpha to C-alpha (and Calcium to calcium) interactions.
        Returns:
        a map of strings to counts of interactions
      • getAllInterAtomElementContacts

        public java.util.Map<java.lang.String,​java.lang.Long> getAllInterAtomElementContacts()
        Get a map counting the number of interactions between atom element names. e.g. "C_N" is the C to N interactions.
        Returns:
        a map of strings to counts of interactions
      • filterElementGroupContacts

        public AtomContactRDD filterElementGroupContacts​(java.lang.String groupName,
                                                         java.lang.String elementName)
        Filter an AtomContactRDD based on two elements being in contact.
        Parameters:
        groupName - the group name, e.g. HIS for histidine
        elementName - the element name (IUPAC) e.g. Ca for calcium
        Returns:
        the filtered AtomContactRDD
      • filterElementElementContacts

        public AtomContactRDD filterElementElementContacts​(java.lang.String elementNameOne,
                                                           java.lang.String elementNameTwo)
        Filter an AtomContactRDD based on two elements being in contact.
        Parameters:
        elementNameOne - the second element name (IUPAC) e.g. Ca for calcium
        elementNameOne - the second element name (IUPAC) e.g. Ca for calcium
        Returns:
        the filtered AtomContactRDD
      • getPdbIds

        public java.util.List<java.lang.String> getPdbIds()
        Get the associated PDB ids as a list of Strings
        Returns:
        a list of PDB ids for related entries
      • getGroupIds

        public java.util.List<java.lang.String> getGroupIds()
        Get the associate group ids
        Returns:
        the list of associated group ids
      • getPairs

        public org.apache.spark.api.java.JavaPairRDD<org.biojava.nbio.structure.Atom,​org.biojava.nbio.structure.Atom> getPairs()
        Get the assoicated pairs of atoms found in this
        Returns:
        the pairs of atoms as an RDD