Question: MG-RAST API - Problem with space characters in gene names at URL
0
gravatar for fibar
5.1 years ago by
fibar50
Argentina
fibar50 wrote:

The MG-RAST API gives you the option to download organisms abundance for specific genes from the "Matrix" section, using always the linux command 'curl'. Example at the taxonomic level 'class' for the gene called 'Integrase':

curl -X GET -H "auth: user_key" "http://api.metagenomics.anl.gov/1/matrix/organism?id=mgm_1_number&id=mgm_2_number&group_level=class&result_type=abundance&filter=Integrase&filter_level=function&filter_source=Subsystems" > file_name.biom

The problem comes when the gene name you need has space characters, e.g., "filter=DNA Polymerase". It is an URL, so I tried "filter=DNA%20Polymerase" and "filter=DNA+Polymerase", but it didn't work. The output was always: {"ERROR":"no data found for the given combination of ids and paramaters"}

Any help will be very appreciated. All the best, fibar

ADD COMMENTlink modified 5.0 years ago • written 5.1 years ago by fibar50

What about if you use single quotes instead of double quotes for the url?

ADD REPLYlink modified 11 months ago by RamRS30k • written 5.0 years ago by 5heikki9.0k

It ended up being an MG-RAST problem, which was solved later by them.

Using %20 as space character is correct. Thanks for the comments.

ADD REPLYlink written 5.0 years ago by fibar50
0
gravatar for Jean-Karim Heriche
5.0 years ago by
EMBL Heidelberg, Germany
Jean-Karim Heriche23k wrote:

%20 should work. Alternatively, you could also try the --data-urlencode option of curl. Also, the error message says there is no data for the given request so have you considered that there may be no data matching your request ?

ADD COMMENTlink written 5.0 years ago by Jean-Karim Heriche23k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1886 users visited in the last hour