filter samples from otu table - ValueError: Type' is not in list

126 views
Skip to first unread message

Jennifer L A Shaw

unread,
Aug 17, 2016, 1:38:32 AM8/17/16
to Qiime 1 Forum

Hi guys,

I was wondering if anyone can help me. I am trying to filter some samples from my OTU_table.biom file. The error it is throwing back at me is: ValueError: '\xe2\x80\x98Type' is not in list
(My mapping file is attached to this post)
Here is the full command and error message:

MacQIIME MACGICIAN-GW:salt_metal_trials_August2016 $ filter_samples_from_otu_table.py -i pick_open_ref_otus/otu_table_mc2_w_tax.biom -o remove_ext_blanks/otu_table_extractionblank_samples_only.biom -m MapFile1.txt -s ‘Type:blank’
Traceback (most recent call last):
  File "/macqiime/anaconda/bin/filter_samples_from_otu_table.py", line 162, in <module>
    main()
  File "/macqiime/anaconda/bin/filter_samples_from_otu_table.py", line 121, in main
    open(mapping_fp, 'U'), valid_states)
  File "/macqiime/anaconda/lib/python2.7/site-packages/qiime/filter.py", line 106, in sample_ids_from_metadata_description
    map_data, map_header, map_comments = parse_mapping_file(mapping_f)
  File "/macqiime/anaconda/lib/python2.7/site-packages/qiime/parse.py", line 135, in parse_mapping_file
    raise QiimeParseError("No header line was found in mapping file.")
qiime.parse.QiimeParseError: No header line was found in mapping file.
MacQIIME MACGICIAN-GW:salt_metal_trials_August2016 $ filter_samples_from_otu_table.py -i pick_open_ref_otus/otu_table_mc2_w_tax.biom -o remove_ext_blanks/otu_table_extractionblank_samples_only.biom -m MapFile.txt -s ‘Type:blank’
Traceback (most recent call last):
  File "/macqiime/anaconda/bin/filter_samples_from_otu_table.py", line 162, in <module>
    main()
  File "/macqiime/anaconda/bin/filter_samples_from_otu_table.py", line 121, in main
    open(mapping_fp, 'U'), valid_states)
  File "/macqiime/anaconda/lib/python2.7/site-packages/qiime/filter.py", line 108, in sample_ids_from_metadata_description
    sample_ids = get_sample_ids(map_data, map_header, valid_states)
  File "/macqiime/anaconda/lib/python2.7/site-packages/qiime/filter.py", line 131, in get_sample_ids
    name_to_col = dict([(s, map_header.index(s)) for s in states])
ValueError: '\xe2\x80\x98Type' is not in list


I have tried validate_mapping_file.py and it says there are no errors.
validate_mapping_file.py -m MapFile.txt -o check_id_map_output
No errors or warnings were found in mapping file.

I have also tried opening the map as an excel file and re-saving as tab delimited text file, and I have also opened it, checked it, and saved it in TextWrangler (UTF-8). Still getting the same error that it cant find my header in the mapping file.

Any suggestions?

Thanks
Jen

MapFile.txt

Jai Ram Rideout

unread,
Aug 17, 2016, 2:51:25 PM8/17/16
to Qiime 1 Forum
Hi Jen,

Weird, the mapping file you attached is valid according to validate_mapping_file.py, and on manual inspection it also looks valid. Further, I was able to run the following command on your mapping file, and it was able to find the Type column just fine:

print_metadata_stats.py -m MapFile.txt -c Type

This issue may be specific to filter_samples_from_otu_table.py. Can you please provide me your OTU table (pick_open_ref_otus/otu_table_mc2_w_tax.biom) so I can try reproducing the issue locally?

Thanks,
Jai

Jennifer L A Shaw

unread,
Aug 17, 2016, 10:39:08 PM8/17/16
to Qiime 1 Forum
Thanks Jai, yeah exactly! I just can't figure it out!
Here is the OTU table. I have to compress it so it would send.
Jen
otu_table_mc2_w_tax.biom.zip

Jai Ram Rideout

unread,
Aug 19, 2016, 5:49:21 PM8/19/16
to Qiime 1 Forum
Hi Jen,

Your mapping file and .biom file are fine. The command you posted is using Unicode quotation characters (‘) instead of ASCII quotation characters (') around Type:blank. You actually don't need to use quotation characters here, so try running this command:

filter_samples_from_otu_table.py -i pick_open_ref_otus/otu_table_mc2_w_tax.biom -o remove_ext_blanks/otu_table_extractionblank_samples_only.biom -m MapFile.txt -s Type:blank

I was able to successfully filter the table with that command.

Best,
Jai

Jennifer L A Shaw

unread,
Aug 22, 2016, 12:03:55 AM8/22/16
to Qiime 1 Forum
OMG! it worked!
so simple! haha. Thank you!!!
:)

Jai Ram Rideout

unread,
Aug 22, 2016, 1:38:24 PM8/22/16
to Qiime 1 Forum
Great, thanks for confirming that fixed it!

Jai
Reply all
Reply to author
Forward
0 new messages