MissingHelpers: compute group mean by LOD

MissingHelpersR Documentation

compute group mean by LOD

Description

compute group mean by LOD

compute group mean by LOD

Details

weight lod by nr of NA's $(LOD * nrNas + meanAbundance *nrObs)/(nrMeasured)$

Public fields

data

data

config

config

prob

quantile of groups with one observed value to estimate LOD

stats

data.frame with group statistics

weighted

should we weight the LOD

Methods

Public methods


Method new()

initialize

Usage
MissingHelpers$new(data, config, prob = 0.5, weighted = TRUE)
Arguments
data

data

config

config

prob

default 0.5, median of groups with one observed value

weighted

should group average be computed used weighting, default TRUE.


Method get_stats()

get data.frame with statistics

Usage
MissingHelpers$get_stats()
Returns

data.frame


Method get_LOD()

determine limit of detection computes quantile of abundances in groups with a single observation

Usage
MissingHelpers$get_LOD()
Returns

integer LOD


Method impute_weighted_lod()

compute group averages using weighted lod

Usage
MissingHelpers$impute_weighted_lod()

Method impute_lod()

if group average absent substitute with LOD

Usage
MissingHelpers$impute_lod()

Method get_poolvar()

compute pooled var per protein

Usage
MissingHelpers$get_poolvar(prob = 0.75)
Arguments
prob

prob of sd from proteins where it can be computed


Method get_contrast_estimates()

get contrast estimates

Usage
MissingHelpers$get_contrast_estimates(Contrasts)
Arguments
Contrasts

named array with contrasts


Method get_contrasts()

compute contrasts

Usage
MissingHelpers$get_contrasts(Contrasts, confint = 0.95, all = FALSE)
Arguments
Contrasts

vector with contrasts

confint

compute confint

all

return all columns, default FALSE


Method clone()

The objects of this class are cloneable with this method.

Usage
MissingHelpers$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

Contrasts <- c("group.b-a" = "group_A - group_B", "group.a-ctrl" = "group_A - group_Ctrl")
dd <- prolfqua::sim_lfq_data_protein_config(Nprot = 100,weight_missing = 2)
mh <- prolfqua::MissingHelpers$new(dd$data, dd$config, prob = 0.8,weighted = TRUE)
xx <- mh$get_stats()
xx <- mh$get_LOD()
xx <- mh$impute_weighted_lod()
xx <- mh$impute_lod()
xx <- mh$get_poolvar()
bb <- mh$get_contrast_estimates(Contrasts)
mh$get_contrasts(Contrasts)

dd <- prolfqua::sim_lfq_data_2Factor_config(Nprot = 100,weight_missing = 0.1)

Contrasts <- c("c1" = "TreatmentA - TreatmentB",
               "C2" = "BackgroundX- BackgroundZ",
               "c3" = "`TreatmentA:BackgroundX` - `TreatmentA:BackgroundZ`",
               "c4" = "`TreatmentB:BackgroundX` - `TreatmentB:BackgroundZ`"
               )
mh <- prolfqua::MissingHelpers$new(dd$data, dd$config, prob = 0.8,weighted = TRUE)
mh$get_stats()$interaction |> table()
mh$get_contrast_estimates(Contrasts)


wolski/prolfqua documentation built on Sept. 7, 2024, 3:06 a.m.