public class SaccharideGraph extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
SaccharideGraph.AbstractBuilder<G extends SaccharideGraph>
A builder to build Glycan.
|
static class |
SaccharideGraph.Traversal |
| Modifier and Type | Field and Description |
|---|---|
protected List<SEdge> |
edges |
protected org.expasy.mzjava.glycomics.mol.IdentityEdgeMultimap<Monosaccharide,Monosaccharide,org.expasy.mzjava.glycomics.mol.GlycosidicEdge> |
monosaccharideEdgeMultimap |
protected List<GlycanNode> |
nodes |
protected gnu.trove.map.TObjectIntMap<GlycanNode> |
postOrder |
protected gnu.trove.map.TObjectIntMap<GlycanNode> |
preOrder |
protected Monosaccharide |
root |
protected org.expasy.mzjava.glycomics.mol.IdentityEdgeMultimap<Monosaccharide,Substituent,org.expasy.mzjava.glycomics.mol.SubstituentEdge> |
substituentEdgeMultimap |
| Modifier | Constructor and Description |
|---|---|
protected |
SaccharideGraph(Monosaccharide root) |
| Modifier and Type | Method and Description |
|---|---|
protected int |
add(Monosaccharide child,
List<Monosaccharide> parents,
GlycosidicLinkage linkage) |
protected int |
add(Monosaccharide child,
Monosaccharide parent,
GlycosidicLinkage linkage) |
protected int |
add(Substituent child,
List<Monosaccharide> parents,
SubstituentLinkage linkage) |
protected int |
add(Substituent child,
Monosaccharide parent,
SubstituentLinkage linkage) |
protected double |
calculateTotalSaccharideMass()
Returns the total mass of the Saccharide Graph.
|
boolean |
canFragmentCrossRing(Monosaccharide monosaccharide)
Return a boolean value that show if the glycan is fragmentable.
|
protected boolean |
containsNode(GlycanNode node)
This method check if a glycan contains a specific node.
|
List<SEdge> |
copyEdgeList()
Returns a new list of all the edges.
|
protected void |
doBFS(LinkageAcceptor linkageAcceptor,
Deque<Monosaccharide> deque,
Comparator<org.expasy.mzjava.glycomics.mol.GlycosidicEdge> traversalComparator) |
protected void |
doDFS(LinkageAcceptor linkageAcceptor,
Deque<Monosaccharide> deque,
Comparator<org.expasy.mzjava.glycomics.mol.GlycosidicEdge> traversalComparator) |
boolean |
equals(Object o) |
void |
forEachLinkage(SaccharideGraph.Traversal traversal,
LinkageAcceptor linkageAcceptor)
Traverses the saccharide graph starting at the root.
|
void |
forEachLinkage(SaccharideGraph.Traversal traversal,
TraversalComparator traversalComparator,
LinkageAcceptor linkageAcceptor)
Traverses the saccharide graph starting at the root.
|
NodeSet<GlycanNode> |
getChildren(Monosaccharide parent)
Returns a the children of parent
|
com.google.common.base.Optional<GlycosidicLinkage> |
getGlycoLinkage(GlycanNode parentNode,
GlycanNode childNode)
Return the linkage between
parentNode and childNode |
NodeSet<Monosaccharide> |
getMonosaccharideChildren(Monosaccharide parent)
Returns all children of parent that are Monosaccharides
|
GlycanNode |
getNode(int nodeId)
Returns the
nodeId'th node that was added to this SaccharideGraph. |
<A extends GlycanNode> |
getParent(A child)
Calculate the parent of a node.
|
Monosaccharide |
getRoot()
Return the root of this SaccharideGraph
|
NodeSet<Substituent> |
getSubstituentChildren(Monosaccharide parent)
Returns all children of parent that are Substituents
|
com.google.common.base.Optional<SubstituentLinkage> |
getSubstituentLinkage(GlycanNode parentNode,
GlycanNode childNode)
Return the linkage between
parentNode and childNode |
int |
hashCode() |
boolean |
hasHyperEdges()
Returns
true if the glycan has hyperedges. |
boolean |
isEmpty()
Check if there is no nodes in the glycan.
|
boolean |
isLeaf(Monosaccharide monosaccharide)
Returns
true if the specified monosaccharide is a leaf in the saccharide. |
int |
order()
Return the number of monosaccharides and substituents in this glycan
|
protected void |
populatePrePostOrder(GlycanNode node,
Counter counter)
Populate the pre and post order table
|
int |
size()
Return the size of the glycan as the number of monosaccharide.
|
protected final Monosaccharide root
protected final List<GlycanNode> nodes
protected final org.expasy.mzjava.glycomics.mol.IdentityEdgeMultimap<Monosaccharide,Monosaccharide,org.expasy.mzjava.glycomics.mol.GlycosidicEdge> monosaccharideEdgeMultimap
protected final org.expasy.mzjava.glycomics.mol.IdentityEdgeMultimap<Monosaccharide,Substituent,org.expasy.mzjava.glycomics.mol.SubstituentEdge> substituentEdgeMultimap
protected final gnu.trove.map.TObjectIntMap<GlycanNode> preOrder
protected final gnu.trove.map.TObjectIntMap<GlycanNode> postOrder
protected SaccharideGraph(Monosaccharide root)
protected int add(Monosaccharide child, List<Monosaccharide> parents, GlycosidicLinkage linkage)
protected int add(Monosaccharide child, Monosaccharide parent, GlycosidicLinkage linkage)
protected int add(Substituent child, List<Monosaccharide> parents, SubstituentLinkage linkage)
protected int add(Substituent child, Monosaccharide parent, SubstituentLinkage linkage)
public GlycanNode getNode(int nodeId)
nodeId'th node that was added to this SaccharideGraph.nodeId - the node idnodeId'th node that was added to this SaccharideGraph.public Monosaccharide getRoot()
public com.google.common.base.Optional<GlycosidicLinkage> getGlycoLinkage(GlycanNode parentNode, GlycanNode childNode)
parentNode and childNodeparentNode - the parent nodechildNode - the childNodeparentNode and childNode,
or an empty Optional if no linkage exists.public com.google.common.base.Optional<SubstituentLinkage> getSubstituentLinkage(GlycanNode parentNode, GlycanNode childNode)
parentNode and childNodeparentNode - the parent nodechildNode - the childNodeparentNode and childNode,
or an empty Optional if no linkage exists.public NodeSet<GlycanNode> getChildren(Monosaccharide parent)
parent - the parent nodepublic NodeSet<Monosaccharide> getMonosaccharideChildren(Monosaccharide parent)
parent - the parent nodepublic NodeSet<Substituent> getSubstituentChildren(Monosaccharide parent)
parent - the parent nodepublic int order()
public List<SEdge> copyEdgeList()
public boolean hasHyperEdges()
true if the glycan has hyperedges.true if the glycan has hyperedges;
false otherwisepublic boolean isLeaf(Monosaccharide monosaccharide)
true if the specified monosaccharide is a leaf in the saccharide.true if the specified monosaccharide is a leaf in the saccharide;
false otherwisepublic <A extends GlycanNode> GlycanNode getParent(A child)
child - a child in the graph.protected double calculateTotalSaccharideMass()
protected boolean containsNode(GlycanNode node)
node - a monosaccharidetrue if the monosaccharide is in the list of nodes.
false otherwisepublic boolean canFragmentCrossRing(Monosaccharide monosaccharide)
public boolean isEmpty()
public int size()
protected void populatePrePostOrder(GlycanNode node, Counter counter)
node - node of the saccharide graph.counter - node counter.public void forEachLinkage(SaccharideGraph.Traversal traversal, LinkageAcceptor linkageAcceptor)
traversal.traversal - determines weather the traversal is depth or breadth firstlinkageAcceptor - callback that gets called for every edge that is traversedpublic void forEachLinkage(SaccharideGraph.Traversal traversal, TraversalComparator traversalComparator, LinkageAcceptor linkageAcceptor)
traversal. The order in which the children are traversed can be controlled using
the traversalComparator.traversal - determines weather the traversal is depth or breadth firsttraversalComparator - allows control of the order in which a nodes children are traversedlinkageAcceptor - callback that gets called for every edge that is traversedprotected void doDFS(LinkageAcceptor linkageAcceptor, Deque<Monosaccharide> deque, Comparator<org.expasy.mzjava.glycomics.mol.GlycosidicEdge> traversalComparator)
protected void doBFS(LinkageAcceptor linkageAcceptor, Deque<Monosaccharide> deque, Comparator<org.expasy.mzjava.glycomics.mol.GlycosidicEdge> traversalComparator)
Copyright © 2016. All Rights Reserved.