redbiom Issue with syntax error

(qiime2-2019.10) Ishans-Air:~ ishanmanandhar$ redbiom search metadata “where ibd_diagnosis == ‘Crohn’s disease’” | wc -l

I am trying to run this code but I am getting this error.

ibd_diagnosis == ‘Crohn’s disease’
^
SyntaxError: invalid syntax
0
I am trying to download the metadata from American gut project using redbiom in QIIME 2 platform. There needs to be ’ in “Crohn’s disease” and I get syntax error. How can run this code “(qiime2-2019.10) Ishans-Air:~ ishanmanandhar$ redbiom search metadata “where ibd_diagnosis == ‘Crohn’s disease’” | wc -l” to download the metadata I want.Thank you

Dear @Ishanmanandhar,

That’s a sneaky one! The issue is the shell is seeing the single quote mark (') in Crohn’s disease, and interpreting that to close the string. After some toying around, it looks like simply escaping the quote (i.e., \) is insufficient here. But, treating this like a $'string' seems to work:

$ redbiom search metadata $'where ibd_diagnosis == "Crohn\'s disease"' | wc -l
     421

For reference, the Stack Exchange post this is based off can be found here.

All the best,
Daniel

2 Likes

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