iqbal-lab / Mykrobe-predictor

Antibiotic resistance predictions in minutes on a laptop
Other
50 stars 19 forks source link

IndexError: list index out of range exception on Linux but not Mac #126

Closed harrismia closed 5 years ago

harrismia commented 7 years ago

Hello,

    I am getting the error message:   IndexError: list index out of range when I try to run mykrobe predict on our linux environment.   When I run it on my Mac Book Pro it works fine.  The error message is below: 

    Any ideas about why this is happening?   Thanks in advance!

mykrobe predict SRR5486866 tb --seq ./SRR5486866_1.fastq.gz INFO:root:Running AMR prediction with panels data/panels/tb-species-170421.fasta.gz, data/panels/tb-walker-probe-set-feb-09-2017.fasta.gz Traceback (most recent call last): File "/sysapps/cluster/software/Anaconda/2.3.0Linux-x86_64/envs/mykrobeenv2/bin/mykrobe", line 11, in sys.exit(main()) File "/sysapps/cluster/software/Anaconda/2.3.0Linux-x86_64/envs/mykrobeenv2/lib/python2.7/site-packages/mykrobe/mykrobe_predictor.py", line 125, in main args.func(parser, args) File "/sysapps/cluster/software/Anaconda/2.3.0Linux-x86_64/envs/mykrobeenv2/lib/python2.7/site-packages/mykrobe/mykrobe_predictor.py", line 34, in run_subtool run(parser, args) File "/sysapps/cluster/software/Anaconda/2.3.0Linux-x86_64/envs/mykrobeenv2/lib/python2.7/site-packages/mykrobe/cmds/amr.py", line 134, in run cp.run() File "/sysapps/cluster/software/Anaconda/2.3.0Linux-x86_64/envs/mykrobeenv2/lib/python2.7/site-packages/mykatlas/typing/typer/genotyper.py", line 74, in run self._parse_covgs() File "/sysapps/cluster/software/Anaconda/2.3.0Linux-x86_64/envs/mykrobeenv2/lib/python2.7/site-packages/mykatlas/typing/typer/genotyper.py", line 128, in _parse_covgs row) File "/sysapps/cluster/software/Anaconda/2.3.0Linux-x86_64/envs/mykrobeenv2/lib/python2.7/site-packages/mykatlas/typing/typer/genotyper.py", line 118, in _parse_summary_covgs_row return row[0], int(row[2]), int(row[3]), 100 * float(row[4]), int(row[5]) IndexError: list index out of range

iqbal-lab commented 7 years ago

What precise version of predictor are you using - did you get it from github? Do you have a commit number? How did you install , and has it worked for you before?

harrismia commented 7 years ago

Hi,

We did get if from github. For the linux version: typing mykrobe --version gives : mykrobe v0.5.6-0-gbd7923a-dirty

The same command on my Mac Book Pro gives: mykrobe v0.5.1-0-g04fef92 I see that they are different. I have been using the version on my Mac Book but we have never tried using it on our linux cluster before.

I didn't do the install on the linux cluster so I will find out the details and respond. Thanks,
Michael

Phelimb commented 7 years ago

@harrismia Could you upload the output of pip freeze when run within your virtualenv ? This looks like the version of mykatlas is incompatible with the version of mykrobe.

Phelimb commented 7 years ago

It looks like the local install of mccortex seems to fail with anaconda venvs. You might need to reinstall mccortex.

    git clone --recursive https://github.com/iqbal-lab/Mykrobe-predictor.git
    cd Mykrobe-predictor
    cd mccortex
    make    
    export PATH=$(pwd)/bin:$PATH
    cd ..

The version should read:

mccortex31 --version 
mccortex=v0.0.3-482-g22410ea
harrismia commented 7 years ago

Dear Mykrobe-predictor support team:

I have recompiled mccortex31 and copied the executable under mykrobe’s bin folder. Sadly, “mykrobe predict” still fails. I wonder if “mykatlas==0.6.1” is an incorrect version. Will wait for comments from Phelim Bradley (please forward his reply to me). Thanks!

» mccortex31 --version Error: Unrecognised command: --version usage: mccortex31 [options] version: mccortex=v0.0.3-482-g22410ea zlib=1.2.8 htslib=1.2.1-250-gfa6ed9a ASSERTS=ON hash=Lookup3 CHECKS=ON k=3..31

Commands: breakpoints use a trusted assembled genome to call large events bubbles find bubbles in graph which are potential variants build construct cortex graph from FASTA/FASTQ/BAM calls2vcf convert bubble/breakpoint calls to VCF check load and check graph (.ctx) and path (.ctp) files clean clean errors from a graph contigs assemble contigs for a sample correct error correct reads coverage print contig coverage dist make colour kmer distance matrix index index a sorted cortex graph file inferedges infer graph edges between kmers before calling thread join combine graphs, filter graph intersections links clean and plot link files (.ctp) pjoin merge path files (.ctp) popbubbles pop bubbles in the population graph pview text view of a cortex path file (.ctp) reads filter reads against a graph rmsubstr reduce set of strings to remove substrings server interactively query the graph sort sort the kmers in a graph file subgraph filter a subgraph using seed kmers thread thread reads through cleaned graph to make links uniqkmers generate random unique kmers unitigs pull out unitigs in FASTA, DOT or GFA format vcfcov coverage of a VCF against cortex graphs vcfgeno genotype a VCF after running vcfcov view text view of a cortex graph file (.ctx)

Type a command with no arguments to see help.

Common Options: -h, --help Help message -q, --quiet Silence status output normally printed to STDERR -f, --force Overwrite output files if they already exist -m, --memory Memory e.g. 1GB [default: 1GB] -n, --nkmers Hash entries [default: 4M, ~4 million] -t, --threads Limit on proccessing threads [default: 2] -o, --out Output file -p, --paths Links file to load (can specify multiple times)

(mykrobeenv) appbuild@ai-submit1» module show mykrobe

/sysapps/cluster/modules/all/mykrobe/0.5.6-Python-3.5:

module-whatis Description: Mykrobe Predictor analyses the whole genome of a bacterial sample, all within a couple of minutes, and predicts which drugs the infection is resistant to. - Homepage: https://github.com/iqbal-lab/Mykrobe-predictor conflict mykrobe prepend-path CPATH /sysapps/cluster/software/Anaconda/2.3.0Linux-x86_64/envs/mykrobeenv/include prepend-path LD_LIBRARY_PATH /sysapps/cluster/software/Anaconda/2.3.0Linux-x86_64/envs/mykrobeenv/lib prepend-path LIBRARY_PATH /sysapps/cluster/software/Anaconda/2.3.0Linux-x86_64/envs/mykrobeenv/lib prepend-path MANPATH /sysapps/cluster/software/Anaconda/2.3.0Linux-x86_64/envs/mykrobeenv/share/man prepend-path PATH /sysapps/cluster/software/Anaconda/2.3.0Linux-x86_64/envs/mykrobeenv/bin prepend-path PKG_CONFIG_PATH /sysapps/cluster/software/Anaconda/2.3.0Linux-x86_64/envs/mykrobeenv/lib/pkgconfig setenv EBROOTGEMINI /sysapps/cluster/software/Anaconda/2.3.0Linux-x86_64/envs/mykrobeenv setenv EBVERSIONGEMINI 0.5.6 prepend-path PATH /sysapps/cluster/software/Anaconda/2.3.0Linux-x86_64/envs/mykrobeenv

(mykrobeenv) appbuild@ai-submit1» ls /sysapps/cluster/software/Anaconda/2.3.0Linux-x86_64/envs/mykrobeenv/bin 2to3 easy_install mykrobe pydoc3.5 python3-config vcf_melt 2to3-3.5 easy_install-3.5 openssl python pyvenv vcf_sample_filter.py activate f2py pasteurize python3 pyvenv-3.5 wheel atlas futurize pip python3.5 sqlite3 wish8.5 conda idle3 pycache python3.5-config tclsh8.5 xz c_rehash idle3.5 pydoc python3.5m unxz deactivate mccortex31 pydoc3 python3.5m-config vcf_filter.py

(mykrobeenv) appbuild@ai-submit1» which mccortex31 ~/eb_files/Mykrobe-predictor/Mykrobe-predictor/mccortex/bin/mccortex31

(mykrobeenv) appbuild@ai-submit1» cp ~/eb_files/Mykrobe-predictor/Mykrobe-predictor/mccortex/bin/mccortex31 /sysapps/cluster/software/Anaconda/2.3.0Linux-x86_64/envs/mykrobeenv/bin/.

(mykrobeenv) appbuild@ai-submit1» mykrobe predict SRR5486866 tb --seq /hpcdata/bcbb/tbportal/genomics/SequencingCenterDownloads/Borstel/Romania_50samples/TBprofiler/SRR5486866_1.fastq.gz INFO:root:Running AMR prediction with panels data/panels/tb-species-170421.fasta.gz, data/panels/tb-walker-probe-set-feb-09-2017.fasta.gz Traceback (most recent call last): File "/sysapps/cluster/software/Anaconda/2.3.0Linux-x86_64/envs/mykrobeenv/bin/mykrobe", line 11, in sys.exit(main()) File "/sysapps/cluster/software/Anaconda/2.3.0Linux-x86_64/envs/mykrobeenv/lib/python3.5/site-packages/mykrobe/mykrobe_predictor.py", line 125, in main args.func(parser, args) File "/sysapps/cluster/software/Anaconda/2.3.0Linux-x86_64/envs/mykrobeenv/lib/python3.5/site-packages/mykrobe/mykrobe_predictor.py", line 34, in run_subtool run(parser, args) File "/sysapps/cluster/software/Anaconda/2.3.0Linux-x86_64/envs/mykrobeenv/lib/python3.5/site-packages/mykrobe/cmds/amr.py", line 134, in run cp.run() File "/sysapps/cluster/software/Anaconda/2.3.0Linux-x86_64/envs/mykrobeenv/lib/python3.5/site-packages/mykatlas/typing/typer/genotyper.py", line 74, in run self._parse_covgs() File "/sysapps/cluster/software/Anaconda/2.3.0Linux-x86_64/envs/mykrobeenv/lib/python3.5/site-packages/mykatlas/typing/typer/genotyper.py", line 128, in _parse_covgs row) File "/sysapps/cluster/software/Anaconda/2.3.0Linux-x86_64/envs/mykrobeenv/lib/python3.5/site-packages/mykatlas/typing/typer/genotyper.py", line 118, in _parse_summary_covgs_row return row[0], int(row[2]), int(row[3]), 100 * float(row[4]), int(row[5]) IndexError: list index out of range

Reply:

It looks like the local install of mccortex seems to fail with anaconda venvs. You might need to reinstall mccortex.

    git clone --recursive https://github.com/iqbal-lab/Mykrobe-predictor.git

    cd Mykrobe-predictor

    cd mccortex

    make

    export PATH=$(pwd)/bin:$PATH

    cd ..

The version should read:

mccortex31 --version

mccortex=v0.0.3-482-g22410ea

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/iqbal-lab/Mykrobe-predictor/issues/126#issuecomment-317187026, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AcVozLGHuFIfOMK3INe7k7WJ-d4JBvbWks5sQgaqgaJpZM4OdKvy.

iqbal-lab commented 7 years ago

I'm just going on holiday, so will ping @Phelimb

noporpoise commented 7 years ago

Looks like Mykrobe-predictor should be using the McCortex vcfgeno command instead of geno.

Phelimb commented 7 years ago

So, I have a branch of mccortex where geno is a valid command that should work with Mykrobe predictor.

https://github.com/phelimb/mccortex/tree/genotype

I'm not 100% sure what's causing this error but it seems to be a version clash between mccortex, or mykaltlas.

You have the correct mykatlas but the mccortex version should be v0.0.3-481-gbbe4edf-dirty

Which you can get manually by running

git clone -b genotype https://github.com/phelimb/mccortex

joshualoving commented 7 years ago

When I compile https://github.com/phelimb/mccortex/tree/genotype, I get the same version number mccortex=v0.0.3-482-g22410ea, not v0.0.3-481-gbbe4edf-dirty