rank_prevalence_ccdb {CellaRepertorium} | R Documentation

## Rank contigs, per cell, by experiment-wide prevalence of `cluster_pk`, which is added as the `prevalence` field

### Description

Rank contigs, per cell, by experiment-wide prevalence of `cluster_pk`, which is added as the `prevalence` field

### Usage

    rank_prevalence_ccdb(
      ccdb,
      contig_filter_args = TRUE,
      tie_break_keys = c("umis", "reads")
    )

    rank_chain_ccdb(
      ccdb,
      contig_filter_args = TRUE,
      tie_break_keys = c("umis", "reads"),
      chain_key = "chain",
      contig_fields = tie_break_keys,
      chain_levels = c("IGL", "IGK", "TRA", "TRB", "IGH")
    )

### Arguments

`ccdb` | `ContigCellDB()`
`contig_filter_args` | an expression passed to `dplyr::filter()`. Unlike `filter`, multiple criteria must be `&` together, rather than using commas to separate. These act on `ccdb$contig_tbl`
`tie_break_keys` | (optional) `character` naming fields in `contig_tbl` that are used sort the contig table in descending order. Used to break ties if `contig_filter_args` does not return a unique contig for each cluster
`chain_key` | `character` naming the field in `contig_tbl` to be sorted on.
`contig_fields` | Optional fields from `contig_tbl` that will be copied into the `cluster_tbl` from the canonical contig.
`chain_levels` | an optional `character` vector providing the sort order of the `chain` column in `tbl`. If set to length zero, then the the ordering will be alphabetical

### Value

`ContigCellDB` with modified `contig_tbl`

### Functions

- `rank_chain_ccdb`: return a canonical contig by chain type, with TRB/IGH returned first. By default, ties are broken by umis and reads.

### Examples

    data(ccdb_ex)
    ccdb_ex = cluster_germline(ccdb_ex)
    rank_prev = rank_prevalence_ccdb(ccdb_ex)
    rank_prev$contig_tbl
    rank_chain = rank_chain_ccdb(ccdb_ex)
    rank_chain$contig_tbl

[Package CellaRepertorium version 1.0.0 Index]