conda install -c bioconda metaphlan2
Help message for read_fastx.py
Traceback (most recent call last):
File "/home/ec2-user/anaconda2/bin/metaphlan2.py", line 1564, in <module>
metaphlan2()
File "/home/ec2-user/anaconda2/bin/metaphlan2.py", line 1456, in metaphlan2
tree = TaxTree( mpa_pkl, ignore_markers )
File "/home/ec2-user/anaconda2/bin/metaphlan2.py", line 1133, in __init__
add_lens( self.root )
File "/home/ec2-user/anaconda2/bin/metaphlan2.py", line 1130, in add_lens
lens.append( add_lens( c ) )
File "/home/ec2-user/anaconda2/bin/metaphlan2.py", line 1130, in add_lens
lens.append( add_lens( c ) )
File "/home/ec2-user/anaconda2/bin/metaphlan2.py", line 1130, in add_lens
lens.append( add_lens( c ) )
File "/home/ec2-user/anaconda2/bin/metaphlan2.py", line 1130, in add_lens
lens.append( add_lens( c ) )
File "/home/ec2-user/anaconda2/bin/metaphlan2.py", line 1130, in add_lens
lens.append( add_lens( c ) )
File "/home/ec2-user/anaconda2/bin/metaphlan2.py", line 1130, in add_lens
lens.append( add_lens( c ) )
File "/home/ec2-user/anaconda2/bin/metaphlan2.py", line 1130, in add_lens
lens.append( add_lens( c ) )
File "/home/ec2-user/anaconda2/bin/metaphlan2.py", line 1131, in add_lens
node.glen = sum(lens) / len(lens)
TypeError: unsupported operand type(s) for +: 'int' and 'tuple'
metaphlan2.py fastqs/contig_list_trimmed_sampleE.fq --index v294_CHOCOPhlAn_201901 --nproc 28 --input_type fastq --bt2_ps very-sensitive-local --min_alignment_len 200 -s sams/sampleE.sam.bz2 --bowtie2out bowtie2/sampleE.bowtie2.bz2 -o profiles/profiled_sampleE.txt
#!/bin/bash
# run_metaphlan2.sh
mkdir -p sams
mkdir -p bowtie2
mkdir -p profiles
for f in fastqs/*
do
echo "Running metaphlan2 on ${f}"
bn=$(basename ${f})
python ~/anaconda2/bin/metaphlan2.py $f --index v295_CHOCOPhlAn_201901 --nproc 28 --input_type fastq --bt2_ps very-sensitive-local --min_alignment_len 200 -s sams/${bn}.sam.bz2 --bowtie2out bowtie2/${bn}.bowtie2.bz2 -o profiles/profiled_${bn}.txt
done
(base) [ec2-user@ip-172-31-18-39 ~]$ python --version
Python 3.6.8
(base) [ec2-user@ip-172-31-18-39 ~]$ python2 --versionPython 2.7.16 :: Anaconda, Inc.
metaphlan2.py --bowtie2_exe ../bowtie2 --bowtie2_build ../bowtie2-build --input_type fastq --bowtie2out tmp --nproc 32
--mpa_pkl db_v29 -x db_v29/mpa_v295_CHOCOPhlAn_201901 r1.fastq.gz,r2.fastq.gz
> profiled_metagenome.txt
Help message for read_fastx.py
Traceback (most recent call last):
File "metaphlan2.py", line 1565, in <module>
metaphlan2()
File "metaphlan2.py", line 1457, in metaphlan2
tree = TaxTree( mpa_pkl, ignore_markers )
File "metaphlan2.py", line 1134, in __init__
add_lens( self.root )
File "metaphlan2.py", line 1131, in add_lens
lens.append( add_lens( c ) )
File "metaphlan2.py", line 1131, in add_lens
lens.append( add_lens( c ) )
File "metaphlan2.py", line 1131, in add_lens
lens.append( add_lens( c ) )
[Previous line repeated 4 more times]
File "metaphlan2.py", line 1132, in add_lens
node.glen = sum(lens) / len(lens)
from the error, it seems that you are trying to use the latest database with MetaPhlAn 2.7 or older. mpa_v294_CHOCOPhlAn_201901 is only compatible with MetaPhlAn2 2.9. You can get this version from here https://bitbucket.org/biobakery/metaphlan2/src/2.9/However, this version it is not final and it is still in testing.