constructor

constructor(options: any)
Parameters
options (any = {})

activeOrNaturalDetails

Search for a specific natural or active compound using its ID

activeOrNaturalDetails(id: any, options: object)
Parameters
id (any)
options (object = {})
Name Description
options.fields string (default '_id,data') List of fields to retrieve
options.route string (default 'activesOrNaturals/v1/id') URL of the webservice
options.baseURL string (default 'https://octochemdb.cheminfo.org/') URL of the webservice

includeDBRefs

Load the DBrefs and create a new property data for each DBRef

includeDBRefs(object: any, options: object)
Parameters
object (any)
options (object = {})
Name Description
options.collections Array<string>? List of collections to include
options.excludedCollections Array<string>? List of collections to include
options.force boolean (default false) Force the inclusion of the data even if it is already present
options.baseURL string (default 'https://octochemdb.cheminfo.org/') URL of the webservice

normalizeActivities

This function normalizes the activities of an entry of ActivesOrNaturals collection.

normalizeActivities(activeOrNatural: Object): any
Parameters
activeOrNatural (Object) an entry of ActivesOrNaturals collection
Returns
any: ActiveOrNatural entry with normalized activities

activesOrNaturals

Search for natural or active compounds using various criteria

activesOrNaturals(options: object)
Parameters
options (object = {})
Name Description
options.masses (number | string | Array<number>)? Observed monoisotopic mass
options.noStereoTautomerID string (default '') ID of the compound to search from the results
options.ionizations string (default '') string containing a comma separated list of modifications
options.ranges string (default '') Allows to filter by a range of molecular formula
options.mf string (default '') Search by molecular formula
options.precision number (default 1000) Precision of the monoisotopic mass in ppm
options.fields string? List of fields to retrieve
options.kwTaxonomies string (default '') Comma separated list of taxonomies family, genus or species of the product source
options.kwActiveAgainst string (default '') Comma separated list of taxonomies family, genus or species of the bioactivity target
options.kwBioassays string (default '') Comma separated list of keyword from the description of the bioassay
options.kwMeshTerms string (default '') Comma separated list of keyword from the medline MeshTerms
options.kwTitles string (default '') Comma separated list of keyword from the compound title
options.minNbMassSpectra string? Minimal number of mass spectra
options.limit number (default 1000) Maximal number of entries to return
options.route string (default 'activesOrNaturals/v1/search') Route to this specific webservice
options.includes (Array<string> | undefined)? Array of DBref collections to include
options.baseURL string (default 'https://octochemdb.cheminfo.org/') Base URL of the webservice

activesOrNaturalsByMF

Search for natural or active compounds and group them by molecular formula

activesOrNaturalsByMF(options: object)
Parameters
options (object = {})
Name Description
options.masses (number | string | Array<number>)? Observed monoisotopic mass
options.ionizations string (default '') string containing a comma separated list of modifications
options.ranges string (default '') Allows to filter by a range of molecular formula
options.precision number (default 1000) Precision (accuracy) of the monoisotopic mass in ppm
options.fields string (default 'data.noStereoOcl,data.em,data.mf') List of fields to retrieve
options.kwTaxonomies string (default '') Comma separated list of taxonomies family, genus or species of the product source
options.kwActiveAgainst string (default '') Comma separated list of taxonomies family, genus or species of the bioactivity target
options.kwBioassays string (default '') Comma separated list of keyword from the description of the bioassay
options.kwMeshTerms string (default '') Comma separated list of keyword from the medline MeshTerms
options.kwTitles string (default '') Comma separated list of keyword from compound title
options.limit number (default 1000) Maximal number of entries to return
options.route string (default 'activesOrNaturals/v1/search') URL of the webservice
options.baseURL string (default 'https://octochemdb.cheminfo.org/') URL of the webservice

compoundsFromMF

Retrieve a list of molecular formulas from one or many monoisotopic mass that are present in pubchem compound. in the database and a monoisotopic mass.

compoundsFromMF(mf: string, options: object)
Parameters
mf (string) Observed monoisotopic mass
options (object = {})
Name Description
options.fields string? Fields to retrieve from the database
options.baseURL string (default 'https://octochemdb.cheminfo.org/') URL of the webservice
options.route string (default 'mfs/v1/fromMF') URL of the webservice
options.titleCompoundsURL string (default 'titleCompounds/v1/ids') URL of the webservice
options.limit number (default 50000) Maximal number of entries to return

MSComparator

This method will retrieve similar mass spectra

MSComparator
Parameters
options (object = {})
Name Description
options.baseURL string (default 'https://octochemdb.cheminfo.org/') URL of the webservice
options.masses (number | string | Array<number>)? Observed monoisotopic mass
options.precision number (default 1000) Precision (accuracy) of the monoisotopic mass in ppm
options.limit number (default 1000) Maximal number of entries to return
options.modifications string (default '') Comma
options.databases Array<("massBank" | "gnps" | "inSilicoFragments")> (default ['massBank','gnps']) List of databases to search for mass spectra
options.routes object? Object that contains the routes to use for each database
options.uniqueMolecules boolean (default true) If true, only one molecule per entry is returned
options.similarity object (default {})
options.similarity.nbPeaks number (default 5) Number of peaks to use for the similarity
options.similarity.massPower number (default 1) Power to use for the mass
options.similarity.minSimilarity number (default 0.2) Minimal similarity to return
options.similarity.intensityPower number (default 0.6) Power to use for the intensity
options.similarity.minNbCommonPeaks number (default 0) Minimal number of common peaks
options.similarity.experimental {x: Array<number>, y: Array<number>} (default []) Experimental mass spectra to compare to

mfsFromEMs

Retrieve a list of molecular formulas from one or many monoisotopic mass that are present in pubchem compound. in the database and a monoisotopic mass.

mfsFromEMs(masses: (number | string | Array<number>), options: object)
Parameters
masses ((number | string | Array<number>)) Observed monoisotopic mass
options (object = {})
Name Description
options.ionizations string (default '') string containing a comma separated list of modifications
options.precision number (default 1000) Precision (accuracy) of the monoisotopic mass in ppm
options.ranges string (default '') Range of allowed molecular formula
options.limit number (default 1000) Maximal number of entries to return
options.minCount number (default 5) Minimal number of molecules having a specific MF
options.fields number? Fields to retrieve from the database
options.baseURL string (default 'https://octochemdb.cheminfo.org/') URL of the webservice
options.route string (default 'mfs/v1/fromEM') URL of the webservice
options.compoundsURL string (default 'mfs/v1/fromMF') URL to retrieve corresponding compounds

pubmedCompounds

Retrieve the compounds from a pubmedID

pubmedCompounds(pubmedID: string, options: object)
Parameters
pubmedID (string)
options (object = {})
Name Description
options.route string (default 'pubmeds/v1/id') relative URL of the webservice
options.baseURL string (default 'https://octochemdb.cheminfo.org/') URL of the webservice
options.limit number (default 1000) Maximal number of entries to return

searchInSilicoSpectraByMF

searchInSilicoSpectraByMF(spectrum: object, mf: string, options: object)
Parameters
spectrum (object) The experimental spectrum to compare to
mf (string) Molecular formula of the non ionized molecule
options (object = {})
Name Description
options.baseURL string (default 'https://octochemdb.cheminfo.org/') URL of the webservice
options.mf string? Molecular formula of the non ionized molecule (not available for inSilicoFragments)
options.precision number (default 100) Precision (accuracy) of the monoisotopic mass in ppm
options.limit number (default 1000) Maximal number of entries to return
options.massPower number (default 1000) Maximal number of entries to return
options.massPower number (default 3) High power will give more weight to the mass. If you would prefer to observe fragments you should use a number less than 1
options.intensityPower number (default 0.6) How important is the intensity. By default we don't give to much importance to it
options.route string (default 'inSilicoFragments/v1/search') Route to use

searchInSilicoSpectraByMasses

searchInSilicoSpectraByMasses(spectrum: object, masses: (number | string | Array<number>)?, options: object)
Parameters
spectrum (object) The experimental spectrum to compare to
masses ((number | string | Array<number>)?) List of experimental monoisotopic mass
options (object = {})
Name Description
options.baseURL string (default 'https://octochemdb.cheminfo.org/') URL of the webservice
options.mf string? Molecular formula of the non ionized molecule (not available for inSilicoFragments)
options.precision number (default 100) Precision (accuracy) of the monoisotopic mass in ppm
options.ionizations string (default "H+") Comma separated list of allowed ionizations
options.limit number (default 1000) Maximal number of entries to return
options.massPower number (default 1000) Maximal number of entries to return
options.massPower number (default 3) High power will give more weight to the mass. If you would prefer to observe fragments you should use a number less than 1
options.intensityPower number (default 0.6) How important is the intensity. By default we don't give to much importance to it
options.route string (default 'inSilicoFragments/v1/search') Route to use
options.technique object (default {}) Technique used to generate the spectrum
options.technique.mode string (default "positive") Mode of the acquisition
options.technique.ionization string (default "esi") Ionization of the acquisition

searchMasses

searchMasses(options: object)
Parameters
options (object = {})
Name Description
options.baseURL string (default 'https://octochemdb.cheminfo.org/') URL of the webservice
options.masses (number | string | Array<number>)? Observed fragment masses
options.mf string? Molecular formula of the non ionized molecule (not available for inSilicoFragments)
options.precision number (default 100) Precision (accuracy) of the monoisotopic mass in ppm
options.limit number (default 1000) Maximal number of entries to return
options.modifications string (default '') Comma separated list of allowed modifications
options.route string (default 'massBank/v1/search') Route to use
options.link string (default 'https://massbank.eu/MassBank/RecordDisplay?id=') Link to the database source

constructor

Summarize the active or natural details with the given terms

constructor(activeOrNaturalDetails: Object, options: Object)
Parameters
activeOrNaturalDetails (Object) The active or natural details to summarize
options (Object = {}) The options to use for the search
Name Description
options.activities Object (default {}) The options to use for the activities search
options.activities.minScore number (default 0.5) Minimum score for an entry to be returned
options.activities.maxNbEntries number (default 100) Maximum number of entries to return
options.activities.relevance object (default {k:1.2,b:0.75,d:0.5}) BM25 algorithm {k: Term frequency saturation parameter, b: Length normalization parameter, d:Frequency normalization lower bound}
options.activities.tolerance number (default 1) -Typo Tolerance following the Levenshtein algorithm
options.activities.queryFields Array<string> (default ['assay']) Fields to query
options.taxonomies Object (default {}) The options to use for the activities search
options.taxonomies.minScore number (default 0.5) Minimum score for an entry to be returned
options.taxonomies.maxNbEntries number (default 50) Maximum number of entries to return
options.taxonomies.tolerance number (default 1) -Typo Tolerance following the Levenshtein algorithm
options.patents object (default {}) Options for patents
options.patents.abstractsLimit number (default 1000) If more than this number of abstracts, the search will be done on the without abstracts
options.patents.maxNbEntries number (default 100) Maximum number of entries to return
options.patents.inScore number (default 0.5) Minimum score for an entry to be returned
options.patents.relevance object (default {k:1.2,b:0.75,d:0.5}) BM25 algorithm {k: Term frequency saturation parameter, b: Length normalization parameter, d:Frequency normalization lower bound}
options.patents.tolerance number (default 1) -Typo Tolerance following the Levenshtein algorithm
options.patents.queryFields Array<string> (default ['title','abstract']) Fields to query
options.patents.boostFields object (default {title:2,abstract:1}) Fields weights, higher weight means higher importance
options.pubmeds object (default {}) Options for pubmeds
options.pubmeds.abstractsLimit number (default 1000) If more than this number of abstracts, the search will be done on the without abstracts
options.pubmeds.minScore number (default 0.5) Minimum score for an entry to be returned
options.pubmeds.maxNbEntries number (default 100) Maximum number of entries to return
options.pubmeds.relevance object (default {k:1.2,b:0.75,d:0.5}) BM25 algorithm {k: Term frequency saturation parameter, b: Length normalization parameter, d:Frequency normalization lower bound}
options.pubmeds.tolerance number (default 1) -Typo Tolerance following the Levenshtein algorithm
options.pubmeds.boostFields object (default {title:2,abstract:1,meshHeadings:1}) Fields weights, higher weight means higher importance
options.pubmeds.queryFields Array<string> (default ['title','abstract','meshHeadings']) Fields to query

summarize

Summarize the active or natural details with the given terms

summarize(terms: string): Promise<Object>
Parameters
terms (string) The terms to search
Returns
Promise<Object>: The summarized active or natural details

taxonomyComparator

sort taxonomies by superkingdom, kingdom, phylum, class, order, family, genus, species

taxonomyComparator(a: any, b: any): number
Parameters
a (any)
b (any)
Returns
number:

createTaxonomyTree

Creates a tree structure from an array of taxonomies.

createTaxonomyTree(taxonomies: any, options: any): Array<Object>
Parameters
taxonomies (any)
options (any = {})
Returns
Array<Object>: The tree structure.