Error with my filtering feature table command

Hello, I am not sure why I am getting the error message below when trying to filter my feature table. I am running Qiime2-2017.8 ( I haven't upraded to the latest version) but the older version had the filtering plugin so it should work right? Would you please advise? Oh and just to be clear, I am trying to filter my feature table to only include samples from Expert.Day "6" and also only include Treatments "8.0" and "7.6".

--i-table mesocosm.only-filtered-table.qza
--m-metadata-file samples-to-keep.txt
--p-where β€œExper.Day=β€˜6’”
β€”-p-where β€œTreatment=β€˜8.0', '7.6'”
β€”-p-query-delimiter ,
--o-filtered-table Exper.Day6-table.qza

Error: Detected invalid character in: β€œExper.Day=β€˜6’”, β€”-p-where, β€œTreatment=β€˜8.0,, 7.6’”, β€”-p-query-delimiter Verify the correct quotes or dashes (ASCII) are being used.

1 Like

Hello Lisa,

I think the issue is the type of - dash - being used.

Linux commands, including all qiime commands, use the - normal dash, but Microsoft Word like using the β€” em-dash β€”.
They look really similar, but you can see the difference in length:

β€”-p-where

That first dash is an em-dash!

Try running you command with only the smaller, normal dashes, and let us know if it works.

Colin

Thanks @colinbrislawn!

@Lisa_Crummett, you can only provide one --p-where clause, and second, the SQL there is invalid. How about we try something like this:

--p-where "Exper.Day='6' AND Treatment IN ('8.0', '7.6')"

Thank you Matt. I tried using your --p command (but using Day 20 instead of Day 6):

qiime feature-table filter-samples
–i-table mesocosm.only-filtered-table.qza
–m-metadata-file samples-to-keep.txt
–p-where β€œExper.Day=’20’ AND Treatment IN (β€˜8.0’, β€˜7.6’)”
–o-filtered-table Exper.Day20-table.qza

I still got an error message: Error: Detected invalid character in: Exper.Day=’20’ AND Treatment IN (β€˜8.0’, β€˜7.6’)
Verify the correct quotes or dashes (ASCII) are being used.

I went ahead and just modified my metadata table by hand (I deleted the samples and pH values that I didn’t want) and went ahead with the ANCOM analysis. It worked… It took a little longer but that’s okay.

Cheers,
Lisa

1 Like

:champagne: :fireworks:

Looks like you have styled quotes in your command --- this can happen if you are jotting down your notes in Microsoft Office, for example.

β€œ ” vs " "
β€˜ ’ vs ' '

Replace with straight quotes and you are set:

qiime feature-table filter-samples \
  --i-table mesocosm.only-filtered-table.qza \
  --m-metadata-file samples-to-keep.txt \
  --p-where "Exper.Day='20' AND Treatment IN ('8.0', '7.6')" \
  --o-filtered-table Exper.Day20-table.qza
1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.