equalize_ccdb: Take the intersection of keys in tables in 'x'

Description Usage Arguments Details Value Default equalization Examples

View source: R/ContigCellDB-methods.R

Description

The cells in cell_tbl, and clusters in cluster_tbl can potentially be a superset of the contig_tbl.

Usage

1
equalize_ccdb(x, cell = TRUE, contig = TRUE, cluster = TRUE, sort = FALSE)

Arguments

x

ContigCellDB()

cell

logical equalize cells

contig

logical equalize contigs

cluster

logical equalize clusters

sort

logical should equalized fields also be order()ed by their primary keys?

Details

Value

ContigCellDB()

Default equalization

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.

Examples

 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)

CellaRepertorium documentation built on Nov. 8, 2020, 7:48 p.m.