bxlab / metaWRAP

MetaWRAP - a flexible pipeline for genome-resolved metagenomic data analysis
MIT License
396 stars 190 forks source link

Kraken not generating Kronagrams #104

Open wolfgangrumpf opened 5 years ago

wolfgangrumpf commented 5 years ago

We modified our metawrap install to use --preload for Kraken (detailed elsewhere). Now, it fails to generate krona files as well as (obviously) kronograms.

drwxr-xr-x 2 rwr002 gdlauberlab 4.0K Jan 24 12:43 .
drwxr-xr-x 7 rwr002 gdlauberlab 4.0K Jan 24 12:43 ..
-rw-r--r-- 1 rwr002 gdlauberlab  21M Jan 24 12:42 final_assembly.kraken
-rw-r--r-- 1 rwr002 gdlauberlab    0 Jan 24 12:43 final_assembly.krona
-rw-r--r-- 1 rwr002 gdlauberlab 101M Jan 24 12:43 final_pure_reads.kraken

Our output from kraken looks like this:

------------------------------------------------------------------------------------------------------------------------
-----                                     subsampling down to 1000000 reads...                                     -----
------------------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------------------------------------
-----                                     Subsampling done. Starting KRAKEN...                                     -----
------------------------------------------------------------------------------------------------------------------------

Loading database... complete.
1000000 sequences (299.99 Mbp) processed in 17.772s (3376.1 Kseq/m, 1012.79 Mbp/m).
  606303 sequences classified (60.63%)
  393697 sequences unclassified (39.37%)

------------------------------------------------------------------------------------------------------------------------
-----                                 Now processing ASSEMBLY/final_assembly.fasta                                 -----
------------------------------------------------------------------------------------------------------------------------

Loading database... complete.
228397 sequences (263.32 Mbp) processed in 3.744s (3660.3 Kseq/m, 4219.95 Mbp/m).
  112709 sequences classified (49.35%)
  115688 sequences unclassified (50.65%)
/opt/metawrap/1.1/envs/metawrap/bin/metawrap-modules/kraken.sh: line 144: [[: final_assembly.krak
final_pure_reads.krak: syntax error: invalid arithmetic operator (error token is ".krak
final_pure_reads.krak")

########################################################################################################################
#####                                      RUNNING KRAKEN-TRANSLATE ON OUTPUT                                      #####
########################################################################################################################

------------------------------------------------------------------------------------------------------------------------
-----                                  Translating KRAKEN_OUT/final_assembly.krak                                  -----
------------------------------------------------------------------------------------------------------------------------

Use of uninitialized value $taxid in numeric gt (>) at /opt/metawrap/1.1/envs/metawrap/bin/kraken-translate line 101, <> line 25463.
Use of uninitialized value $nodes[0] in join or string at /opt/metawrap/1.1/envs/metawrap/bin/kraken-translate line 107, <> line 25463.
Use of uninitialized value $taxid in hash element at /opt/metawrap/1.1/envs/metawrap/bin/kraken-translate line 107, <> line 25463.
Use of uninitialized value $taxid in hash element at /opt/metawrap/1.1/envs/metawrap/bin/kraken-translate line 110, <> line 25463.

------------------------------------------------------------------------------------------------------------------------
-----                                 Translating KRAKEN_OUT/final_pure_reads.krak                                 -----
------------------------------------------------------------------------------------------------------------------------

Use of uninitialized value $taxid in numeric gt (>) at /opt/metawrap/1.1/envs/metawrap/bin/kraken-translate line 101, <> line 203636.
Use of uninitialized value $nodes[0] in join or string at /opt/metawrap/1.1/envs/metawrap/bin/kraken-translate line 107, <> line 203636.
Use of uninitialized value $taxid in hash element at /opt/metawrap/1.1/envs/metawrap/bin/kraken-translate line 107, <> line 203636.
Use of uninitialized value $taxid in hash element at /opt/metawrap/1.1/envs/metawrap/bin/kraken-translate line 110, <> line 203636.
Use of uninitialized value $taxid in numeric gt (>) at /opt/metawrap/1.1/envs/metawrap/bin/kraken-translate line 101, <> line 458063.
Use of uninitialized value $nodes[0] in join or string at /opt/metawrap/1.1/envs/metawrap/bin/kraken-translate line 107, <> line 458063.
Use of uninitialized value $taxid in hash element at /opt/metawrap/1.1/envs/metawrap/bin/kraken-translate line 107, <> line 458063.
Use of uninitialized value $taxid in hash element at /opt/metawrap/1.1/envs/metawrap/bin/kraken-translate line 110, <> line 458063.

########################################################################################################################
#####                                         MAKING KRONAGRAM OF ALL FILES                                        #####
########################################################################################################################

Traceback (most recent call last):
  File "/opt/metawrap/1.1/envs/metawrap/bin/metawrap-scripts/kraken_to_krona.py", line 7, in <module>
    tax="\t".join(line.strip().split("\t")[1].split(";"))
IndexError: list index out of range

************************************************************************************************************************
*****                   Something went wrong with making krona file from kraken file. Exiting...                   *****
************************************************************************************************************************
ursky commented 5 years ago

Can you please provide the first 10 lines of final_pure_reads.kraken?

wolfgangrumpf commented 5 years ago
[rwr002@qmaster01 KRAKEN_OUT]$ more final_pure_reads.kraken 
RM1|S1|R4132681/1   root;cellular organisms;Bacteria;Proteobacteria;delta/epsilon subdivisions;Deltaproteobacteria;Myxococcales;Cystobacterineae;Myxococcaceae;Myxococcus;Myxococcus fulvus;Myxococc
us fulvus 124B02
RM1|S1|R7013201/1   root;cellular organisms;Bacteria;Proteobacteria;Alphaproteobacteria;Rhodospirillales;Rhodospirillaceae;Azospirillum;Azospirillum brasilense
RM1|S1|R9320873/1   root;cellular organisms;Bacteria;Proteobacteria;Alphaproteobacteria;Rhodobacterales;Rhodobacteraceae;Rhodobacter;Rhodobacter capsulatus;Rhodobacter capsulatus SB 1003
RM1|S1|R7978360/1   root;cellular organisms;Bacteria;Proteobacteria;Betaproteobacteria;Burkholderiales;Oxalobacteraceae;Massilia;Massilia putida
RM1|S1|R8247443/1   root;cellular organisms;Bacteria;Proteobacteria;Gammaproteobacteria;Vibrionales;Vibrionaceae;Vibrio;Vibrio gazogenes
RM1|S1|R2559448/1   root;cellular organisms;Bacteria;FCB group;Bacteroidetes/Chlorobi group;Bacteroidetes;Sphingobacteriia;Sphingobacteriales;Sphingobacteriaceae;Pedobacter;Pedobacter sp. G11
RM1|S1|R6915200/1   root;cellular organisms;Bacteria;Proteobacteria;Betaproteobacteria;Burkholderiales;Comamonadaceae;Acidovorax;Acidovorax sp. KKS102
RM1|S1|R11529972/1  root;cellular organisms;Bacteria;Proteobacteria;Betaproteobacteria;Burkholderiales;Comamonadaceae;Delftia;Delftia acidovorans;Delftia acidovorans SPH-1
RM1|S1|R15376643/1  root;cellular organisms;Bacteria;Proteobacteria;Alphaproteobacteria;Rhizobiales;Rhizobiaceae;Sinorhizobium/Ensifer group;Sinorhizobium;Sinorhizobium meliloti
RM1|S1|R7107377/1   root;cellular organisms;Bacteria;Terrabacteria group;Actinobacteria;Actinobacteria;Streptomycetales;Streptomycetaceae;Streptomyces;Streptomyces griseus group;Streptomyces anula
tus subgroup;Streptomyces anulatus
wolfgangrumpf commented 5 years ago

Running kronatools manually gives me this error: Taxonomy not found in /gpfs0/export/opt/metawrap/1.1/envs/metawrap/opt/krona/taxonomy. Was updateTaxonomy.sh run? at /gpfs0/export/opt/metawrap/1.1/envs/metawrap/opt/krona/scripts/../lib/KronaTools.pm line 1376.

I believe the update was done using the preferred method; do we need to run the updateTaxonomy.sh manually?

ursky commented 5 years ago

Yeah, there is a mishap with your database versions. However, metawrap should be able to handle that. I fixed the script and just pushed the changes to https://github.com/bxlab/metaWRAP/blob/master/bin/metawrap-scripts/kraken_to_krona.py. Feel free to replace your current miniconda2/bin/metawrap-scripts/kraken_to_krona.py with the new one. I will push out metawrap v1.1.2 in the next couple days.

wolfgangrumpf commented 5 years ago

And thanks again! I hate to keep bothering you!

ursky commented 5 years ago

Not at all - for every 1 bug report you make there were 20 other users that didn't bother. But I cant help and fix unless I know about it.