subSetLib: Creation of a subset MS library

Description Usage Arguments Details Value Author(s) Examples

View source: R/baitmet_DB.R

Description

Creates a new MS library containing a subset of a larger MS library

Usage

1
subSetLib(database, indexes)

Arguments

database

A mass-spectral/retention index library.

indexes

The indexes to be included in this sub-set version (see Details/Examples)

Details

This function is useful to reduce the library to a number of compounds of interest, for example, those having a KEGG number (see examples below)

See BaitMet vignette for more details. To open the vignette, execute the following code in R: vignette("BaitMetManual", package="baitmet")

Value

The function returns the new subset library, see the examples below.

Author(s)

Xavier Domingo-Almenara. xavier.domingo@urv.cat

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# this function is useful if we want to reduce a 
# bigger MS library to a certain compounds of interest.
# For example, we can reduce the MS library included
# in BaitMet ("mslib" object containing the MassBank 
# library), to a smaller subset containing only those
# compounds with KEGG number:

kegg.ind <- which(lapply(mslib@database, function(x) x$KEGG)!="")
mslib.kegg <- subSetLib(mslib, kegg.ind)

# This is a naive example, as in fact, all the compounds
# in the mslib object have a KEGG number. However, this
# not occurs in the Golm Metabolome Database

baitmet documentation built on May 2, 2019, 11 a.m.

Related to subSetLib in baitmet...