pepHist | R Documentation |
pepHist
plots the histograms of peptide log2FC
.
prnHist
plots the histograms of protein log2FC
.
pepHist(
col_select = NULL,
scale_log2r = TRUE,
complete_cases = FALSE,
cut_points = c(mean_lint = NA),
show_curves = TRUE,
show_vline = TRUE,
scale_y = TRUE,
df = NULL,
filepath = NULL,
filename = NULL,
theme = NULL,
...
)
prnHist(
col_select = NULL,
scale_log2r = TRUE,
complete_cases = FALSE,
cut_points = c(mean_lint = NA),
show_curves = TRUE,
show_vline = TRUE,
scale_y = TRUE,
df = NULL,
filepath = NULL,
filename = NULL,
theme = NULL,
...
)
col_select |
Character string to a column key in |
scale_log2r |
Logical; if TRUE, adjusts |
complete_cases |
Logical; if TRUE, only cases that are complete with no missing values will be used. The default is FALSE. |
cut_points |
A named, numeric vector defines the cut points (knots) in
histograms. The default is |
show_curves |
Logical; if TRUE, shows the fitted curves. At the TRUE
default, the curve parameters are based on the latest call to
|
show_vline |
Logical; if TRUE, shows the vertical lines at |
scale_y |
Logical; if TRUE, scale data on the |
df |
The name of a primary data file. By default, it will be determined
automatically after matching the types of data and analysis with an
|
filepath |
A file path to output results. By default, it will be
determined automatically by the name of the calling function and the value
of |
filename |
A representative file name to outputs. By default, the
name(s) will be determined automatically. For text files, a typical file
extension is |
theme |
A ggplot2 theme, i.e., theme_bw(), or a custom theme. At the NULL default, a system theme will be applied. |
... |
|
In the histograms, the log2FC
under each TMT channel are color-coded by
their contributing reporter-ion or LFQ intensity.
Histograms of log2FC
; raw histogram data:
[...]_raw.txt
; fitted data for curves: [...]_fitted.txt
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")
# ===================================
# Histogram
# ===================================
## !!!require the brief working example in `?load_expts`
## examplary `MGKernel` alignment
standPep(
method_align = MGKernel,
n_comp = 3,
seed = 749662,
maxit = 200,
epsilon = 1e-05,
)
standPrn(
method_align = MGKernel,
n_comp = 2,
seed = 749662,
maxit = 200,
epsilon = 1e-05,
)
## (1) effects of data scaling
# peptide without log2FC scaling
pepHist(scale_log2r = FALSE)
# with scaling
pepHist(scale_log2r = TRUE)
## (2) sample column selection
# sample IDs indicated under column `Select` in `expt_smry.xlsx`
pepHist(col_select = Select, filename = colsel.png)
# protein data for samples under column `W2` in `expt_smry.xlsx`
prnHist(col_select = W2, filename = w2.png)
## (3) row filtration of data
# exclude oxidized methione or deamidated asparagine
pepHist(
# filter_by = exprs(!grepl("[mn]", pep_seq_mod)),
filter_by = exprs(not_contain_chars_in("mn", pep_seq_mod)),
filename = "no_mn.png",
)
# phosphopeptide subset (error message if no matches)
pepHist(
filter_peps = exprs(contain_chars_in("sty", pep_seq_mod)),
scale_y = FALSE,
filename = phospho.png,
)
# or use `grepl` directly
pepHist(
filter_by = exprs(grepl("[sty]", pep_seq_mod)),
filename = same_phospho.png,
)
## (4) between lead and lag
# leading profiles
pepHist(
filename = lead.png,
)
# lagging profiles at
# (1) n_psm >= 10
# (2) and no methionine oxidation or asparagine deamidation
pepHist(
filter_peps_by_npsm = exprs(pep_n_psm >= 10),
filter_peps_by_mn = exprs(not_contain_chars_in("mn", pep_seq_mod)),
filename = lag.png,
)
## (5) Data binning by `prot_icover`
pepHist(
cut_points = c(prot_icover = NA),
filename = prot_icover_coded.png,
)
## (6) custom theme
library(ggplot2)
my_histo_theme <- theme_bw() + theme(
axis.text.x = element_text(angle=0, vjust=0.5, size=18),
axis.ticks.x = element_blank(), # x-axis ticks
axis.text.y = element_text(angle=0, vjust=0.5, size=18),
axis.title.x = element_text(colour="black", size=24),
axis.title.y = element_text(colour="black", size=24),
plot.title = element_text(colour="black", size=24, hjust=.5, vjust=.5),
strip.text.x = element_text(size = 18, colour = "black", angle = 0),
strip.text.y = element_text(size = 18, colour = "black", angle = 90),
panel.grid.major.x = element_blank(),
panel.grid.minor.x = element_blank(),
panel.grid.major.y = element_blank(),
panel.grid.minor.y = element_blank(),
legend.key = element_rect(colour = NA, fill = 'transparent'),
legend.background = element_rect(colour = NA, fill = "transparent"),
legend.title = element_blank(),
legend.text = element_text(colour="black", size=18),
legend.text.align = 0,
legend.box = NULL
)
pepHist(
theme = my_histo_theme,
filename = my_theme.png,
)
pepHist(
col_select = BI_1,
theme = theme_dark(),
filename = bi1_dark.png,
)
## (7) direct uses of ggplot2
library(ggplot2)
res <- pepHist(filename = default.png)
# names(res)
p <- ggplot() +
geom_histogram(data = res$raw, aes(x = value, y = ..count.., fill = Int_index),
color = "white", alpha = .8, binwidth = .05, size = .1) +
scale_fill_brewer(palette = "Spectral", direction = -1) +
labs(title = "", x = expression("Ratio (" * log[2] * ")"), y = expression("Frequency")) +
scale_x_continuous(limits = c(-2, 2), breaks = seq(-2, 2, by = 1),
labels = as.character(seq(-2, 2, by = 1))) +
scale_y_continuous(limits = NULL) +
facet_wrap(~ Sample_ID, ncol = 5, scales = "fixed") # +
# my_histo_theme
p <- p +
geom_line(data = res$fitted, mapping = aes(x = x, y = value, colour = variable), size = .2) +
scale_colour_manual(values = c("gray", "gray", "gray", "black"), name = "Gaussian",
breaks = c(c("G1", "G2", "G3"), paste(c("G1", "G2", "G3"), collapse = " + ")),
labels = c("G1", "G2", "G3", "G1 + G2 + G3"))
p <- p + geom_vline(xintercept = 0, size = .25, linetype = "dashed")
ggsave(file.path(dat_dir, "Peptide/Histogram/my_ggplot2.png"),
width = 22, height = 48, limitsize = FALSE)
## Not run:
# sample selection
pepHist(
col_select = "a_column_key_not_in_`expt_smry.xlsx`",
)
# data filtration
pepHist(
filter_by = exprs(!grepl("[m]", a_column_key_not_in_data_table)),
)
prnHist(
lhs_not_start_with_filter_ = exprs(n_psm >= 5),
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.