phac-nml / sistr_cmd

SISTR (Salmonella In Silico Typing Resource) command-line tool
Apache License 2.0
24 stars 9 forks source link

error:string index out of range #21

Closed chen1i6c04 closed 6 years ago

chen1i6c04 commented 6 years ago

Hello,

I use SISTR in local and run your example usage I get the following error messages:

Traceback (most recent call last):
  File "/usr/local/bin/sistr", line 11, in <module>
    load_entry_point('sistr-cmd==1.0.2', 'console_scripts', 'sistr')()
  File "/usr/local/lib/python3.5/dist-packages/sistr/sistr_cmd.py", line 324, in main
    outputs = [sistr_predict(input_fasta, genome_name, tmp_dir, keep_tmp, args) for input_fasta, genome_name in zip(input_fastas, genome_names)]
  File "/usr/local/lib/python3.5/dist-packages/sistr/sistr_cmd.py", line 324, in <listcomp>
    outputs = [sistr_predict(input_fasta, genome_name, tmp_dir, keep_tmp, args) for input_fasta, genome_name in zip(input_fastas, genome_names)]
  File "/usr/local/lib/python3.5/dist-packages/sistr/sistr_cmd.py", line 194, in sistr_predict
    cgmlst_prediction, cgmlst_results = run_cgmlst(blast_runner, full=args.use_full_cgmlst_db)
  File "/usr/local/lib/python3.5/dist-packages/sistr/src/cgmlst/__init__.py", line 342, in run_cgmlst
    full=full)
  File "/usr/local/lib/python3.5/dist-packages/sistr/src/cgmlst/__init__.py", line 134, in get_allele_sequences
    msa_ref, msa_novel = msa_ref_vs_novel(ref_seq, allele_seq)
  File "/usr/local/lib/python3.5/dist-packages/sistr/src/cgmlst/msa.py", line 58, in msa_ref_vs_novel
    msa_out_dict = msa_mafft(input_fasta)
  File "/usr/local/lib/python3.5/dist-packages/sistr/src/cgmlst/msa.py", line 41, in msa_mafft
    if stdout[0] == '>':
IndexError: string index out of range

I don't know why? Do you have any idea?

peterk87 commented 6 years ago

Hi, thanks for using sistr_cmd! I think the issue could be due to not having mafft installed.

Do you have mafft (https://mafft.cbrc.jp/alignment/software/) installed on your system and accessible in your $PATH? sistr_cmd needs mafft to do some checks when running cgMLST against your input genomes.

Hope that helps!

chen1i6c04 commented 6 years ago

The problem is indeed in mafft. sistr_cmd works now. Thanks your help.