Class MolInputBuilder


  • @Beta
    @PublicAPI
    public class MolInputBuilder
    extends Object
    Convenience class to compose input from molecules to a clustering algorithm.

    Please note that this class is marked with @Beta annotation, so it can be subject of incompatible changes or removal in later releases.

    • Constructor Detail

      • MolInputBuilder

        public MolInputBuilder()
        Construct an empty builder.
      • MolInputBuilder

        public MolInputBuilder​(Collection<? extends Molecule> mols)
        Construct a builder with stored structures.
        Parameters:
        mols - Structures to store
    • Method Detail

      • addMolecule

        public int addMolecule​(Molecule m)
        Add a new structure.
        Parameters:
        m - Structure to be added
        Returns:
        ID of the structure
      • addMolecules

        public int addMolecules​(Collection<? extends Molecule> mols)
        Add multiple structures.
        Parameters:
        mols - Structures to be added
        Returns:
        ID of the first structure to be added
      • addMolecules

        public int addMolecules​(Iterator<? extends Molecule> mols)
        Add multiple structures.
        Parameters:
        mols - Structures to be added
        Returns:
        ID of the first structure to be added
      • addMolecules

        public int addMolecules​(Iterator<? extends Molecule> mols,
                                StandardizerWrapper standardize)
        Add multiple structures with preprocessing.
        Parameters:
        mols - Structures to be added
        standardize - Standardization to apply on the strucutres. Will be invoked on the iterated structures without cloning..
        Returns:
        ID of the first structure to be added
      • build

        public <D extends DescriptorMolInput build​(DescriptorGenerator<D> gen,
                                                     DescriptorComparator<D> comp)
        Build immutable input descriptor.
        Type Parameters:
        D - Used descriptor
        Parameters:
        gen - Generator to use
        comp - Comparator to use
        Returns:
        Immutable input descriptor
      • size

        public int size()
        Added structure count.
        Returns:
        Number of structures already added.