Description Usage Arguments Details Value Default equalization Examples
View source: R/ContigCellDB-methods.R
The cells in cell_tbl
, and clusters in cluster_tbl
can potentially be a superset of the contig_tbl
.
1 |
x |
|
cell |
|
contig |
|
cluster |
|
sort |
|
equalize_ccdb(x, cell = TRUE)
trims cells that aren't in contig_tbl
or cluster_tbl
.
equalize_ccdb(x, cluster = TRUE)
trims clusters that aren't in contig_tbl
.
equalize_ccdb(x, contig = TRUE)
trims contigs that aren't cell_tbl
or cluster_tbl
.
ContigCellDB()
Modification to contig_tbl
(with $
) always equalizes contigs and clusters.
Modification to cell_tbl
equalizes only contigs.
Modification to cluster_tbl
equalizes contigs and clusters.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | library(dplyr)
tbl = tibble(clust_idx = gl(3, 2), cell_idx = rep(1:3, times = 2), contig_idx = 1:6)
ccdb = ContigCellDB(tbl, contig_pk = c('cell_idx', 'contig_idx'),
cell_pk = 'cell_idx', cluster_pk = 'clust_idx')
# 3 cells
ccdb
ccdb$cell_tbl = bind_rows(ccdb$cell_tbl, tibble(cell_idx = 0))
# 4 cells now
ccdb
# 3 cells again
equalize_ccdb(ccdb)
# remove all contigs from cell 1, and one contig from cell 2
ccdb$contig_tbl = ccdb$contig_tbl[-c(1, 2, 4),]
# no changes to cell_tbl yet
ccdb
# trim cell_tbl to 2 cells, keep all clusters
equalize_ccdb(ccdb, cluster = FALSE)
# trim both cells and clusters
equalize_ccdb(ccdb, cluster = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.