treangenlab / Olivar

Olivar: towards automated variant aware primer design for multiplex tiled amplicon sequencing of pathogens
https://doi.org/10.1038/s41467-024-49957-9
GNU General Public License v3.0
19 stars 2 forks source link

The --*-prefix flags cause issues #3

Closed ammaraziz closed 8 months ago

ammaraziz commented 11 months ago

Hi,

Olivar is a great tool, thanks for creating and maintaining it. I'm using it to design primers for Hep A. This is the command I am running:

olivar tiling \
output/4.olivar_reference/olivar-ref.olvr \
-o output/5.olivar_primers \
--max-amp-len 1200 \
--min-amp-len 1000 \
--seed 1995 \
--fp-prefix HAVSeq \
--rp-prefix HAVSeq \
--check-var

It produces this error:

Successfully loaded reference file output/4.olivar_reference/olivar-ref.olvr
reference sequence length: 7478
design region: 16:7463
region length: 7448
number of PDR sets to be tested: 3115
Designing PDRs...
100%|>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>| 3115/3115 [01:19<00:00, 38.98it/s]
Finished in 79.921s
Best total risk: 1151.410
total amplicons: 10
covered region: 90:7217
coverage of reference sequence: 95.320%
Generating primer candidates...
  0%|                                                                                                                                                                  | 0/10 [00:00<?, ?it/s]ta
Traceback (most recent call last):
  File "micromamba/bin/olivar", line 156, in <module>
    tiling(
  File "micromamba/lib/python3.10/site-packages/olivar/main.py", line 793, in tiling
    all_plex_info_primer = get_primer(all_plex_info, config)
  File "micromamba/lib/python3.10/site-packages/olivar/main.py", line 436, in get_primer
    fP, fail = fP_generator.get(fP_design, fP_prefix, check_BLAST=check_BLAST, **fP_setting)
  File "micromamba/lib/python3.10/site-packages/olivar/design.py", line 226, in get
    primer_arr.append(basic.seq2arr(s))
  File "micromamba/lib/python3.10/site-packages/olivar/basic.py", line 76, in seq2arr
    seq_list = [dic[s] for s in list(seq_str)]
  File "micromamba/lib/python3.10/site-packages/olivar/basic.py", line 76, in <listcomp>
    seq_list = [dic[s] for s in list(seq_str)]
KeyError: 'H'

I modified the function seq2arr causing the error to print the output seq_str , this was the print out:

ct
gc
gg
ag
ta
ct
cc
gc
tg
tt
tt
gt
cg
cc
gc
cg
HAVSeqcgccgtttgcctaggcta

Note the last sequence has HAVSeq inserted. Removing the prefix flags solves the issue. It seems that somehow the primer names are being inserted into the sequence operation. I have tested the following:

I am running on Linux Mint 21, with micromamba installing Olivar version 1.1.1. Also tested with the latest version 1.1.2, same issue.

Not a huge deal as the Olivar still runs, just need to manually rename the outputs.

mxwang66 commented 8 months ago

Hi,

Thanks for using Olivar! The --fp-prefix or --rp-prefix argument is for adding universal sequence to the 5' end of your primer. For your case you should provide HAVSeq to -t or --title