Skip to contents

Aggregates peptide intensities to protein level using top N peptides. Works with raw (untransformed) intensities.

Value

An R6 class generator.

Super class

AggregatorBase -> AggregateTopN

Public fields

N

top N peptides by intensity

func

aggregation function name: "sum" or "mean"

Methods

Inherited methods


AggregateTopN$new()

initialize

Usage

AggregateTopN$new(lfq, prefix = "protein", N = 3, func = "sum")

Arguments

lfq

LFQData

prefix

default protein

N

top N peptides (default 3)

func

"sum" or "mean" (default "sum")


AggregateTopN$aggregate()

run top N aggregation

Usage

AggregateTopN$aggregate()

Returns

LFQData


AggregateTopN$clone()

The objects of this class are cloneable with this method.

Usage

AggregateTopN$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

istar <- prolfqua::sim_lfq_data_peptide_config()
#> `protein_Id`: columns `proteinID`, `idtype2` united with separator '~'.
#> creating sampleName from file_name column
#> setup_analysis: dropped 6 unconfigured columns: average_prot_abundance, sd, mean, N, avg_peptide_abd, Replicate.
#> setup_analysis: added 36 rows with NA response for feature and sample combinations absent from the input.
data <- istar$data |> dplyr::filter(protein_Id %in% sample(protein_Id, 100))
lfqdata <- LFQData$new(data, istar$config)

agg <- AggregateTopN$new(lfqdata, "protein", N = 3, func = "sum")
agg$aggregate()
#> Columns added : srm_meanInt srm_meanIntRank
p <- agg$plot()
p$plots[[1]]


agg_mean <- AggregateTopN$new(lfqdata, "protein", N = 3, func = "mean")
agg_mean$aggregate()
#> Columns added : srm_meanInt srm_meanIntRank
protPlotter <- agg_mean$lfq_agg$get_Plotter()
protPlotter$heatmap()

agg_mean$write_plots(tempdir())
#> Warning: Removed 1 row containing missing values or values outside the scale range
#> (`geom_line()`).
#> Warning: Removed 2 rows containing missing values or values outside the scale range
#> (`geom_point()`).
#> Warning: Removed 1 row containing missing values or values outside the scale range
#> (`geom_point()`).
#> Warning: Removed 1 row containing missing values or values outside the scale range
#> (`geom_line()`).
#> Warning: Removed 1 row containing missing values or values outside the scale range
#> (`geom_point()`).