createSTDdbLC {metaMS} | R Documentation

## Create an in-house database for LC-MS annotation

### Description

For creating an in-house instrument-specific annotation database, injections of pure standards need to be processed. For each standard the analyst provides a validated reference value for retention time and m/z, generally corresponding to the major ionic signal for this compound. On the bases of this data, the database is constructed by automatically extracting the features identified in the vicinity of the retention time of the standard.
The function `generateSTDdbLC` is not meant to be called directly - use `createSTDdbLC` instead.

### Usage

    createSTDdbLC(stdInfo, settings, polarity, Ithr = 10, nSlaves = 0)
    generateStdDBLC(stdxsets, settings, Ithr)

### Arguments

`stdInfo` | Information of the standards, given in the form of a data.frame. Minimal information: `stdFile`, `compound`, `ChemSpiderID`, observed m/z (`mz.observed`), and retention time in miutes (`RTman`). The filenames in slot `stdFile` should include path information.
`settings` | A list of settings, to be used in peak picking and pattern comparison (see details).
`polarity` | The polarity of the injection: "positive" or "negative"
`Ithr` | The intensity threshold used to decide weather or not a feature should be included in the DB. Typically acting on the `maxo` value.
`stdxsets` | A list of CAMERA objects resulting from the analysis (performed by `processStandards`) of the standard injections listed in the `stdInfo` table.
`nSlaves` | Number of cores to be used in peak picking.

### Details

The DB is created with the following workflow. Peak picking is performed on each standard file by using the settings specified in the settings list. CAMERA is used to group together the different features by considering their retention time and the correlation among the extracted ion traces. The list of features is searched looking for the values for mz and Rt included in the `stdInfo` table (see the help of `exptable` for more details), with the mass and retention time tolerances specified in the "DBconstruction" element of the settings list. In presence of positive match for the feature `f`, a spectral fingerprint is constructed by using all the features with an intensity bigger than `Ithr` which are in the same pcgroup of `f`. A match is retained only if the spectral fingerprint is composed of more than `minfeat` elements. This parameter is also included in the list of settings.

### Value

A list with three elements.

`Reftable` | the original table used for the creation of the DB.
`Info` | a list with the settings used for the DB generation and the date.
`DB` | the DB which can be used in `runLC` for annotation.

### Author(s)

Pietro Franceschi

### Examples

    if (require(metaMSdata)) {
      ##  load the manually curated table for the standards
      data(exptable)
      ## add location of cdf file from which the standards DB is going to be
      ## built - this depends on your platform and requires the metaMSdata package
      cdfpath <- system.file("extdata", package = "metaMSdata")

      ## files
      files <- list.files(cdfpath, "_RP_", full.names=TRUE)

      ## get the complete names for the files
      exptable$stdFile <-
        sapply(exptable$stdFile,
               function(x)
               files[grep(x,files)])

      ## Not run:
      ## load the settings for the analysis
      data(FEMsettings)

      ## set the minimum number of features to 2
      metaSetting(Synapt.RP, "DBconstruction")$minfeat  <- 2

      ## create the DB
      LCDBtest <- createSTDdbLC(stdInfo=exptable,
                                settings = Synapt.RP,
                                polarity = "positive",
                                Ithr = 20)

    ## End(Not run)
      ## saved in "LCDBtest.RData" in the data directory of the metaMS
      ## package
    }

[Package metaMS version 1.22.0 Index]