Validates TCR chain columns (TRA_1, TRA_2, TRB_1, TRB_2) by:
Checking V-CDR3-J format validity
Reordering chains into the canonical V_CDR3_J format,
Removing duplicate alleles (where allele 1 equals allele 2)
Swapping alleles when allele 2 is defined but allele 1 is missing.
Arguments
- TCR_data
A data frame with columns TRA_1, TRA_2, TRB_1, TRB_2 containing TCR chain identifiers in V_CDR3_J format.
- remove_invalid_VDJ
Logical. If
TRUE, set invalid VDJ sequences (those with missing V, CDR3, or J components) toNA. IfFALSE, keep them as-is and flag them.- verbose
Logical. If
TRUE, print progress messages.