MG-RAST API - Problem with space characters in gene names at URL
1
0
Entering edit mode
6.4 years ago
fibar ▴ 90

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

myposts mg-rast API matrix abundance • 1.7k views
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode
6.3 years ago

%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 COMMENT

Login before adding your answer.

Traffic: 2859 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6