Load TCR or BCR sequencing data from 10x Genomics Cell Ranger VDJ output. Automatically detects file format (AIRR standard or contig_annotations.csv) and converts to MiAIRR-compliant format for use with LymphoSeq2.
Value
A tibble with MiAIRR-formatted columns including:
cell_id: Cell barcode identifierrepertoire_id: Sample name (from filename)junction,junction_aa: CDR3 nucleotide and amino acid sequencesv_call,d_call,j_call: V(D)J gene assignmentsduplicate_count: UMI count for the sequenceproductive: Whether the sequence is in-frame and functional
Details
Supported file formats: AIRR format (_airr.tsv) - Standard AIRR rearrangement TSV from Cell Ranger. Contig annotations (_contig_annotations.csv) - Legacy Cell Ranger CSV format. Legacy 10x - Older TSV formats (automatically detected and converted).
Usage with single-cell data: After importing, use merge_chains() to pair alpha/beta chains from the same cell. For example: sc_data <- read10x("path/to/10x_output/") followed by paired <- merge_chains(sc_data, mode = "strict").
File naming: The repertoire_id is extracted from the filename. For example, Sample1_airr.tsv becomes repertoire_id = "Sample1".
