Description Usage Arguments Value See Also Examples
View source: R/pairing-methods.R
Using filtering in contig_filter_args
and sorting in tie_break_keys
and order
find a
single, canonical contig to represent each cell
Fields in contig_fields
will be copied over to the cell_tbl
.
1 2 3 4 5 6 7 8 | canonicalize_cell(
ccdb,
contig_filter_args = TRUE,
tie_break_keys = c("umis", "reads"),
contig_fields = tie_break_keys,
order = 1,
overwrite = TRUE
)
|
ccdb |
|
contig_filter_args |
an expression passed to |
tie_break_keys |
(optional) |
contig_fields |
Optional fields from |
order |
The rank order of the contig, based on |
overwrite |
|
ContigCellDB()
with some number of clusters/contigs/cells but with "canonical" values copied into cell_tbl
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # Report beta chain with highest umi-count, breaking ties with reads
data(ccdb_ex)
beta = canonicalize_cell(ccdb_ex, chain == 'TRB',
tie_break_keys = c('umis', 'reads'),
contig_fields = c('umis', 'reads', 'chain', 'v_gene', 'd_gene', 'j_gene'))
head(beta$cell_tbl)
# Stable: only adds fields to `cell_tbl`
stopifnot(dplyr::all_equal(beta$cell_tbl[ccdb_ex$cell_pk],
ccdb_ex$cell_tbl[ccdb_ex$cell_pk], ignore_row_order = TRUE))
#Report cdr3 with highest UMI count, but only when > 5 UMIs support it
umi5 = canonicalize_cell(ccdb_ex, umis > 5,
tie_break_keys = c('umis', 'reads'), contig_fields = c('umis', 'cdr3'))
stopifnot(all(umi5$cell_tbl$umis > 5, na.rm = TRUE))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.