Class ConnectivityChecker


  • public class ConnectivityChecker
    extends Object
    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 Detail

      • ConnectivityChecker

        public ConnectivityChecker()
    • Method Detail

      • partitionIntoMolecules

        public static IAtomContainerSet partitionIntoMolecules​(IAtomContainer container,
                                                               int[] components)
        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 container
        components - the components
        Returns:
        the partitioned set