Commit 0c421aa4 authored by Mikaël Salson's avatar Mikaël Salson

should-vdj-to-tap.py: Wildcard must be at both places

Follows dbd61c55. Contrarily to the else case where the joker can
indifferently be placed before or after a term, it is not
the same when the term is a paranthesis expression.
Thus we need a joker both before and after to make sure we don't miss a case.
parent 419bdf94
Pipeline #86323 passed with stages
in 38 minutes and 7 seconds
......@@ -168,7 +168,7 @@ def should_pattern_to_regex(p):
if len(r) > 1 and r[1][0] == '|':
# We have an alternative
regex_pattern = '.*('+''.join(r)+')'
regex_pattern = '.*('+''.join(r)+').*'
else:
regex_pattern = '.*'.join(r)
......@@ -259,6 +259,22 @@ def should_result_to_tap(should_pattern, result, tap_id):
>>> other = 'TRAV1-1*01 1/ACG/3 TRAJ1*01'
>>> srtt_ok(should, other)
True
>>> should = '(IGKV1D-37, IGKV1-37) IGKJ5'
>>> curated = 'IGKV1D-37*01 2/ATA/0 IGKJ5*01'
>>> srtt_ok(should, curated)
True
>>> should = 'IGKV1D-37 IGKJ5'
>>> curated = 'IGKV1D-37*01 2/ATA/0 IGKJ5*01'
>>> srtt_ok(should, curated)
True
# Negative tests matter too
>>> should = '(IGKV1D-37, IGKV1-37) IGKJ5'
>>> curated = 'IGKV1D-32*01 2/ATA/0 IGKJ5*01'
>>> srtt_ok(should, curated)
False
'''
m_locus = r_locus.search(should_pattern)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment