purgePep: Purges peptide data

purgePepR Documentation

Purges peptide data

Description

purgePep removes protein entries from Peptide.txt by quality criteria. It further plots the distributions of the CV of log2FC.

Usage

purgePep(
  dat_dir = NULL,
  pt_cv = NULL,
  max_cv = NULL,
  adjSD = FALSE,
  min_n = 1L,
  rm_allna = FALSE,
  col_select = NULL,
  col_order = NULL,
  filename = NULL,
  theme = NULL,
  ...
)

Arguments

dat_dir

A character string to the working directory. The default is to match the value under the global environment.

pt_cv

Numeric between 0 and 1; the percentile of CV. Values above the percentile threshold will be replaced with NA. The default is NULL with no data trimming by CV percentile. The precedence in data purging is pt_cv \ge max_cv \ge min_n.

max_cv

Numeric; the cut-off in maximum CV. Values above the threshold will be replaced with NA. The default is NULL with no data trimming by max CV.

adjSD

Not currently used. If TRUE, adjust the standard deviation in relative to the width of ratio profiles.

min_n

Positive integer. When calling from purgePSM, peptide entries in PSM tables with the number of identifying PSMs smaller than min_n will be replaced with NA. When calling from purgePep, protein entries in peptide tables with the number of identifying peptides smaller than min_n will be replaced with NA.

rm_allna

Logical; if TRUE, removes data rows that are exclusively NA across ratio columns of log2_R126 etc. The setting also applies to log2_R000 in LFQ.

col_select

Character string to a column key in expt_smry.xlsx. At the NULL default, the column key of Select in expt_smry.xlsx will be used. In the case of no samples being specified under Select, the column key of Sample_ID will be used. The non-empty entries under the ascribing column will be used in indicated analysis.

col_order

Character string to a column key in expt_smry.xlsx. Numeric values under which will be used for the left-to-right arrangement of samples in graphic outputs or top-to-bottom arrangement in text outputs. At the NULL default, the column key Order will be used. If values under column Order are left blank, samples will be ordered by their names.

filename

A representative file name to outputs. By default, the name(s) will be determined automatically. For text files, a typical file extension is .txt. For image files, they are typically saved via ggsave or pheatmap where the image type will be determined by the extension of the file name.

theme

A ggplot2 theme, i.e., theme_bw(), or a custom theme. At the NULL default, a system theme will be applied.

...

Additional parameters for plotting:
ymax, the maximum y at a log2 scale.
ybreaks, the breaks in y-axis at a log2 scale.
width, the width of plot.
height, the height of plot.
flip_coord, logical; if TRUE, flip x and y axis.

Details

The CV of proteins under each sample are first calculated from contributing peptides. In the event of multiple series of LC/MS injections, the CV of the same protein from different LC/MS will be summarized by median statistics.

The data nullification will be applied column-wisely for all available samples. Argument col_select is merely used to subset samples for the visualization of log2FC distributions.

See Also

Metadata
load_expts for metadata preparation and a reduced working example in data normalization

Data normalization
normPSM for extended examples in PSM data normalization
PSM2Pep for extended examples in PSM to peptide summarization
mergePep for extended examples in peptide data merging
standPep for extended examples in peptide data normalization
Pep2Prn for extended examples in peptide to protein summarization
standPrn for extended examples in protein data normalization.
purgePSM and purgePep for extended examples in data purging
pepHist and prnHist for extended examples in histogram visualization.
extract_raws and extract_psm_raws for extracting MS file names

Variable arguments of 'filter_...'
contain_str, contain_chars_in, not_contain_str, not_contain_chars_in, start_with_str, end_with_str, start_with_chars_in and ends_with_chars_in for data subsetting by character strings

Missing values
pepImp and prnImp for missing value imputation

Informatics
pepSig and prnSig for significance tests
pepVol and prnVol for volcano plot visualization
prnGSPA for gene set enrichment analysis by protein significance pVals
gspaMap for mapping GSPA to volcano plot visualization
prnGSPAHM for heat map and network visualization of GSPA results
prnGSVA for gene set variance analysis
prnGSEA for data preparation for online GSEA.
pepMDS and prnMDS for MDS visualization
pepPCA and prnPCA for PCA visualization
pepLDA and prnLDA for LDA visualization
pepHM and prnHM for heat map visualization
pepCorr_logFC, prnCorr_logFC, pepCorr_logInt and prnCorr_logInt for correlation plots
anal_prnTrend and plot_prnTrend for trend analysis and visualization
anal_pepNMF, anal_prnNMF, plot_pepNMFCon, plot_prnNMFCon, plot_pepNMFCoef, plot_prnNMFCoef and plot_metaNMF for NMF analysis and visualization

Custom databases
Uni2Entrez for lookups between UniProt accessions and Entrez IDs
Ref2Entrez for lookups among RefSeq accessions, gene names and Entrez IDs
prepGO for gene ontology
prepMSig for molecular signatures
prepString and anal_prnString for STRING-DB

Column keys in PSM, peptide and protein outputs
system.file("extdata", "psm_keys.txt", package = "proteoQ")
system.file("extdata", "peptide_keys.txt", package = "proteoQ")
system.file("extdata", "protein_keys.txt", package = "proteoQ")

Examples


# ===================================
# Peptide cleanup by CV
# ===================================

## !!!require the brief working example in `?load_expts`

## additional examples
# visualization only
purgePep()

# visualization of non-void entries under column `BI_1` in `expt_smry.xlsx`
purgePep(
  col_select = BI_1,
  width = 8,
  height = 8,
  filename = bi_1.png,
)

# by percent CV
purgePep(pt_cv = .95)

# by max CV
purgePep(max_cv = .5)

# by `max_cv` then by `pt_cv`
purgePep(max_cv = .5)
purgePep(pt_cv = .95)

# actually 90% CV 
purgePep(pt_cv = .95)
purgePep(pt_cv = .95)

## custom theme
purgePep(dpi = 300, theme = ggplot2::theme_get(), filename = my_theme.png)



qzhang503/proteoQ documentation built on Dec. 14, 2024, 12:27 p.m.