Skip to contents

AggregateMedpolish

AggregateMedpolish

Details

Aggregates peptide intensities to protein level using median polish. Works best with variance-stabilized (log-transformed) intensities.

Public fields

lfq

LFQData

lfq_agg

aggregation result

prefix

to use for aggregation results e.g. protein

Methods


Method new()

initialize

Usage

AggregateMedpolish$new(lfq, prefix = "protein")

Arguments

lfq

LFQData

prefix

default protein


Method aggregate()

run median polish aggregation

Usage

AggregateMedpolish$aggregate()

Returns

LFQData


Method plot()

creates aggregation plots

Usage

AggregateMedpolish$plot(subset = NULL, show.legend = FALSE)

Arguments

subset

create plots for a subset of the data only

show.legend

default FALSE

Returns

data.frame


Method write_plots()

writes plots to folder

Usage

AggregateMedpolish$write_plots(
  qcpath,
  subset = NULL,
  show.legend = FALSE,
  width = 6,
  height = 6
)

Arguments

qcpath

qcpath

subset

write plots only for some

show.legend

legend

width

figure width

height

figure height

Returns

file path


Method clone()

The objects of this class are cloneable with this method.

Usage

AggregateMedpolish$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

istar <- prolfqua::sim_lfq_data_peptide_config()
#> creating sampleName from fileName column
#> completing cases
#> completing cases done
#> setup done
data <- istar$data |> dplyr::filter(protein_Id %in% sample(protein_Id, 100))
lfqdata <- LFQData$new(data, istar$config)
lfqTrans <- lfqdata$clone()$get_Transformer()$log2()$robscale()$lfq
#> Column added : log2_abundance
#> data is : TRUE
#> Joining with `by = join_by(sampleName, isotopeLabel, protein_Id, peptide_Id)`

agg <- AggregateMedpolish$new(lfqTrans, "protein")
agg$aggregate()
#> starting aggregation
p <- agg$plot()
p$plots[[1]]
#> Warning: Removed 7 rows containing missing values or values outside the scale range
#> (`geom_point()`).
#> Warning: Removed 4 rows containing missing values or values outside the scale range
#> (`geom_line()`).