q2-shotgun bracken error

Heyy you all!

I'm trying the recent q2-shotgun library for trying to find Fungal sequences in ur Shallow Shotgun Sequencing data.

Following @Micro_Biologist tutorial (Importing Kraken2 and bracken databases into qiime2!), I downloaded the PlusPF database (since this one includes fungi information) and import it to qiime2-shotgun distribution.

Then I runned kraken2 (following the github tutorial q2-books/q2-shotgun/q2-shotgun/00-tutorial.md at main · caporaso-lab/q2-books · GitHub ), apparently being this execution successful. However, when I try to run the bracken step, the following error appears:

Plugin error from moshpit:

  An error was encountered while running Bracken, (return code 1), please inspect stdout and stderr to learn more.

Debug info has been saved to /tmp/qiime2-q2cli-err-cs94efi4.log

Taking a look at the .log file, I see that there's something wrong with the Kraken2 step, since no reads were found:

cat /tmp/qiime2-q2cli-err-cs94efi4.log

Running external command line application(s). This may print messages to stdout and/or stderr.
The command(s) being run are below. These commands cannot be manually re-run as they will depend on temporary files that no longer exist.
Command: bracken -d /tmp/qiime2/mgorostidi/data/ab5f1fa9-9c39-4a7d-b7b4-81fd3f428998/data -i /tmp/qiime2/mgorostidi/data/24e0eb23-b553-4272-b706-d2e8d265b722/data/11326-Q-76401-0059-2019-03-08-290.report.txt -o /tmp/tmpiwgpufzu/11326-Q-76401-0059-2019-03-08-290.bracken.output.txt -w /tmp/q2-Kraken2ReportDirectoryFormat-le_95_e2/11326-Q-76401-0059-2019-03-08-290.report.txt -t 0 -r 100 -l S

Checking for Valid Options...
Running Bracken
python src/est_abundance.py -i /tmp/qiime2/mgorostidi/data/24e0eb23-b553-4272-b706-d2e8d265b722/data/11326-Q-76401-0059-2019-03-08-290.report.txt -o /tmp/tmpiwgpufzu/11326-Q-76401-0059-2019-03-08-290.bracken.output.txt -k /tmp/qiime2/mgorostidi/data/ab5f1fa9-9c39-4a7d-b7b4-81fd3f428998/data/database100mers.kmer_distrib -l S -t 0

Checking report file: /tmp/qiime2/mgorostidi/data/24e0eb23-b553-4272-b706-d2e8d265b722/data/11326-Q-76401-0059-2019-03-08-290.report.txt
Error: no reads found. Please check your Kraken report

Could someone help me with this? Since I've checked the github issues and also the qiime2-forum but haven't found anything regarding this.

And more questions..

  1. This part is not included in the tutorial, but should we remove adapters from the files? (I guess yes..)
  2. What's the depth required for this kind of analysis?
  3. Having the following reads count per sample would be enough for fungal kingdom analysis?
  4. What's the difference between using the whole PlusPF db or the 16GB one?

Sample information:

  • Shallow Shotgun Sequencing
  • Sequences' quality graphs show good qualities
  • Paired-end sequencing (each 150 length)
  • demux. qzv:

Demultiplexed sequence counts summary

forward reads reverse reads
Minimum 36 36
Median 379.0 379.0
Mean 467.6875 467.6875
Maximum 2403 2403
Total 29932 29932


Hi @MiriamGorostidi ,

Thanks for giving q2-moshpit a try!

Have you inspected the kraken2 report as indicated in the error message? Either it really is empty for some reason, or it does not have any species-level hits. Please export the kraken2 report and inspect it and let us know what you see.

bracken requires a level specification, which is set to species level by default. If there are no species-level hits in your kraken2 report, then bracken2 is failing because there are no species-level hits for estimating abundances. So if that is the case you could add --p-level G (or whatever level makes sense based on your kraken2 report) to your estimate-bracken command to see if you can estimate results at genus-level.

Yes. That tutorial is an alpha release, and more detailed tutorials are forthcoming.

For read-based classification with kraken2 I am not sure if there is a rule of thumb... but this would be a good paper to consult if you want to know how shallow you can go with shallow shotgun sequencing:

You can read more about the databases here:

In some cases (i.e. for collections with “-8” or “-16” in the name) we used the --max-db-size option to cap the size of the database produced. This makes the index smaller at the expense of some sensitivity and accuracy. In all cases we use the defaults for k-mer length, minimizer length, and minimizer spacing.

Good luck!

1 Like

Hi @Nicholas_Bokulich !

Thank you much for you rapid response :slight_smile:

How could I export the kraken2 report? I mean, you mean to convert the .qza to .qzv right? But which one would be the command? (I'm sorry, first time working with kraken2 too)

I will give a deep read to those two references you mention!

Thank you so much for everything!

Hi @MiriamGorostidi ,

Use the qiime tools export command to export to a text file.

Good luck!

Thank you @Nicholas_Bokulich !

Already checked and you were right! All the kraken reports have the following:

100.00 667 667 0 0 U 0 unclassified

What you suggest me to do?

I mean, taking into account that the PlusFP db includes protozoa and fungi kingdoms, this could mean that there is not any fungi or protozoa in my samples? Or should I try other approaches?

Thank you!

Yes it looks that way. You could try a different database to see if you get any other hits to other organisms.

Or for a quick check you could take some of the raw reads (before inputting to QIIME 2 or doing any QC) and just try BLASTing a few to see what's there.

Let me know what you find. Good luck!

Hi @Nicholas_Bokulich !

I've Blast a couple of them and found bacterias at least, so I will try the pipeline again with another database.

Actually, I already tried it and got the following error: (I mean, everything went correct the first time and now...) Do you know what that problems about space refers to?

Traceback (most recent call last):
File "/pool0/home/mgorostidi/miniconda3/envs/qiime2-shotgun-2023.9/lib/python3.8/site-packages/setuptools/_distutils/file_util.py", line 58, in _copy_file_contents
OSError: [Errno 28] No space left on device

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/pool0/home/mgorostidi/miniconda3/envs/qiime2-shotgun-2023.9/lib/python3.8/site-packages/qiime2/core/archive/archiver.py", line 409, in from_data
Format.write(rec, type, format, data_initializer,
File "/pool0/home/mgorostidi/miniconda3/envs/qiime2-shotgun-2023.9/lib/python3.8/site-packages/qiime2/core/archive/format/v5.py", line 20, in write
super().write(archive_record, type, format, data_initializer,
File "/pool0/home/mgorostidi/miniconda3/envs/qiime2-shotgun-2023.9/lib/python3.8/site-packages/qiime2/core/archive/format/v1.py", line 18, in write
super().write(archive_record, type, format, data_initializer,
File "/pool0/home/mgorostidi/miniconda3/envs/qiime2-shotgun-2023.9/lib/python3.8/site-packages/qiime2/core/archive/format/v0.py", line 62, in write
File "/pool0/home/mgorostidi/miniconda3/envs/qiime2-shotgun-2023.9/lib/python3.8/site-packages/qiime2/core/path.py", line 45, in _move_or_copy
return self._copy_dir_or_file(other)
File "/pool0/home/mgorostidi/miniconda3/envs/qiime2-shotgun-2023.9/lib/python3.8/site-packages/qiime2/core/path.py", line 33, in _copy_dir_or_file
return distutils.dir_util.copy_tree(str(self), str(other))
File "/pool0/home/mgorostidi/miniconda3/envs/qiime2-shotgun-2023.9/lib/python3.8/site-packages/setuptools/_distutils/dir_util.py", line 185, in copy_tree
File "/pool0/home/mgorostidi/miniconda3/envs/qiime2-shotgun-2023.9/lib/python3.8/site-packages/setuptools/_distutils/file_util.py", line 163, in copy_file
_copy_file_contents(src, dst)
File "/pool0/home/mgorostidi/miniconda3/envs/qiime2-shotgun-2023.9/lib/python3.8/site-packages/setuptools/_distutils/file_util.py", line 60, in _copy_file_contents
raise DistutilsFileError(
distutils.errors.DistutilsFileError: could not write to '/tmp/qiime2/mgorostidi/processes/1889-1707433229.17@mgorostidi/4ad844a0-0145-4f04-b916-281545965f1c.7349497406739894442/4ad844a0-0145-4f04-b916-281545965f1c/data/hash.k2d': No space left on device

During handling of the above exception, another exception occurred:

OSError: [Errno 28] No space left on device

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/pool0/home/mgorostidi/miniconda3/envs/qiime2-shotgun-2023.9/lib/python3.8/site-packages/q2cli/builtin/tools.py", line 267, in import_data
artifact = qiime2.sdk.Artifact.import_data(type, input_path,
File "/pool0/home/mgorostidi/miniconda3/envs/qiime2-shotgun-2023.9/lib/python3.8/site-packages/qiime2/sdk/result.py", line 329, in import_data
return cls.from_view(type, view, view_type, provenance_capture,
File "/pool0/home/mgorostidi/miniconda3/envs/qiime2-shotgun-2023.9/lib/python3.8/site-packages/qiime2/sdk/result.py", line 364, in _from_view
artifact._archiver = archive.Archiver.from_data(
File "/pool0/home/mgorostidi/miniconda3/envs/qiime2-shotgun-2023.9/lib/python3.8/site-packages/qiime2/core/archive/archiver.py", line 421, in from_data
File "/pool0/home/mgorostidi/miniconda3/envs/qiime2-shotgun-2023.9/lib/python3.8/site-packages/qiime2/core/archive/archiver.py", line 301, in _destroy_temp_path
File "/pool0/home/mgorostidi/miniconda3/envs/qiime2-shotgun-2023.9/lib/python3.8/site-packages/qiime2/core/cache.py", line 1637, in remove
with self.cache.lock:
File "/pool0/home/mgorostidi/miniconda3/envs/qiime2-shotgun-2023.9/lib/python3.8/site-packages/qiime2/core/cache.py", line 292, in enter
File "/pool0/home/mgorostidi/miniconda3/envs/qiime2-shotgun-2023.9/lib/python3.8/site-packages/flufl/lock/_lockfile.py", line 328, in lock
File "/pool0/home/mgorostidi/miniconda3/envs/qiime2-shotgun-2023.9/lib/python3.8/site-packages/flufl/lock/_lockfile.py", line 493, in _write
OSError: [Errno 28] No space left on device

An unexpected error has occurred:

[Errno 28] No space left on device

See above for debug info.

Hi @MiriamGorostidi ,

This means that you ran out of disk space on your computer (or wherever this is running). You will need to delete some files to make space, or find another computer with more disk space.

Good luck!

Hii @Nicholas_Bokulich !

I know what was happening.

First, the guy that sent me the fastq files sent the incorrect ones, so of course, there was not any classification made in those ones.

Second, the server where I am running the analysis had a temp folder with no enough space, so this is why the error regarding disk space appeared. Once the tech support redirect the analysis to a temp folder with more space I have never had that error again.

Thank ou so much for your help :slight_smile: