Skip to contents

The number of distinct level_b entries, e.g. peptides, within each level_a entry, e.g. protein.

Usage

nr_B_in_A(
  pdata,
  level_a,
  level_b,
  name = paste0("nr_", paste(level_b, collapse = "_"), "_IN_", paste(level_a, collapse =
    "_"))
)

Arguments

pdata

data.frame

level_a

parent key columns

level_b

child key columns

name

name of the count column

Value

data.frame of the level_a keys and the count column

Examples

istar <- prolfqua::sim_lfq_data_peptide_config()
#> `protein_Id`: columns `proteinID`, `idtype2` united with separator '~'.
#> creating sampleName from file_name column
#> setup_analysis: dropped 6 unconfigured columns: average_prot_abundance, sd, mean, N, avg_peptide_abd, Replicate.
#> setup_analysis: added 36 rows with NA response for feature and sample combinations absent from the input.
head(prolfqua:::nr_B_in_A(istar$data, "protein_Id", "peptide_Id"))
#> # A tibble: 6 × 2
#>   protein_Id  nr_peptide_Id_IN_protein_Id
#>   <chr>                             <int>
#> 1 0EfVhX~0087                           3
#> 2 7cbcrd~5725                           1
#> 3 9VUkAq~4703                           1
#> 4 BEJI92~5282                           2
#> 5 CGzoYe~2147                           1
#> 6 DoWup2~5896                           1