generate_pseudobulk {CellaRepertorium} | R Documentation

## Generate "pseudobulk" data from a `ContigCellDB`

### Description

Tabulate contigs with a unique combination of `class_keys` per `total_keys`. For instance, `total_keys` might be a sample identifier, and `class_keys` might be the V- and J- gene identities. The idea is that this might mimic the data generated in a bulk experiment.

### Usage

    generate_pseudobulk(ccdb, class_keys, total_keys, type = c("cell", "umi"))

### Arguments

`ccdb` | `ContigCellDB()`
`class_keys` | `character` naming fields in `contig_tbl` that define unique classes of the repertoire
`total_keys` | `character` naming fields to be conditioned upon when calculating the total.
`type` | one of "cell" or "umi"

### Details

This function is currently rather 10x-specific, in that it is assumed that columns `barcode` and `umis` exist.

### Value

`tibble`

### Examples

    data(ccdb_ex)
    ccdb_ex = cluster_germline(ccdb_ex)
    pseudo = generate_pseudobulk(ccdb_ex, c('v_gene', 'j_gene', 'chain'), c('pop', 'sample'))

[Package CellaRepertorium version 1.2.0 Index]