The bioBakery help forum

FileNotFoundError: [Errno 2]: Metaphlan 3.0.7

I’m getting the below-mentioned error when I’m trying to run Metaphlan v3 on paired-end metagenome sequencing data. I’m using the on-campus HPC that uses Slurm workload manager for job scheduling, to run metaphlan.

File “/opt/metaphlan/3.0.7/anaconda3/bin/”, line 10, in
File “/opt/metaphlan/3.0.7/anaconda3/lib/python3.8/site-packages/metaphlan/utils/”, line 155, in main
f_nreads, f_avg_read_length = read_and_write_raw(f, opened=False, min_len=min_len)
File “/opt/metaphlan/3.0.7/anaconda3/lib/python3.8/site-packages/metaphlan/utils/”, line 117, in read_and_write_raw
with fopen(fd) as inf:
File “/opt/metaphlan/3.0.7/anaconda3/lib/python3.8/site-packages/metaphlan/utils/”, line 53, in fopen
return open(fn)
FileNotFoundError: [Errno 2] No such file or directory: ‘’

Below are the command line arguments I used to run metaphlan using the batch scheduler:

Loading modules required for script commands

module load metaphlan

Changing directories to where the fastq files are located

cd /scratch/hasitha/WaterProject/Metagenome

Running metaphlan3.0

metaphlan 68_1.fq.gz,68_2.fq.gz, --nproc 8 --input_type fastq --bowtie2out /scratch/hasitha/WaterProject/Metagenome/metaphlan_outputs/metagenome.bowtie2.bz2 --bowtie2db /scratch/hasitha/WaterProject/Metagenome/metaphlan_outputs/ -o /scratch/hasitha/WaterProject/Metagenome/metaphlan_outputs/profiled_sample68.tx

Would greatly appreciate is someone can shed some light on solving this issue.

Thank you.

You have a trailing comma in the input files that makes the command fail.
metaphlan 68_1.fq.gz,68_2.fq.gz, should be metaphlan 68_1.fq.gz,68_2.fq.gz

1 Like

That was very sloppy of me to miss that. Ran without any issues after fixing that.
Thank you very much for the help.