Map clonotypes from allele format to paired TCR format
Source:R/mapping.R
map_clonotypes_to_paired_TCR.RdMaps TCR data from individual allele format (TRA_1/TRA_2/TRB_1/TRB_2) to paired alpha/beta chain format (TRA/TRB). Useful when the reference table uses only TRA and TRB (no second allele) and you want to map allele-level data to this paired format.
Arguments
- data_to_map
A data frame with columns Sample, TRA_1, TRA_2, TRB_1, TRB_2.
- ref_table
A reference table with columns Sample, TRA, TRB, and the column specified by
col_to_map.- col_to_map
Name of the column in
ref_tableto map values from.- map_to_label
Optional data frame for additional label mapping. Row names should correspond to mapped values. Factor and non-factor columns are handled differently.