Generate a legible name for a series of contigs

fancy_name_contigs(contig_tbl, prefix)

Arguments

contig_tbl

An all_contig_annotations.csv file, output from VDJ Cell ranger. Importantly, this should contain columns chain, v_gene, d_gene, j_gene

prefix

an optional prefix added to each contig, eg, possibly a sample id.

Value

character

Examples

library(dplyr)
contig_anno_path = system.file('extdata', 'all_contig_annotations_balbc_1.csv.xz',
    package = 'CellaRepertorium')
contig_anno = readr::read_csv(contig_anno_path)
#> Rows: 617 Columns: 18
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> chr (12): barcode, contig_id, chain, v_gene, d_gene, j_gene, c_gene, product...
#> dbl  (3): length, reads, umis
#> lgl  (3): is_cell, high_confidence, full_length
#> 
#>  Use `spec()` to retrieve the full column specification for this data.
#>  Specify the column types or set `show_col_types = FALSE` to quiet this message.
contig_anno = contig_anno %>% mutate(fancy_name =
    fancy_name_contigs(., prefix = 'b6_1'))
stopifnot(!any(duplicated(contig_anno$fancy_name)))