Skip to contents

Computes per-group statistics of the abundances and, from them, the limit of detection (LOD) used by build_model_impute to impute groups without observations.

Value

An R6 class generator.

Public fields

data

data

config

config

prob

quantile of groups with one observed value to estimate LOD

stats

data.frame with group statistics

Methods


MissingHelpers$new()

initialize

Usage

MissingHelpers$new(data, config, prob = 0.5)

Arguments

data

data

config

config

prob

default 0.5, median of groups with one observed value


MissingHelpers$get_stats()

get data.frame with statistics

Usage

MissingHelpers$get_stats()

Returns

data.frame


MissingHelpers$get_lod()

determine limit of detection computes quantile of abundances in groups with a single observation; without such groups, of the partly observed groups with the fewest observations, and when every group is complete or empty, the lowest group mean

Usage

MissingHelpers$get_lod()

Returns

numeric LOD


MissingHelpers$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

dd <- prolfqua::sim_lfq_data_protein_config(Nprot = 100,weight_missing = 2)
#> creating sampleName from file_name column
#> completing cases
#> completing cases done
#> setup done
mh <- prolfqua::MissingHelpers$new(dd$data, dd$config, prob = 0.8)
xx <- mh$get_stats()
xx <- mh$get_lod()

dd <- prolfqua::sim_lfq_data_2factor_config(Nprot = 100,weight_missing = 0.1)
#> creating sampleName from file_name column
#> completing cases
#> completing cases done
#> setup done
mh <- prolfqua::MissingHelpers$new(dd$data, dd$config, prob = 0.8)
mh$get_stats()$interaction |> table()
#> 
#> TreatmentA:BackgroundX TreatmentB:BackgroundX TreatmentA:BackgroundZ 
#>                    100                    100                    100 
#> TreatmentB:BackgroundZ             TreatmentA             TreatmentB 
#>                    100                    100                    100 
#>            BackgroundX            BackgroundZ 
#>                    100                    100 
mh$get_lod()
#> [1] 15.24351