write.met: Write Metabolomics Dataset of Standard Structure

Description Usage Arguments Value See Also Examples

View source: R/functions_cleane.R

Description

Write a metabolomics file based on the metabolites identified to be retained or removed using met_proc. Requires the filepath for the original metabolomics file in order to extract row and column information. Will take in this original file and the results of the met_proc function to write a file that contains only the retained or removed metabolites.

Usage

1
2
write.met(res, filename, origfile, headrow = 3, metidcol=1, fvalue=8, 
sep=",", type="keep")

Arguments

res

The result output from met_proc function.

filename

The name and path for new metabolomics file.

origfile

The name and path for the original metabolomics file.

headrow

The row number that contains the header line in the original metabolomics file. Default is 3.

metidcol

The column number that contains the metabolite ID in the original metabolomics file. Default is 1.

fvalue

The column number where data begins in the original metabolomics file. Default is 8.

sep

File delimiter for both the original metabolomics file and the new file. Default is ",".

type

Either ‘keep’ or ‘remove’ to determine whether the retained metabolites or removed metabolites should be written to the file. Default is "keep".

Value

Writes a file to filename that is of the same structure as the original metabolomics file but only containing either the retained or removed metabolites.

See Also

See MetProc-package for examples of running the full process.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(MetProc)
#Read in metabolomics data
metdata <- read.met(system.file("extdata/sampledata.csv", package="MetProc"),
headrow=3, metidcol=1, fvalue=8, sep=",", ppkey="PPP", ippkey="BPP")

#Separate likely artifacts from true signal using default settings
results <- met_proc(metdata,plot=FALSE)

#Write the retained metabolites to current directory
write.met(results,'sample_retained.csv',
system.file("extdata/sampledata.csv", package="MetProc"),
headrow=3,metidcol=1,fvalue=8,sep=",",type='keep')

MetProc documentation built on May 2, 2019, 2:42 a.m.