Constructors

  • Parameters

    • OCL: __module

      openchemlib library

    • Optionaloptions: { computeProperties?: boolean; keepEmptyMolecules?: boolean } = {}

      Options.

    Returns MoleculesDB

Properties

computeProperties: boolean
db: {}
keepEmptyMolecules: boolean
OCL: __module
searcher: SSSearcherWithIndex
statistics: any

Methods

  • Append the property data.color to each entry based on a data or property label {object} [options={}] {string} [options.dataLabel] name of the property from data to use {string} [options.propertyLabel] name of the property from properties to use {number} [options.colorLabel='color'] name of the property to add in data that will contain the color {number} [options.minValue] {number} [options.maxValue] {number} [options.minHue=0] {number} [options.maxHue=360] {number} [options.saturation=65] percent of color saturation {number} [options.lightness=65] percent of color lightness

    Parameters

    • options: any

    Returns void

  • append to the current database a CSV file

    Parameters

    • csv: string | ArrayBuffer

      text file containing the comma separated value file

    • Optionaloptions: {
          dynamicTyping?: boolean;
          header?: boolean;
          onStep?: Function;
          skipEmptyLines?: boolean;
      }
      • OptionaldynamicTyping?: boolean
      • Optionalheader?: boolean
      • OptionalonStep?: Function

        call back to execute after each molecule

      • OptionalskipEmptyLines?: boolean

    Returns Promise<void>

  • Append an array of entries to the current database. An entry is an object that by default should contain a 'ocl' property containing idCode and optionally index and coordinates

    Parameters

    • entries: object[]
    • Optionaloptions: {
          coordinatesPath?: string;
          idCodePath?: string;
          indexPath?: string;
          molfilePath?: string;
          mwPath?: string;
          onStep?: Function;
          smilesPath?: string;
      }
      • OptionalcoordinatesPath?: string
      • OptionalidCodePath?: string
      • OptionalindexPath?: string
      • OptionalmolfilePath?: string
      • OptionalmwPath?: string
      • OptionalonStep?: Function

        call back to execute after each molecule

      • OptionalsmilesPath?: string

    Returns Promise<void>

  • Append a SDF to the current database

    Parameters

    • sdf: string | ArrayBuffer

      text file containing the sdf

    • Optionaloptions: { onStep?: Function }

      Options.

      • OptionalonStep?: Function

        call back to execute after each molecule

    Returns Promise<void>

  • Append a list of SMILES to the current database.

    Parameters

    • smiles: string | ArrayBuffer

      text file containing a list of smiles

    • Optionaloptions: { onStep?: Function }

      Options

      • OptionalonStep?: Function

        call back to execute after each molecule

    Returns Promise<void>

  • Add a molecule to the current database.

    Parameters

    • molecule: Molecule

      The molecule to append.

    • Optionaldata: object

      Options.

    • OptionalmoleculeInfo: object

      May contain precalculated index and mw.

    Returns void

  • Add an entry in the database.

    Parameters

    • moleculeInfo: object

      a molecule as a JSON that may contain the following properties: molfile, smiles, idCode, mf, index

    • Optionaldata: object

    Returns void

  • Search in a MoleculesDB Inside the database all the same molecules are group together

    Parameters

    • Optionalquery: string | Molecule

      smiles, molfile, idlCode or instance of Molecule to look for

    • Optionaloptions: {
          flattenResult?: boolean;
          format?: "smiles" | "molfile" | "smarts" | "idCode";
          keepMolecule?: boolean;
          limit?: number;
          mode?: string;
      }

      Options

      • OptionalflattenResult?: boolean

        The database group the data for the same product. This allows to flatten the result

      • Optionalformat?: "smiles" | "molfile" | "smarts" | "idCode"

        query format

      • OptionalkeepMolecule?: boolean

        keep the OCL.Molecule object in the result

      • Optionallimit?: number

        maximal number of result

      • Optionalmode?: string

        search by 'substructure', 'exact' or 'similarity'

    Returns any[]

    array of object of the type {(molecule), idCode, data, properties}

  • Search in a MoleculesDB Inside the database all the same molecules are group together

    Parameters

    • Optionalquery: string | Molecule

      smiles, molfile, idCode or instance of Molecule to look for

    • Optionaloptions: {
          controler?: AbortController;
          flattenResult?: boolean;
          format?: "smiles" | "molfile" | "smarts" | "idCode";
          interval?: number;
          keepMolecule?: boolean;
          limit?: number;
          mode?: string;
          onStep?: Function;
      }

      Options.

      • Optionalcontroler?: AbortController

        callback to execute to check if the search should be aborted

      • OptionalflattenResult?: boolean

        The database group the data for the same product. This allows to flatten the result

      • Optionalformat?: "smiles" | "molfile" | "smarts" | "idCode"

        query format

      • Optionalinterval?: number

        interval in ms to call the onStep callback

      • OptionalkeepMolecule?: boolean

        keep the OCL.Molecule object in the result

      • Optionallimit?: number

        maximal number of result

      • Optionalmode?: string

        search by 'substructure', 'exact' or 'similarity'

      • OptionalonStep?: Function

        callback to execute after each interval

    Returns Promise<any[]>

    array of object of the type {(molecule), idCode, data, properties}