Learn R Programming

pmartR

This R package provides functionality for quality control processing, statistical analysis and visualization of mass spectrometry (MS) omics data, in particular proteomic (either at the peptide or the protein level; isobaric labeled or unlabled), lipidomic, and metabolomic data. This includes data transformation, specification of groups that are to be compared against each other, filtering of feature and/or samples, data normalization, data summarization (correlation, PCA), and statistical comparisons of groups of interest (ANOVA and/or independence of missing data tests). Example data to be used with this packages can be found in pmartRdata.

Installation:

This package makes use of several packages hosted on BioConductor. If you are encountering warnings about unavailable BioConductor packages such as pcaMethods, you may need to add them to options("repos"):

if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

options("repos" = BiocManager::repositories())

(Recommended) Install from CRAN:

install.packages("pmartR")

# or 

BiocManager::install("pmartR")

If you are on Mac/Windows and have a recent R version, you can skip compilation by installing from binaries, see the pmartR CRAN page for available binaries.

install.packages("pmartR", type = "binary")

# or 

BiocManager::install("pmartR", type = "binary")

To install the latest release:

devtools::install_github("pmartR/pmartR@*release")

To install a specific release, say v2.4.0:

devtools::install_github("pmartR/pmartR@v2.4.0")

(Not recommended, since these changes are likely still being tested) You can also install the latest changes to master:

devtools::install_github("pmartR/pmartR")

Problems with rcppArmadillo and gfortran on mac

There is a problem that causes pmartR to fail compiling cpp code, which has something to do with rcppArmadillo and certain installations of gfortran. See these posts that try to explain the issue: 1 2 3. The simplest solution if you are on Mac/Windows and have a recent R version is to install from pre-built binaries (see installation section). If you cannot install from binaries, two solutions we have found are:

  1. Install gfortran from a recommended source (not homebrew):
  2. When using the homebrew gfortran installation, add the line FLIBS = -L`gfortran -print-file-name=libgfortran.dylib | xargs dirname` to ~/.R/Makevars (a plain text file with no extention)

gfortran and Apple silicon (M1/M2 chips)

There are similarly issues with compilation in newer Mac chips. We recommend to install gcc-13 from homebrew brew install gcc or the universal version from https://mac.r-project.org/tools/.

Additionally, some users experience errors with ld: Assertion failed ... as seen here. One solution is to use the old linker by making sure gcc uses the flag -ld64 (Xcode docs). To do this, you can edit ~/.R/Makevars to include this flag, for example by appending it to LDFLAGS with +=:

# in ~/.R/Makevars
LDFLAGS+=-ld64

or specifying it in your compiler command:

# in ~/.R/Makevars
CC=/usr/local/bin/gcc -ld64

Tutorial:

To get started, see the package documentation and function reference located here.

Data:

Example peptide (both unlabeled and isobaric labeled), protein, metabolite and lipid data are available in the pmartRdata package available on Github, here

Contributing

See the contributing docs.

Citation:

To cite this package, please the following:

Degnan, D. J.; Stratton, K. G.; Richardson, R.; Claborne, D.; Martin, E. A.; Johnson, N. A.; Leach, D.; Webb-Robertson, B.-J. M.; Bramer, L. M. PmartR 2.0: A Quality Control, Visualization, and Statistics Pipeline for Multiple Omics Datatypes. J. Proteome Res. 2023, 22 (2), 570–576. https://doi.org/10.1021/acs.jproteome.2c00610.

BibTex:

@article{degnan2023pmartr,
  title={pmartR 2.0: A Quality Control, Visualization, and Statistics Pipeline for Multiple Omics Datatypes},
  author={Degnan, David J and Stratton, Kelly G and Richardson, Rachel and Claborne, Daniel and Martin, Evan A and Johnson, Nathan A and Leach, Damon and Webb-Robertson, Bobbie-Jo M and Bramer, Lisa M},
  doi = {10.1021/acs.jproteome.2c00610},
  journal={Journal of Proteome Research},
  year={2023},
  publisher={ACS Publications}
}

Disclaimer:

This material was prepared as an account of work sponsored by an agency of the United States Government. Neither the United States Government nor the United States Department of Energy, nor Battelle, nor any of their employees, nor any jurisdiction or organization that has cooperated in the development of these materials, makes any warranty, express or implied, or assumes any legal liability or responsibility for the accuracy, completeness, or usefulness or any information, apparatus, product, software, or process disclosed, or represents that its use would not infringe privately owned rights.

Reference herein to any specific commercial product, process, or service by trade name, trademark, manufacturer, or otherwise does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or any agency thereof, or Battelle Memorial Institute. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or any agency thereof.

  PACIFIC NORTHWEST NATIONAL LABORATORY
  operated by BATTELLE for the
  UNITED STATES DEPARTMENT OF ENERGY
  under Contract DE-AC05-76RL01830

Copy Link

Version

Install

install.packages('pmartR')

Monthly Downloads

443

Version

2.4.6

License

BSD_2_clause + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Lisa Bramer

Last Published

October 14th, 2024

Functions in pmartR (2.4.6)

as.lipidData

Create pmartR Object of Class lipidData
DESeq2_wrapper

Wrapper for DESeq2 workflow
applyFilt

Apply a S3 filter object to a pmartR S3 object
as.metabData

Create pmartR Object of Class metabData
as.multiData

Create a `multiData` object from multiple omicsData objects
RNA_filter

RNA Filter Object
anova_filter

Identifies biomolecules to be filtered in preparation for IMD-ANOVA.
as.pepData

Create pmartR Object of Class pepData
bpquant_mod

bpquant_mod function
as.seqData

Create pmartR Object of Class seqData
combine_lipidData

Combines two omicsData objects with identical sample information.
as.trelliData

Generate an object from omicsData and/or statRes objects to pass to trelliscope building functions
column_matches_exact

Helper to find the names of columns of a data.frame that contain exactly all the elements of an input column
bpquant

Runs BP-Quant
as.nmrData

Create pmartR Object of Class nmrData
as.proData

Create pmartR Object of Class proData
as.trelliData.edata

Generate an object from edata to pass to trelliscope building functions
custom_sampnames

Creates custom sample names to be used in plots
dim_reduction

Reduce Dimension of Data for Exploratory Data Analysis
custom_filter

Custom Filter Object
cv_filter

Pooled Coefficient of Variation (CV) Filter Object
cor_result

Compute Correlation matrix of biomolecule data
diffexp_seq

Differential Expression for seqData
create_comparisonDF

Returns data frame with comparisons to be made
dispersion_est

Diagnostic plot for seqData
find_fmeta_cnames

Find column names in f_meta for each object. May return in two objects sharing the same column name.
edgeR_wrapper

Wrapper for edgeR workflow
get_comparisons

Return comparisons of statRes object
edata_replace

Replace Values Equal to x with y
get_data_norm

Fetch the normalization status of the data
get_filter_type

Extracts the types of filters that have been applied. This function will be used at the beginning of the applyFilt function to give a warning if the same type of filter has already been applied.
get_check_names

DEPRECATED: Fetch the check.names attribute
.is_edata

Test if a file is an edata file
get_data_scale

Fetch the current data scale
get_filters

Fetch the filters attribute
combine_techreps

Combine technical replicates of an omicsData object
complete_mols

Identify biomolecules with no missing values across samples
edata_summary

Creates a list of six Data Frames, one for each summarizing metric
get_isobaric_norm

Fetch the isobaric normalization info
edata_transform

Apply a Transformation to the Data
get_data_info

Fetch the data_info attribute
get_data_class

Return data_class of statRes or trelliData object
get_pred_grid

Build the prediction grid to compute least squares means.
get_nmr_norm

Fetch the NMR normalization info
get_edata_cname

Fetch the e_data column name
get_data_scale_orig

Fetch the original data scale
fit_surv

Basic survival analysis function
get_group_table

Get group table
get_isobaric_info

Fetch the isobaric_info attribute
fmeta_matches

Check that the f_meta file contains a column aligned to each omicsData objects
get_emeta_cname

Fetch the e_meta column name
get_spans_params

Gets the parameters for the highest ranked methods from spans.
get_group_formula

Get formula for group design
get_group_DF

Fetch the group_DF attribute
get_fdata_cname

Fetch the f_data column name
imd_test

Tests for the independence of missing data across groups (aka factors, aka main effects)
gtest_filter

Identifies peptides to be filtered out in preparation for IMD-ANOVA.
normRes_tests

Test the location and scale parameters from a normalization procedure
gtest_heatmap

Plot a heatmap for the g-test results of imd-anova
mean_center

Mean Center Transformation
group_comparison_imd

Group comparisons for the g-test
group_designation

Creates Attribute of omicsData Object for Group Membership
imd_anova

Test for a qualitative and quantitative difference between groups using IMD and ANOVA, respectively
nonmissing_per_group

Computes the Number of Non-Missing Data Points by Group
mad_transform

Median Absolute Deviation Transformation
make_volcano_plot_df

Create a plotting dataframe for volcano plots and heatmaps
group_comparison_anova

Group comparisons for the anova test
normalize_global_basic

Normalize e_data within SPANS
normalize_global

Calculate Normalization Parameters and Apply Global Normalization
normalize_nmr

Normalize an Object of Class nmrData
normalize_zero_one_scaling

Scale from zero to one
get_lsmeans

Compute the least squares means from a prediction grid and estimated coefficients
p_adjustment_anova

Adjust p-values for multiple comparisons
median_center

Median Center Transformation
plot.RNAFilt

Plot RNAFilt Object
normalize_quantile

Quantile Normalization
normalize_isobaric

Examine and Apply Isobaric Normalization
plot.SPANSRes

Plot SPANSRes Object
plot.cvFilt

Plot cvFilt Object
plot.imdanovaFilt

Plot imdanovaFilt Object
plot.dimRes

Plot dimRes Object
normalize_loess

Loess Normalization
get_nmr_info

Fetch the nmr_info attribute
los

Identify Biomolecules from the Top L Order Statistics for Use in Normalization
missingval_result

Creates an object of class naRes (NA Result)
get_meta_info

Fetch the meta_info attribute
molecule_filter

Molecule Filter Object
plot.moleculeFilt

Plot moleculeFilt Object
imdanova_filter

IMD-ANOVA Filter Object
plot.corRes

Plot corRes Object
plot.naRes

Plot naRes Object
plot.isobaricnormRes

Plot isobaricnormRes object
plot.statRes

Plot statRes Object
plot.metabData

Plot metabData Object
plot.lipidData

Plot lipidData Object
plot.totalCountFilt

Plot totalCountFilt Object
plot.customFilt

Plot customFilt Object
plot.normRes

Plot normRes Object
plot.nmrnormRes

Plot nmrnormRes Object
prep_flags

Extract flag columns from a statRes object
pre_imdanova_melt

Create a Melted and Grouped Version of e_data for IMD_ANOVA filter
plot.nmrData

Plot nmrData Object
plot.rmdFilt

Plot rmdFilt Object
plot.isobaricpepData

Plot isobaricpepData Object
ppp_rip

Identify Proportion of Peptides Present (PPP) and Rank Invariant Peptides (RIP) for Use in Normalization
plot.seqData

Plot seqData Object
pmartR_filter_worker

Remove items that need to be filtered out
ppp

Identify Biomolecules from the Proportion Present (PPP) for Use in Normalization
plot.pepData

Plot pepData Object
print.cvFilt

print.cvFilt
pquant

Protein Quantitation using Mean or Median Peptide Abundances
plot.dataRes

Plot dataRes object
print.dataRes

print.dataRes
plot.proData

Plot proData Object
qrollup

Applies qrollup function
print.proteomicsFilterSummary

Proteomics Filter Print Method
print.rmdFilterSummary

RMD Filter Print Method
proteomics_filter

Proteomics Filter Object
print.proData

print.proData
print.pepData

print.pepData
print.customFilterSummary

Custom Filter Print Method
reexports

Objects exported from other packages
print.cvFilterSummary

CV Filter Print Method
print.normRes

print.normRes
pmartR

Panomics Marketplace - Quality Control and Statistical Analysis for Panomics Data
plot_km

Basic survival analysis plot
print.imdanovaFilt

print.imdanovaFilt
print.proteomicsFilt

print.proteomicsFilt
set_check_names

DEPRECATED: Set check.names attribute of omicsData object
run_skewness

Calculate the Skewness of Sample Runs
print.lipidData

print.lipidData
replace_nas

Replace NA with 0
rmd_filter

Robust Mahalanobis Distance (RMD) Filter Object
print.totalCountFilt

print.totalCountFilt
rip

Identify Rank-Invariant Biomolcules for Use in Normalization
print.RNAFiltSummary

RNA Filter Print Method
rmd_conversion

Conversion between log2(RMD) and p-value
print.customFilt

print.customFilt
protein_quant

Protein Quantification
print.seqData

print.seqData
print.rmdFilt

print.rmdFilt
plot.proteomicsFilt

Plot proteomicsFilt Object
run_kurtosis

Calculate the Kurtosis of Sample Runs
print.RNAFilt

print.RNAFilt
statRes_output

Function to take raw output of `imd_anova` and create output for `statRes` object
print.totalCountFiltSummary

Total Count Filter Print Method
replace_zeros

Replace 0 with NA
rrollup

Applies rrollup function
run_group_meancor

Calculate the Mean Correlation of a Sample with Respect to Group
set_isobaric_info

Sets/updates the values in the isobaric_info attribute.
print.metabData

print.metabData
report_dataRes

Creates a data frame displaying multiple metrics
statres_barplot

Fold change barplots for statres objects
run_mad

Calculate the Median Absolute Deviance (MAD) of Sample Runs
summary-isobaricnormRes

Summary for isobaricnormRes Object
print.moleculeFilt

print.moleculeFilt
spans_make_distribution

Creates the list of median p-values used to make the background distribution used to compute the SPANS score in step 2.
summary.RNAFilt

RNA Filter Summary
run_prop_missing

Calculate the Fraction of Missing Data of Sample Runs
statres_volcano_plot

Volcano plot for the anova results of imd-anova
print.imdanovaFilterSummary

IMD-ANOVA Filter Print Method
spans_procedure

Calculate SPANS Score for a Number of Normalization Methods
summary.customFilt

Custom Filter Summary
print.moleculeFilterSummary

Molecule Filter Print Method
set_filter

Sets/updates the filters attribute with a filter class object.
set_nmr_info

Sets/updates the values in the nmr_info attribute.
summary.proteomicsFilt

Proteomics Filter Summary
summary.moleculeFilt

Molecule Filter Summary
set_data_info

Functions to set omicsData attributes ----------------------------------------
summary.cvFilt

Coefficient of Variation (CV) Filter Summary
summary.totalCountFilt

Total Count Filter Summary
summary.rmdFilt

RMD Filter Summary
summary.imdanovaFilt

IMD-ANOVA Filter Summary
statRes-class

Summary of statRes Object
summary-nmrnormRes

Summary of nmrnormRes Object
set_meta_info

Sets/updates the values in the meta_info attribute
summary-omicsData

Produce a basic summary of a pmartR omicsData S3 Object
trelli_abundance_histogram

Histogram trelliscope building function for abundance data
summary-trelliData

Summarizes potential plotting options for a trelliData object
summary-pmartR-results

Summary of pmartR Analysis Functions
trelli_foldchange_bar

Bar chart trelliscope building function for fold_change
trelli_foldchange_volcano

Volcano trelliscope building function for fold_change
trelli_missingness_bar

Bar chart trelliscope building function for missing data
surv_designation

Create a "surv_DF" attribute so that survival analysis can be implemented.
zero_one_scale

Zero to One scaling
summary_km

Basic survival analysis summary
trelli_foldchange_boxplot

Boxplot trelliscope building function for fold_changes
trelli_foldchange_heatmap

Heatmap trelliscope building function for fold_change
voom_wrapper

Wrapper for limma-voom workflow
trelli_panel_by

Set the "panel_by" variable for a trelliData object
take_diff

Compute pairwise differences
total_count_filter

Total Count Filter Object
trelli_precheck

Performs initial checks for trelliData objects
trelli_pvalue_filter

Filter a paneled trelliData object by a p-value
trelli_abundance_boxplot

Boxplot trelliscope building function for abundance data
trelli_abundance_heatmap

Heatmap trelliscope building function for abundance data
trelli_rnaseq_heatmap

Heatmap trelliscope building function for RNA-seq data
zrollup

Applies zrollup function
zscore_transform

Z-Score Transformation
vector_replace

Replace x with y for a single vector
trelli_rnaseq_boxplot

Boxplot trelliscope building function for RNA-seq data
trelli_rnaseq_nonzero_bar

Bar chart trelliscope building function for Non-Zero counts in RNA-seq data
trelli_rnaseq_histogram

Histogram trelliscope building function for RNA-Seq data
all_subset

Identify All Biomolecules for Use in Normalization
as.isobaricpepData

Create pmartR Object of Class isobaricpepData
anova_test

Tests for a quantiative difference between groups (aka factors, aka main effects)