Mykrobe-tools/mykrobe

AttributeError of make-probes function

Owen-haha opened this issue · 2 comments

Dear developer,

I am trying to build a custom probe for tb by following the instruction on https://github.com/Mykrobe-tools/mykrobe/wiki/Custom-Panels.
The command I ran is: mykrobe variants make-probes -t myhits.ref.txt mykrobe-data/NC_000962.3.fasta > myhits.ref.fa
The only input file is attached myhits.ref.txt.

However, the attempt was failed with error messages as below.

Traceback (most recent call last):
File "/Users/Owen/miniconda3/bin/mykrobe", line 11, in
sys.exit(main())
File "/Users/Owen/miniconda3/lib/python3.8/site-packages/mykrobe/cli.py", line 8, in main
args.func(parser, args)
File "/Users/Owen/miniconda3/lib/python3.8/site-packages/mykrobe/parser.py", line 55, in run_subtool
run(parser, args)
File "/Users/Owen/miniconda3/lib/python3.8/site-packages/mykrobe/cmds/makeprobes.py", line 95, in run
mutations, lineages = load_dna_vars_txt_file(args.text_file, reference)
File "/Users/Owen/miniconda3/lib/python3.8/site-packages/mykrobe/probes/probe_generation.py", line 125, in load_dna_vars_txt_file
mutations.append(Mutation(reference=reference, var_name=var_name))
File "/Users/Owen/miniconda3/lib/python3.8/site-packages/mykrobe/probes/models.py", line 396, in init
self.ref, tmp, self.alt = split_var_name(var_name)
File "/Users/Owen/miniconda3/lib/python3.8/site-packages/mykrobe/utils.py", line 29, in split_var_name
items = re.match(r"([A-Z]+)([-0-9]+)([A-Z/]+)", name, re.I).groups()
AttributeError: 'NoneType' object has no attribute 'groups'

Can you please indicate how should I revise the input file to proceed?

Thanks,
Owen

The first column needs to literally be ref, so sed 's/NC_000962.3/ref/' myhits.ref.txt will fix it.

Many thanks! It works.