Metaphlan not creating txt file

Hi,

Metaphlan is not creating the output txt files. After creating the bowtie2.bz2 file it then gives an error

The command I am using is:
metaphlan /mnt/d/merged_folder/bbduk_trim2/${base}_R1.fastq.gz,/mnt/d/merged_folder/bbduk_trim2/${base}_R2.fastq.gz --input_type fastq -x mpa_vJan21_CHOCOPhlAnSGB_202103 --bowtie2db ~/reference_databases/metaphlan_databases --bowtie2out /mnt/d/metaphlan/metaphlan4/${base}.bowtie2.bz2 -o /mnt/d/metaphlan/metaphlan4/${base}_mpa.txt --nproc 5

${base} refers to the sample file prefix (this command is part of a loop)

This command worked for several samples (ie created both the bowtie2out and the txt file) before the computer crashed. Thereafter it gave the error although it does create a bowtie2out file.

If I try running it using the bowtie2out file as input it gives the same error even on those samples that worked in the first place.

Uninstalling metaphlan and reinstalling didn’t make any difference

Help appreciated!

Kind regards,

Lorcan

Hi @lorcan1601
By the error reported, it seems there is some problems /errors within your input file. I would suggest you to inspect your fastq file to see whether it has been corrupted

Thanks aitor.blancomiguez,

It doesn’t seem to be a problem with the fastq files. It gives the same error when I use a bowtie2output file as input, and even when I use the bowtie2output file in the tutorial…

Lorcan

Hi @lorcan1601
I see, could we check the metaphlan database files? Can you check first the size of the metaphlan 4 database files? Running metaphlan --help you will be able to see the default metaphlan_databases folder. E.g:

Mapping arguments:                                                                                                                                                                                                 
  --force               Force profiling of the input file by removing the bowtie2out file                                                                                                                          
  --bowtie2db METAPHLAN_BOWTIE2_DB                                                                                                                                                                                 
                        Folder containing the MetaPhlAn database. You can specify the location by exporting the DEFAULT_DB_FOLDER variable in the shell.[default /etc/anaconda3/e
nvs/metaphlan-4/lib/python3.9/site-packages/MetaPhlAn/metaphlan/metaphlan_databases]

Thanks Profile - aitor.blancomiguez - The bioBakery help forum,

I have the metaphlan database stored outside the conda environment. I had to download the prebuilt bowtie2 indexes and the extract the pkl files etc. from the the tar file.

I came across a similar(ish) problem on another thread where it appeared panphlan was not reading the bz2 files correctly… is this a similar issue?

The bowtie2out files appear to be in order, as far as I can tell.

Lorcan

It is a strange behaviour since you were able to successfully process some other samples before. It is not surprising the bowtie2out file generated by the failed sample does not work if the execution of metaphlan failed during its generation. However, if the bowtie2out file from the tutorial or the ones executed successfully before do not work either… that is really unexpected. Which version of the metaphlan code are you running (metaphlan --version)?, what is the exact command you are using for running on the bowtie2out files?

MetaPhlAn version 4.0.3 (24 Oct 2022)

metaphlan SRS014476-Supragingival_plaque.fasta.gz.bowtie2out --input_type bowtie2out -x mpa_vJan21_CHOCOPhlAnSGB_202103 --bowtie2db ~/reference_databases/metaphlan_databases -o /mnt/d/metaphlan/10A_metGF.txt --nproc 5

Would it be possible to share one of the bowtie2out output files for us to try to reproduce the problem?

Hi Aitor,

I never got a chance to get back to you… I still have the same issue, even after a fresh install of Ubuntu (which I did for a separate reason).

I also get the same error if I use an old bowtie2out file from a metaphlan3 analysis I did some time ago

Here are a couple of bowtie2out files for you to see if you can reproduce the problem. However, I suspect the issue is not the bowtie2out files rather how the program or my system is handling them…

Oh, it seems the files are too big to upload here… can I email them?

KR

Lorcan

Hi @lorcan1601
You can share them using the following Drive folder: Biobakery_forum_problems - Google Drive or share it to my email aitor.blancomiguez@unitn.it