cluster_test_by {CellaRepertorium} | R Documentation |
Typically one will want to stratify by chain by calling cluster_test_by
, as this will calculate the number of cell "trials" separately depending on the chain recovered.
cluster_test_by(ccdb, fields = "chain", tbl = "cluster_tbl", ...) cluster_logistic_test( formula, ccdb, filterset = cluster_filterset(), contig_filter_args = TRUE, tie_break_keys = c("umis", "reads"), add_cluster_tbl = FALSE, keep_fit = FALSE, fitter = glm_glmer, silent = FALSE )
ccdb |
|
fields |
|
tbl |
one of |
... |
passed to |
formula |
the right-hand side of a glmer or glm-style formula. |
filterset |
a call to |
contig_filter_args |
an expression passed to |
tie_break_keys |
(optional) |
add_cluster_tbl |
|
keep_fit |
|
fitter |
a function taking arguments |
silent |
|
table with one row per cluster/term.
cluster_test_by
: split ccdb
and conduct tests within strata
library(dplyr) data(ccdb_ex) ccdb_ex = cluster_germline(ccdb_ex) trav1 = filter(ccdb_ex$cluster_tbl, v_gene == 'TRAV1') cluster_logistic_test(~pop + (1|sample), ccdb_ex, filterset = cluster_filterset(white_list= trav1)) # Fixed effect analysis of each cluster, by chain prev4 = ccdb_ex$contig_tbl %>% group_by(cluster_idx) %>% summarize(n()) %>% filter(`n()`>= 4) cluster_test_by(ccdb = ccdb_ex, fields = 'chain', tbl = 'cluster_tbl', formula = ~ pop, filterset = cluster_filterset(white_list= prev4))