Hello,
I’m using MetaPhlAn3 and I’m getting an error merging the tables (different from the other error on the forum):
Too many columns specified: expected 4 and found 3
I used conda list to determine my MetaPhlAn version:
metaphlan 3.0 pyh5ca1d4c_4 bioconda
This is the command I used to run MetaPhlAn3 (I batch submitted to my institution’s high compute cluster):
metaphlan $file1,$file2,$file3 --bowtie2out ${samplename}.bowtie2.bt2 --nproc $cores --input_type fastq -o profiled_${samplename}.txt
I got some output warnings, but a final profiled table was produced. Below are the warnings:
Use of uninitialized value $bt2_args[2] in join or string at /home/saatkinson/miniconda3/envs/biobakery/bin/bowtie2 line 423.
Use of uninitialized value $bt2_args[3] in join or string at /home/saatkinson/miniconda3/envs/biobakery/bin/bowtie2 line 423.
Use of uninitialized value $[2] in string eq at /home/saatkinson/miniconda3/envs/biobakery/bin/bowtie2 line 360.
Use of uninitialized value $[3] in string eq at /home/saatkinson/miniconda3/envs/biobakery/bin/bowtie2 line 360.
Use of uninitialized value in exists at /home/saatkinson/miniconda3/envs/biobakery/bin/bowtie2 line 81.
Use of uninitialized value in exists at /home/saatkinson/miniconda3/envs/biobakery/bin/bowtie2 line 81.
Use of uninitialized value $bt2_args[2] in join or string at /home/saatkinson/miniconda3/envs/biobakery/bin/bowtie2 line 459.
Use of uninitialized value $bt2_args[3] in join or string at /home/saatkinson/miniconda3/envs/biobakery/bin/bowtie2 line 459.
WARNING: The metagenome profile contains clades that represent multiple species merged into a single representant.
An additional column listing the merged species is added to the MetaPhlAn output.
I then tried to merge my tables;
merge_metaphlan_tables.py /rcc/stor1/projects/CMR/NAFLD/metatranscriptomics/metaphlan3_out/profiled*.txt > ab_table_merged_all.txt
And got the below error. It seems confused because it’s saying I have too many columns specified, but then says it expects 4 and found 3 (which would be too few). Also I manually inspected a few files and the couple I looked at definitely had 4 columns (clade_name, NCBI_taxa_ID, relative_abundance, additional_species).
Traceback (most recent call last):
File “/home/saatkinson/miniconda3/envs/biobakery/bin/merge_metaphlan_tables.py”, line 10, in
sys.exit(main())
File “/home/saatkinson/miniconda3/envs/biobakery/lib/python3.7/site-packages/metaphlan/utils/merge_metaphlan_tables.py”, line 78, in main
merge(args.aistms, sys.stdout)
File “/home/saatkinson/miniconda3/envs/biobakery/lib/python3.7/site-packages/metaphlan/utils/merge_metaphlan_tables.py”, line 48, in merge
index_col=index_col
File “/home/saatkinson/miniconda3/envs/biobakery/lib/python3.7/site-packages/pandas/io/parsers.py”, line 676, in parser_f
return _read(filepath_or_buffer, kwds)
File “/home/saatkinson/miniconda3/envs/biobakery/lib/python3.7/site-packages/pandas/io/parsers.py”, line 454, in _read
data = parser.read(nrows)
File “/home/saatkinson/miniconda3/envs/biobakery/lib/python3.7/site-packages/pandas/io/parsers.py”, line 1133, in read
ret = self._engine.read(nrows)
File “/home/saatkinson/miniconda3/envs/biobakery/lib/python3.7/site-packages/pandas/io/parsers.py”, line 2037, in read
data = self._reader.read(nrows)
File “pandas/_libs/parsers.pyx”, line 860, in pandas._libs.parsers.TextReader.read
File “pandas/_libs/parsers.pyx”, line 875, in pandas._libs.parsers.TextReader._read_low_memory
File “pandas/_libs/parsers.pyx”, line 952, in pandas._libs.parsers.TextReader._read_rows
File “pandas/_libs/parsers.pyx”, line 1013, in pandas._libs.parsers.TextReader._convert_column_data
pandas.errors.ParserError: Too many columns specified: expected 4 and found 3
Any help with this error would be appreciated!
Thanks,
Samantha