Learn R Programming

enviGCMS: GC-MS Data Analysis for Environmental Science

enviGCMS provides functions for GC/LC-MS data analysis for environmental sciences.

Installation

You can either use the stable version of enviGCMS from CRAN,

install.packages("enviGCMS")

or the current development snapshot from this GitHub repository:

remotes::install_github("yufree/enviGCMS")

Usage

Check this vignette for Data analysis of GC-MS and LC-MS in Environmental Science.

Check this vignette for Pooled QC analysis in Environmental Science.

  • get the mean and RSD of one sample for 5 technique replicate
# enviGCMS use functions in xcms to import the data, just type the path to your single sample
data1 <- enviGCMS:::getmd(‘sample1-1’)
data2 <- enviGCMS:::getmd(‘sample1-2’)
data3 <- enviGCMS:::getmd(‘sample1-3’)
data4 <- enviGCMS:::getmd(‘sample1-4’)
data5 <- enviGCMS:::getmd(‘sample1-5’)
  • get the mean
data <- (data1+data2+data3+data4+data5)/5
  • get the standard deviation
datasd <- sqrt(((data1-data)^2+(data2-data)^2+(data3-data)^2+(data4-data)^2+(data5-data)^2)/4)
  • get the RSD
databrsd <- datasd/data
  • plot the smooth scatter
plotsms(datarsd)
  • plot the heatmap
plotms(data)
  • plot the mz-rt scatter plot
plotmz(data)
  • plot the boundary model
findline(data)

Detailed usage of those functions in Environmental analysis could be found in this paper and the vignettes in this package.

Copy Link

Version

Install

install.packages('enviGCMS')

Monthly Downloads

388

Version

0.7.1

License

GPL-2

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

February 6th, 2023

Functions in enviGCMS (0.7.1)

TBBPA

Demo data for TBBPA metabolism in Pumpkin
batch

Get the MIR and related information from the files
findpfc

Find PFCs based on mass defect analysis
findohc

Screen organohalogen compounds by retention time, mass defect analysis and isotope relationship modified by literature report. Also support compounds with [M] and [M+2] ratio cutoff.
getcompare

Align multiple peaks list to one peak list
findlipid

Find lipid class of metabolites base on referenced Kendrick mass defect
findmet

Screen metabolites by Mass Defect
getcsv

Convert an list object to csv file.
getfeaturesanova

Get the features from anova, with p value, q value, rsd and power restriction
enviGCMS-deprecated

Deprecated functions in package enviGCMS.
getfeaturest

Get the features from t test, with p value, q value, rsd and power restriction
getfilter

Filter the data based on row and column index
GetIntegration

GetIntegration was mainly used for get the integration of certain ion's chromatogram data and plot the data
getformula

Get chemical formula for mass to charge ratio.
getrangecsv

Get a mzrt list and/or save mz and rt range as csv file.
getretcor

Perform peaks list alignment and return features table
Getisotopologues

Get the selected isotopologues at certain MS data
getsccp

Quantitative analysis for short-chain chlorinated paraffins(SCCPs)
getrmd

Get the Relative Mass Defect
cbmd

Combine two data with similar retention time while different mass range
dotpanno

Perform MS/MS dot product annotation for mgf file
plotgroup

Plot the response group of GC-MS
findline

find line of the regression model for GC-MS
getmass

Get the exact mass of the isotopologues from a chemical formula or reaction's isotope patterns with the highest abundances
getmdh

Get the high order unit based Mass Defect
getmd

Import data and return the annotated matrix for GC/LC-MS by m/z range and retention time
getmzrt2

Get the mzrt profile and group information for batch correction and plot as a list for xcms 3 object
getmassdefect

Get mass defect with certain scaled factor
plothist

plot the density of the GC-MS data with EM algorithm to separate the data into two log normal distribution.
getQCraw

get the data of QC compound for a group of data
getbgremove

Get the peak list with blank samples' peaks removed
getMSP

read in MSP file as list for ms/ms or ms(EI) annotation
getbiotechrep

Get the report for biological replicates.
gifmr

plot scatter plot for rt-mz profile and output gif file for multiple groups
list

Demo data
getgrouprep

Get the report for samples with biological and technique replicates in different groups
plothm

Plot the heatmap of mzrt profiles
getimputation

Impute the peaks list data
getmzrtcsv

Covert the peaks list csv file into list
plotint

plot the information of integration
plotpeak

plot intensity of peaks across samples or samples across peaks
plotms

plot GC/LC-MS data as a heatmap with TIC
getsim

output the similarity of two dataset
plotrug

plot 1-d density for multiple samples
plotridge

plot ridgeline density plot
getpqsi

Compute pooled QC linear index according to run order
getpower

Get the index with power restriction for certain study with BH adjusted p-value and certain power.
Integration

Just integrate data according to fixed rt and fixed noise area
gettechrep

Get the report for technique replicates.
getarea

Get the peak information from samples for SCCPs detection
plotmsrt

Plot EIC of certain m/z and return dataframe for integration
plotsub

Plot the background of data
plott

plot GC-MS data as a heatmap for constant speed of temperature rising
getareastd

Get the peak information from SCCPs standards
getdwtus

Density weighted intensity for one sample
getdoe

Generate the group level rsd and average intensity based on DoE,
plotcc

plot the calibration curve with error bar, r squared and equation.
Mode

define the Mode function
plotden

plot the density for multiple samples
plotmz

plot GC/LC-MS data as scatter plot
plotpca

plot the PCA for multiple samples
plotrtms

Plot mass spectrum of certain retention time and return mass spectrum vector (MSP file) for NIST search
plotrsd

plot the rsd influences of data in different groups
plottic

Plot Total Ion Chromatogram (TIC)
getmdr

Get the raw Mass Defect
qbatch

Get the MIR from the file
svadata

Filter the data with p value and q value
svapca

Principal component analysis(PCA) for SVA corrected data and raw data
svabatch

Plot the influences of DoE and Batch effects on each peaks
plotsms

Plot the intensity distribution of GC-MS
getalign

Align two peaks vectors by mass to charge ratio and/or retention time
sccp

Short-Chain Chlorinated Paraffins(SCCPs) peaks information for quantitative analysis
submd

Get the differences of two GC/LC-MS data
svacor

Surrogate variable analysis(SVA) to correct the unknown batch effects
getpn

Merge positive and negative mode data
getmr

Get the mzrt profile and group information for batch correction and plot as a list directly from path with default setting
getoverlappeak

Get the overlap peaks by mass and retention time range
getalign2

Align mass to charge ratio and/or retention time to remove redundancy
getdata

Get xcmsset object in one step with optimized methods.
writeMSP

Write MSP file for NIST search
getdata2

Get XCMSnExp object in one step from structured folder path for xcms 3.
xrankanno

Perform MS/MS X rank annotation for mgf file
getms1anno

Annotation of MS1 data by compounds database by predefined paired mass distance
getmzrt

Get the mzrt profile and group information as a mzrt list and/or save them as csv or rds for further analysis.
getupload2

Get the csv files to be submitted to Metaboanalyst
getupload3

Get the csv files to be submitted to Metaboanalyst
plotdwtus

plot density weighted intensity for multiple samples
gettimegrouprep

Get the time series or two factor DoE report for samples with biological and technique replicates in different groups
getupload

Get the csv files from xcmsset/XCMSnExp/list object
plote

plot EIC and boxplot for all peaks and return diffreport
plotmr

plot the scatter plot for peaks list with threshold
plotanno

Show MS/MS pmd annotation result
ma

filter data by average moving box
plotintslope

plot the slope information of integration
plotmrc

plot the diff scatter plot for peaks list with threshold between two groups
plotkms

plot the kendrick mass defect diagram
svaplot

Filter the data with p value and q value and show them
svaupload

Get the corrected data after SVA for metabolanalyst
runsccp

Shiny application for Short-Chain Chlorinated Paraffins analysis
plotrla

Relative Log Abundance (RLA) plots
runMDPlot

Shiny application for interactive mass defect plots analysis
plotridges

Relative Log Abundance Ridge (RLAR) plots for samples or peaks