Constructors

  • Parameters

    • OCL: __module

      openchemlib library

    • Optional options: {
          computeProperties: undefined | boolean;
      } = {}
      • computeProperties: undefined | boolean

    Returns MoleculesDB

Properties

OCL: __module
computeProperties: boolean
db: {}

Type declaration

    searcher: SSSearcherWithIndex
    statistics: any

    Methods

    • append to the current database a CSV file

      Parameters

      • csv: string | ArrayBuffer

        text file containing the comma separated value file

      • Optional options: {
            dynamicTyping: undefined | boolean;
            header: undefined | boolean;
            onStep: undefined | Function;
            skipEmptyLines: undefined | boolean;
        }
        • dynamicTyping: undefined | boolean
        • header: undefined | boolean
        • onStep: undefined | Function

          call back to execute after each molecule

        • skipEmptyLines: undefined | boolean

      Returns Promise<void>

    • 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 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[]
      • Optional options: {
            coordinatesPath: undefined | string;
            idCodePath: undefined | string;
            indexPath: undefined | string;
            molfilePath: undefined | string;
            mwPath: undefined | string;
            onStep: undefined | Function;
            smilesPath: undefined | string;
        }
        • coordinatesPath: undefined | string
        • idCodePath: undefined | string
        • indexPath: undefined | string
        • molfilePath: undefined | string
        • mwPath: undefined | string
        • onStep: undefined | Function

          call back to execute after each molecule

        • smilesPath: undefined | string

      Returns Promise<void>

    • Append a SDF to the current database

      Parameters

      • sdf: string | ArrayBuffer

        text file containing the sdf

      • Optional options: {
            onStep: undefined | Function;
        }
        • onStep: undefined | Function

          call back to execute after each molecule

      Returns DB

    • Append a SDF to the current database

      Parameters

      • text: any
      • Optional options: {
            onStep: undefined | Function;
        }
        • onStep: undefined | Function

          call back to execute after each molecule

      Returns DB

    • Add a molecule to the current database

      Parameters

      • molecule: Molecule
      • Optional data: object
      • Optional moleculeInfo: 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

      • Optional data: object

      Returns void

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

      Parameters

      • Optional query: any

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

      • Optional options: {
            flattenResult: undefined | boolean;
            format: undefined | "smiles" | "molfile" | "smarts" | "idCode";
            keepMolecule: undefined | boolean;
            limit: undefined | number;
            mode: undefined | string;
        }
        • flattenResult: undefined | boolean

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

        • format: undefined | "smiles" | "molfile" | "smarts" | "idCode"

          query format

        • keepMolecule: undefined | boolean

          keep the OCL.Molecule object in the result

        • limit: undefined | number

          maximal number of result

        • mode: undefined | 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

      • Optional query: any

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

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

          callback to execute to check if the search should be aborted

        • flattenResult: undefined | boolean

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

        • format: undefined | "smiles" | "molfile" | "smarts" | "idCode"

          query format

        • interval: undefined | number

          interval in ms to call the onStep callback

        • keepMolecule: undefined | boolean

          keep the OCL.Molecule object in the result

        • limit: undefined | number

          maximal number of result

        • mode: undefined | string

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

        • onStep: undefined | Function

          callback to execute after each interval

      Returns Promise<any[]>

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