R/tidyMS_R6_TransitionCorrelations.R
nr_obs_sample.Rd
Aggregates e.g. protein abundances from peptide abundances
nr_obs_sample(data, config, new_child = config$table$nr_children)
dd <- 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
dd$data <- na.omit(dd$data)
xd <- nr_obs_sample(dd$data, dd$config)
xd
#> # A tibble: 116 × 3
#> protein_Id sample nr_children
#> <chr> <chr> <dbl>
#> 1 0EfVhX~0087 A_V1 2
#> 2 0EfVhX~0087 A_V2 2
#> 3 0EfVhX~0087 A_V3 3
#> 4 0EfVhX~0087 A_V4 2
#> 5 0EfVhX~0087 B_V1 3
#> 6 0EfVhX~0087 B_V2 3
#> 7 0EfVhX~0087 B_V3 3
#> 8 0EfVhX~0087 B_V4 2
#> 9 0EfVhX~0087 Ctrl_V1 2
#> 10 0EfVhX~0087 Ctrl_V2 2
#> # ℹ 106 more rows
xd$nr_children |> table()
#>
#> 1 2 3 4 5 6 7
#> 52 24 11 7 5 5 12
dp <- prolfqua::sim_lfq_data_protein_config()
#> creating sampleName from fileName column
#> completing cases
xp <- nr_obs_sample(dp$data, dp$config)
xp$nr_peptides |> table()
#>
#> 1 2 3 4 6 7
#> 37 22 11 11 11 12