Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metaphlan 3 issue reading gzipped paired end input #131

Closed
flannsmith opened this issue Oct 26, 2020 · 1 comment
Closed

Metaphlan 3 issue reading gzipped paired end input #131

flannsmith opened this issue Oct 26, 2020 · 1 comment

Comments

@flannsmith
Copy link

flannsmith commented Oct 26, 2020

Describe the bug
I updated to metaphlan 3 and am not able to run metaphlan on paired-end files. This is probably a really simple syntax error (apologies if so) but I am puzzled as to what I'm doing wrong.

I followed the structure of the command on here https://github.com/biobakery/MetaPhlAn/wiki/MetaPhlAn-3.0

$ metaphlan metagenome_1.fastq,metagenome_2.fastq --bowtie2out metagenome.bowtie2.bz2 --nproc 5 --input_type fastq -o profiled_metagenome.txt

by putting a comma and no space between the 2 files

To Reproduce
metaphlan S122_paired_1.fastq,gz,S122_paired_2.fastq.gz --bowtie2out S122.bowtie2.bz2 --input_type fastq --add_viruses --unknown_estimation -o profiled_metagenome.txt

Error I get:
Traceback (most recent call last):
File "/home/linda/.local/bin/read_fastx.py", line 8, in
sys.exit(main())
File "/home/linda/.local/lib/python3.6/site-packages/metaphlan/utils/read_fastx.py", line 155, in main
nreads += read_and_write_raw(f, opened=False, min_len=min_len)
File "/home/linda/.local/lib/python3.6/site-packages/metaphlan/utils/read_fastx.py", line 119, in read_and_write_raw
nreads = read_and_write_raw_int(inf, min_len=min_len)
File "/home/linda/.local/lib/python3.6/site-packages/metaphlan/utils/read_fastx.py", line 64, in read_and_write_raw_int
l = fd.readline()
File "/usr/lib/python3.6/gzip.py", line 289, in read1
return self._buffer.read1(size)
File "/usr/lib/python3.6/_compression.py", line 68, in readinto
data = self.read(len(byte_view))
File "/usr/lib/python3.6/gzip.py", line 463, in read
if not self._read_gzip_header():
File "/usr/lib/python3.6/gzip.py", line 411, in _read_gzip_header
raise OSError('Not a gzipped file (%r)' % magic)
OSError: Not a gzipped file (b'#S')

If try again with a space between (as in metaphlan 2 documentation)

metaphlan S122_paired_1.fastq.gz, S122_paired_2.fastq.gz --bowtie2out S122.bowtie2.bz2 --input_type fastq --add_viruses --unknown_estimation -o profiled_metagenome.txt

I get the error:

File "/home/linda/.local/lib/python3.6/site-packages/metaphlan/utils/read_fastx.py", line 53, in fopen
return open(fn)
FileNotFoundError: [Errno 2] No such file or directory: ''

Platform (please complete the following information):

  • MetaPhlAn version 3.0 (20 Mar 2020)
  • Installed from source (cloned git repository)

What am I missing? Thanks!

@fbeghini
Copy link
Member

metaphlan S122_paired_1.fastq,gz,S122_paired_2.fastq.gz --bowtie2out S122.bowtie2.bz2 --input_type fastq --add_viruses --unknown_estimation -o profiled_metagenome.txt

has a comma instead of a dot in the first file extension, this is the correct command

metaphlan S122_paired_1.fastq.gz,S122_paired_2.fastq.gz --bowtie2out S122.bowtie2.bz2 --input_type fastq --add_viruses --unknown_estimation -o profiled_metagenome.txt

Next time, please read note #123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants