LFQDataPlotter: LFQDataPlotter – Create various visualization of the LFQdata

LFQDataPlotterR Documentation

LFQDataPlotter —- Create various visualization of the LFQdata

Description

LFQDataPlotter —- Create various visualization of the LFQdata

LFQDataPlotter —- Create various visualization of the LFQdata

Public fields

lfq

LFQData object

prefix

prefix to figure names when writing, e.g. protein_

file_paths_pdf

with paths to figures

file_paths_html

with paths to figures

Methods

Public methods


Method new()

create LFQDataPlotter

Usage
LFQDataPlotter$new(lfqdata, prefix = "ms_")
Arguments
lfqdata

LFQData

prefix

will be prepended to outputs written


Method raster()

plot intensities in raster

Usage
LFQDataPlotter$raster(
  arrange = c("mean", "var"),
  not_na = FALSE,
  rownames = FALSE
)
Arguments
arrange

arrange by either mean or var

not_na

TRUE arrange by number of NA's, FALSE by arrange by intensity

rownames

show rownames (default FALSE - do not show.)

Returns

ggplot


Method heatmap()

heatmap of intensities - columns are samples, rows are proteins or peptides.

The abundances of each protein (row) are z-scored. Afterward, the mean abundance for each protein is zero, and the standard variation is one. z-scoring allows to compare (cluster) the proteins according to the difference in the expression in the samples. Without the z-scoring, the proteins would group according to their abundance, e.g., high abundant proteins would be one cluster.

Usage
LFQDataPlotter$heatmap(na_fraction = 0.3, rownames = FALSE)
Arguments
na_fraction

max fraction of NA's per row

rownames

show rownames (default FALSE - do not show.)

Returns

pheatmap


Method heatmap_cor()

heatmap of sample correlations.

The Spearman correlation among all samples is computed. Then the euclidean distance is used to compute the distances.

Usage
LFQDataPlotter$heatmap_cor()
Returns

pheatmap


Method pca()

PCA plot

A PCA is applied and the first and second principal component are shown.

Usage
LFQDataPlotter$pca(PC = c(1, 2), add_txt = TRUE)
Arguments
PC

default c(1,2) - first and second principal component

add_txt

show sample names

Returns

ggplot


Method pca_plotly()

pca plot

Usage
LFQDataPlotter$pca_plotly(PC = c(1, 2), add_txt = FALSE)
Arguments
PC

default c(1,2) - first and second principal component

add_txt

show sample names

Returns

plotly


Method boxplots()

boxplots for all proteins

Usage
LFQDataPlotter$boxplots(facet = TRUE)
Arguments
facet

enable facet wrap if hierarchy_depth less then hierarchy lenght.

Returns

tibble with column boxplots containing ggplot objects


Method missigness_histogram()

histogram of intensities given number of missing in conditions

Usage
LFQDataPlotter$missigness_histogram()
Returns

ggplot


Method NA_heatmap()

heatmap of features with missing values

Usage
LFQDataPlotter$NA_heatmap()
Returns

ggplot


Method intensity_distribution_density()

density distribution of intensities

Usage
LFQDataPlotter$intensity_distribution_density(legend = TRUE)
Arguments
legend

show legend TRUE, FALSE do not show.

Returns

ggplot


Method intensity_distribution_violin()

Violinplot showing distribution of intensities in all samples

Usage
LFQDataPlotter$intensity_distribution_violin()
Returns

ggplot


Method pairs_smooth()

pairsplot of intensities

Usage
LFQDataPlotter$pairs_smooth(max = 10)
Arguments
max

maximal number of samples to show

Returns

NULL


Method sample_correlation()

plot of sample correlations

Usage
LFQDataPlotter$sample_correlation()
Returns

NULL


Method upset_missing()

upset plot based on presence absence information

Usage
LFQDataPlotter$upset_missing()
Returns

plot


Method write_boxplots()

write boxplots to file

Usage
LFQDataPlotter$write_boxplots(path_qc, filename = NULL, width = 6, height = 6)
Arguments
path_qc

path to write to

filename

file to write into

width

fig width

height

fig height


Method write_pltly()

write pltly figures to path_qc

Usage
LFQDataPlotter$write_pltly(fig, path_qc, fig_name)
Arguments
fig

pltly figure

path_qc

path to write to

fig_name

file name (without extension)

Returns

path the file was written to.


Method write_pdf()

write figure to pdf

Usage
LFQDataPlotter$write_pdf(fig, path_qc, fig_name, width = 7, height = 7)
Arguments
fig

ggplot or pheatmap

path_qc

path to write to

fig_name

name of figure (no extension)

width

figure width

height

figure height

Returns

path the file was written to


Method write()

write heatmaps and pca plots to files

Usage
LFQDataPlotter$write(path_qc)
Arguments
path_qc

path to write to


Method clone()

The objects of this class are cloneable with this method.

Usage
LFQDataPlotter$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

plot_heatmap_cor

plot_pca

Other LFQData: LFQData, LFQDataAggregator, LFQDataStats, LFQDataSummariser, LFQDataToSummarizedExperiment(), LFQDataWriter

Examples


istar <- sim_lfq_data_peptide_config()

lfqdata <- LFQData$new(
 istar$data,
 istar$config)
#LFQDataPlotter$debug("boxplots")
LFQDataPlotter$debug("pairs_smooth")
lfqplotter <- lfqdata$get_Plotter()

stopifnot(class(lfqplotter$heatmap()) == "pheatmap")
stopifnot(class(lfqplotter$heatmap_cor()) == "pheatmap")
stopifnot("ggplot" %in% class(lfqplotter$pca()))
stopifnot("plotly" %in%  class(lfqplotter$pca_plotly()))
tmp <- lfqplotter$boxplots()
stopifnot("ggplot" %in%  class(tmp$boxplot[[1]]))
stopifnot("ggplot" %in% class(lfqplotter$missigness_histogram()))

stopifnot(class(lfqplotter$NA_heatmap()) == "pheatmap")
class(lfqplotter$intensity_distribution_density())
class(lfqplotter$intensity_distribution_violin())
## Not run: 
  stopifnot(is.null(lfqplotter$pairs_smooth()))

## End(Not run)
stopifnot(class(lfqplotter$sample_correlation()) == "list")
stopifnot(class(lfqplotter$raster()) == "pheatmap")
stopifnot("upset" == class(lfqplotter$upset_missing()))
stopifnot(class(prolfqua::plot_sample_correlation(istar$data, istar$config)) == "list")



wolski/prolfqua documentation built on Dec. 4, 2024, 11:18 p.m.