Package org.biojava.spark.data
Class AtomContactRDD
- java.lang.Object
-
- org.biojava.spark.data.AtomContactRDD
-
- All Implemented Interfaces:
java.io.Serializable
public class AtomContactRDD extends java.lang.Object implements java.io.SerializableClass to holdAtomContactdata in anJavaRDD- 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)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcacheData()Cache the data - for multi-processing.java.lang.LongcountInterAtomContacts(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.LongcountInterElementContacts(java.lang.String elementOne, java.lang.String elementTwo)Get the number of inter-element contacts for a given pair of element names.java.lang.LongcountInterGroupContacts(java.lang.String groupNameOne, java.lang.String groupNameTwo)Get the number of inter-group contacts for a given pair of group names.AtomContactRDDfilterDistance(double cutoff)Filter all contacts greater than a certain distance.AtomContactRDDfilterElementElementContacts(java.lang.String elementNameOne, java.lang.String elementNameTwo)Filter anAtomContactRDDbased on two elements being in contact.AtomContactRDDfilterElementGroupContacts(java.lang.String groupName, java.lang.String elementName)Filter anAtomContactRDDbased 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 theJavaRDDofAtomContactobjects.AtomDataRDDgetAtoms()Get the contacts as anAtomDataRDDorg.apache.spark.api.java.JavaDoubleRDDgetDistanceDistOfAtomInts(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 idsorg.apache.spark.api.java.JavaPairRDD<org.biojava.nbio.structure.Atom,org.biojava.nbio.structure.Atom>getPairs()Get the assoicated pairs of atoms found in thisjava.util.List<java.lang.String>getPdbIds()Get the associated PDB ids as a list of Strings
-
-
-
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 theJavaRDDofAtomContactobjects.- Returns:
- the
JavaRDDofAtomContactobjects
-
filterDistance
public AtomContactRDD filterDistance(double cutoff)
Filter all contacts greater than a certain distance.- Returns:
- the
AtomContactRDDafter 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 nameotherAtomName- 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 groupsgroupNameTwo- 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 anAtomContactRDDbased on two elements being in contact.- Parameters:
groupName- the group name, e.g. HIS for histidineelementName- 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 anAtomContactRDDbased on two elements being in contact.- Parameters:
elementNameOne- the second element name (IUPAC) e.g. Ca for calciumelementNameOne- 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
-
getAtoms
public AtomDataRDD getAtoms()
Get the contacts as anAtomDataRDD- Returns:
- an
AtomDataRDDof all the atoms found in these contacts
-
-