R/LFQDataAggregator.R
LFQDataAggregator.Rd
Decorates LFQData with methods to aggregate protein intensities aggregates intensities
Decorates LFQData with methods to aggregate protein intensities aggregates intensities
Other LFQData:
LFQData
,
LFQDataPlotter
,
LFQDataStats
,
LFQDataSummariser
,
LFQDataToSummarizedExperiment()
,
LFQDataWriter
lfq
LFQData
lfq_agg
aggregation result
prefix
to use for aggregation results e.g. protein
medpolish()
aggregate using median polish
plot()
creates aggreation plots
istar <- prolfqua::sim_lfq_data_peptide_config()
#> creating sampleName from fileName column
#> Warning: no nr_children column specified in the data, adding column nr_children and setting to 1.
#> completing cases
istar$config <- istar$config
data <- istar$data |> dplyr::filter(protein_Id %in% sample(protein_Id, 100))
lfqdata <- LFQData$new(data, istar$config)
lfqTrans <- lfqdata$clone()$get_Transformer()
lfqTrans$log2()
#> Column added : log2_abundance
lfqTrans <- lfqTrans$robscale()$lfq
#> data is : TRUE
#> Warning: Expected 2 pieces. Additional pieces discarded in 336 rows [1, 2, 3, 4, 5, 6,
#> 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, ...].
#> Joining with `by = join_by(sampleName, protein_Id, peptide_Id)`
lfqAggregator <- LFQDataAggregator$new(lfqTrans, "protein")
lfqAggregator$medpolish()
#> starting aggregation
pmed <- lfqAggregator$plot()
pmed$plots[[1]]
#> Warning: Removed 7 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_line()`).
lfqAggregator$lmrob()
#> starting aggregation
prob <- lfqAggregator$plot()
prob$plots[[1]]
#> Warning: Removed 7 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_line()`).
lfqCopy <- lfqdata$clone()
lfqCopy$is_transformed()
#> [1] FALSE
lfqAggregator <- LFQDataAggregator$new(lfqCopy, "protein")
lfqAggregator$sum_topN()
#> Joining with `by = join_by(protein_Id, peptide_Id)`
#> Columns added : srm_meanInt srm_meanIntRank
pSum <- lfqAggregator$plot()
pSum$plots[[1]]
#> Warning: Removed 7 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_line()`).
lfqAggregator$mean_topN()
#> Joining with `by = join_by(protein_Id, peptide_Id)`
#> Columns added : srm_meanInt srm_meanIntRank
pMean <- lfqAggregator$plot()
pMean$plots[[1]]
#> Warning: Removed 7 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_line()`).
protPlotter <- lfqAggregator$lfq_agg$get_Plotter()
protPlotter$heatmap()
if (FALSE) {
lfqAggregator$write_plots(tempdir())
}