Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions changeo/Gene.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
gene_regex = re.compile(r'((IG[HLK]|TR[ABGD])([VDJ][A-R0-9]+[-/\w]*))')
family_regex = re.compile(r'((IG[HLK]|TR[ABGD])([VDJ][A-R0-9]+))')
locus_regex = re.compile(r'(IG[HLK]|TR[ABGD])')
multi_locus_tra_trd = re.compile(r'TRAV\d+(?:-\d+)?/DV\d+')

v_allele_regex = re.compile(r'((IG[HLK]|TR[ABGD])V[A-R0-9]+[-/\w]*[-\*][\.\w]+)')
d_allele_regex = re.compile(r'((IG[HLK]|TR[ABGD])D[A-R0-9]+[-/\w]*[-\*][\.\w]+)')
Expand Down Expand Up @@ -115,6 +116,12 @@ def getLocus(gene, action='first'):
str: String of the first locus call when action is 'first'.
tuple: Tuple of locus calls for 'set' or 'list' actions.
"""
if multi_locus_tra_trd.search(gene):
dual = ['TRA', 'TRD']
if action == 'first':
return 'TRA/TRD'
elif action in ('set', 'list'):
return tuple(dual)
return parseGeneCall(gene, locus_regex, action=action)


Expand Down