The bioBakery help forum

Error while running MetaPhlAn

This is the command and the error message
$sudo metaphlan C6E8YANXX_s8_1_GSLv3-7_01_SL106284.fastq --bowtie2out metagenome.bowtie2.bz2 --nproc 5 --input_type fastq -o profiled_metagenome.txt
Traceback (most recent call last):
File “/usr/local/bin/metaphlan”, line 11, in
load_entry_point(‘MetaPhlAn==3.0.11’, ‘console_scripts’, ‘metaphlan’)()
File “/usr/local/lib/python3.6/dist-packages/metaphlan/metaphlan.py”, line 1004, in main
min_alignment_len=pars[‘min_alignment_len’], read_min_len=pars[‘read_min_len’], min_mapq_val=pars[‘min_mapq_val’])
File “/usr/local/lib/python3.6/dist-packages/metaphlan/metaphlan.py”, line 431, in run_bowtie2
nreads, avg_read_length = list(map(float, read_fastx_stderr[0].decode().split()))
IndexError: list index out of range

This generates an output file with the following content:
#mpa_v30_CHOCOPhlAn_201901
#/usr/local/bin/metaphlan metagenome.bowtie2.bz2 --nproc 5 --input_type bowtie2out -o profiled_metagenome.txt
#SampleID Metaphlan_Analysis
#clade_name NCBI_tax_id relative_abundance additional_species
UNKNOWN -1 100.0

I’ve been running metaphlan from singularity, each time I found this error:
OSError: [Errno 30] Read-only file system: ‘/usr/local/lib/python3.7/dist-packages/metaphlan/metaphlan_databases/mpa_latest’ → ‘/usr/local/lib/python3.7/dist-packages/metaphlan/metaphlan_databases/mpa_previous’

  • It seems to be permission issues, but all the changes I made failed.
    Could any one help me figure out what it means? I will appreciate it

Singularity root filesystem is read-only, so you need to install the metaphlan database in a separate directory and specify it with the --bowtie2db parameter