Count the number of pairs called by each algorithm
get_pair_stats.Rd
This function tabulates the number of TCR pairs called for each sample by the MAD-HYPE
algorithm, the T-SHELL algorithm, or both. It is used in the
plot_paired() function.
Details
The function can count the number of alpha chains paired, or beta chains, or the number of pairs overall. By default, it counts the number of pairs overall.
Examples
folder = system.file("extdata/SJTRC_TIRTL_seq_longitudinal", package = "TIRTLtools")
ts_data = load_tirtlseq(folder, meta_columns = c("marker", "timepoint", "version"), sep = "_", verbose = FALSE)
get_pair_stats(ts_data)
#> Calculating pairing stats for sample 1
#> Calculating pairing stats for sample 2
#> Calculating pairing stats for sample 3
#> Calculating pairing stats for sample 4
#> Calculating pairing stats for sample 5
#> Calculating pairing stats for sample 6
#> # A tibble: 66 × 8
#> category Freq chain sample_id marker timepoint version label
#> <fct> <int> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 MAD-HYPE only 25327 paired cd4_tp1_v2 cd4 tp1 v2 marker: cd4…
#> 2 T-SHELL only 2498 paired cd4_tp1_v2 cd4 tp1 v2 marker: cd4…
#> 3 both 20003 paired cd4_tp1_v2 cd4 tp1 v2 marker: cd4…
#> 4 MAD-HYPE only 14343 alpha cd4_tp1_v2 cd4 tp1 v2 marker: cd4…
#> 5 T-SHELL only 1991 alpha cd4_tp1_v2 cd4 tp1 v2 marker: cd4…
#> 6 both 19137 alpha cd4_tp1_v2 cd4 tp1 v2 marker: cd4…
#> 7 neither 1936905 alpha cd4_tp1_v2 cd4 tp1 v2 marker: cd4…
#> 8 MAD-HYPE only 11058 beta cd4_tp1_v2 cd4 tp1 v2 marker: cd4…
#> 9 T-SHELL only 1633 beta cd4_tp1_v2 cd4 tp1 v2 marker: cd4…
#> 10 both 16254 beta cd4_tp1_v2 cd4 tp1 v2 marker: cd4…
#> # ℹ 56 more rows