Package org.openscience.cdk.graph
Class ConnectivityChecker
java.lang.Object
org.openscience.cdk.graph.ConnectivityChecker
Tool class for checking whether the (sub)structure in an
AtomContainer is connected.
To check whether an AtomContainer is connected this code
can be used:
boolean isConnected = ConnectivityChecker.isConnected(atomContainer);
A disconnected AtomContainer can be fragmented into connected fragments by using code like:
MoleculeSet fragments = ConnectivityChecker.partitionIntoMolecules(disconnectedContainer); int fragmentCount = fragments.getAtomContainerCount();
- Source code:
- main
- Belongs to CDK module:
- standard
- Keywords:
- connectivity
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isConnected
(IAtomContainer atomContainer) Check whether a set of atoms in anIAtomContainer
is connected.static IAtomContainerSet
partitionIntoMolecules
(IAtomContainer container) Partitions the atoms in an AtomContainer into covalently connected components.static IAtomContainerSet
partitionIntoMolecules
(IAtomContainer container, int[] components) Split a molecule based on the provided component array.
-
Constructor Details
-
ConnectivityChecker
public ConnectivityChecker()
-
-
Method Details
-
isConnected
Check whether a set of atoms in anIAtomContainer
is connected.- Parameters:
atomContainer
- TheIAtomContainer
to be check for connectedness- Returns:
- true if the
IAtomContainer
is connected
-
partitionIntoMolecules
Partitions the atoms in an AtomContainer into covalently connected components.- Parameters:
container
- The AtomContainer to be partitioned into connected components, i.e. molecules- Returns:
- A MoleculeSet.
- Dictionary pointer(s):
- graphPartitioning in the Blue Obelisk Chemoinformatics Dictionary [blue-obelisk:graphPartitioning]
-
partitionIntoMolecules
Split a molecule based on the provided component array. Note this function can also be used to split a single molecule, breaking bonds and distributing stereochemistry as needed.- Parameters:
container
- the containercomponents
- the components- Returns:
- the partitioned set
-