Commit 1962ebe3 authored by Mathieu Giraud's avatar Mathieu Giraud

tests/ option '-A', ignore allele names in .should-vdj patterns

parent 9fe6da1a
......@@ -35,6 +35,7 @@ parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter)
parser.add_argument('--program', '-p', default=VIDJIL_FINE, help='program to launch on each file (%(default)s)')
parser.add_argument('-q', dest='program', action='store_const', const=VIDJIL_KMER, help='shortcut for -p (VIDJIL_KMER), to be used with -2')
parser.add_argument('--ignore_N', '-N', action='store_true', help='ignore N patterns, checking only gene and allele names')
parser.add_argument('--ignore_allele', '-A', action='store_true', help='ignore allele, checking only gene names')
parser.add_argument('--after-two', '-2', action='store_true', help='compare only the right part of the pattern after two underscores (locus code)')
parser.add_argument('--revcomp', '-r', action='store_true', help='duplicate the tests on reverse-complemented files')
parser.add_argument('--directory', '-d', default='../..', help='base directory where Vidjil is. This value is used by the default -p and -q values (%(default)s)')
......@@ -120,7 +121,12 @@ def should_pattern_to_regex(p):
# Some 'genes', such as KDE, do not have allele information
term += '([*]\d*)?'
term = term.replace('*', '[*]')
gene, allele = term.split('*')
if args.ignore_allele:
allele = '\d*'
term = gene + '[*]' + allele
r += [term]
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