get_scores_for_LC_MS: Get scores for metabolite putative IDs by LC-MS .

Description Usage Arguments Value Examples

Description

Get scores for metabolite putative IDs by LC-MS .

Usage

1
2
3
get_scores_for_LC_MS(filename, type = c("data.frame", "csv", "txt"),
  na = "NA", sep = ";", mode = c("POS", "NEG"), Size = 5000,
  delta = 1, gamma_mass = 10)

Arguments

filename

the name of the file which the data are to be read from. Its type should be chosen in 'extension' parameter. Also, it should have columns named exactly 'metid' (IDs for peaks), 'query_m.z' (query mass of peaks), 'exact_m.z' (exact mass of putative IDs), 'kegg_id' (IDs of putative IDs from KEGG Database), 'pubchem_cid' (CIDs of putative IDs from PubChem Database). Otherwise, this function would not work.

type

string indicating the type of the file. It can be a 'data.frame' which is already loaded into R, or some other specified types like a csv file.

na

a character vector of strings which are to be interpreted as NA values.

sep

a character value which seperates multiple IDs in kegg_id or pubchem_cid field, if there are multiple IDs.

mode

string indicating the mode of metabolites. It can be positive mode (POS) or negative mode (NEG).

Size

an integer which indicates sample size.

delta

a character value which seperates multiple IDs in kegg_id or pubchem_cid field, if there are multiple IDs.

gamma_mass

a character indicating the mode of compounds in the data frame.

Value

A csv file which contains input data frame together with a column of scores in the end. In the score column, if the row contains NA values or does not has a PubChem cid, the score would be '-', which stands for missing value. Otherwise, each score would be from 0 to 1.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
source("https://bioconductor.org/biocLite.R")
biocLite("ChemmineR")
library("ChemmineR")
## check if colnames of dataset meet requirement
names(demo2)
df <- subset(demo2, select = c(Query.Mass,Exact.Mass,KEGG.ID,PubChem.CID))
## change colnames
colnames(df) <- c('query_m.z','exact_m.z','kegg_id','pubchem_cid')
## get scores
out <- get_scores_for_LC_MS(df, type = 'data.frame', na='-', mode='POS')

xw187/MetID documentation built on May 5, 2019, 9:21 a.m.