Package org.openscience.cdk.graph
Class SpanningTree
java.lang.Object
org.openscience.cdk.graph.SpanningTree
Spanning tree of a molecule.
Used to discover the number of cyclic bonds in order to prevent the
inefficient AllRingsFinder to run for too long.
- Author:
- Nina Jeliazkova
- Dictionary pointer(s):
- graphSpanningTree in the Blue Obelisk Chemoinformatics Dictionary [blue-obelisk:graphSpanningTree]
- Source code:
- main
- Belongs to CDK module:
- core
- Keywords:
- spanning tree, ring finding
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSpanningTree
(IAtomContainer atomContainer) Create a new spanning tree for the provided molecule. -
Method Summary
Modifier and TypeMethodDescriptionAll basic rings and the all pairs of basic rings share at least one edge combined.The basic rings of the spanning tree.int
Number of acyclic bonds.int
Number of cyclic bonds.Returns an IAtomContainer which contains all the atoms and bonds which are involved in ring systems.getPath
(IAtomContainer spt, IAtom atom1, IAtom atom2) Find a path connected a1 and a2 in the tree.Access the computed spanning tree of the input molecule.int
Size of the spanning tree specified as the number of edges in the tree.boolean
Is the molecule disconnected and has more then one component.
-
Field Details
-
bondsInTree
protected boolean[] bondsInTree
-
-
Constructor Details
-
SpanningTree
Create a new spanning tree for the provided molecule.- Parameters:
atomContainer
- molecule to make a spanning tree for.
-
-
Method Details
-
isDisconnected
public boolean isDisconnected()Is the molecule disconnected and has more then one component.- Returns:
- the molecule is disconnected
-
getSpanningTree
Access the computed spanning tree of the input molecule.- Returns:
- acyclic tree of the input molecule
-
getPath
public IAtomContainer getPath(IAtomContainer spt, IAtom atom1, IAtom atom2) throws NoSuchAtomException Find a path connected a1 and a2 in the tree. If there was an edge between a1 and a2 this path is a cycle.- Parameters:
spt
- spanning treeatom1
- start of path (source)atom2
- end of path (target)- Returns:
- a path through the spanning tree from the source to the target
- Throws:
NoSuchAtomException
- thrown if the atom is not in the spanning tree
-
getBasicRings
The basic rings of the spanning tree. Using the pruned edges, return any path which connects the end points of the pruned edge in the tree. These paths form cycles.- Returns:
- basic rings
- Throws:
NoSuchAtomException
- atoms not found in the molecule
-
getCyclicFragmentsContainer
Returns an IAtomContainer which contains all the atoms and bonds which are involved in ring systems.- Returns:
- the IAtomContainer as described above
- See Also:
-
getAllRings
All basic rings and the all pairs of basic rings share at least one edge combined.- Returns:
- subset of all rings
- Throws:
NoSuchAtomException
- atom was not found in the molecule- See Also:
-
getSpanningTreeSize
public int getSpanningTreeSize()Size of the spanning tree specified as the number of edges in the tree.- Returns:
- number of edges in the spanning tree
-
getBondsAcyclicCount
public int getBondsAcyclicCount()Number of acyclic bonds.- Returns:
- Returns the bondsAcyclicCount.
-
getBondsCyclicCount
public int getBondsCyclicCount()Number of cyclic bonds.- Returns:
- Returns the bondsCyclicCount.
-