MG-RAST API Explorer -- an on-ramp for learning to use the MG-RAST API


MG-RAST provides a RESTful API at https://api.mg-rast.org. A user friendly description is available at https://api.mg-rast.org/api.html. However this requires significant technical skills. We provide MG-RAST API Explorer to assist with learning the use of the API.

The API Explorer provides working examples of API queries, allows editing and customizing of these sample queries and displays the results of an API query in-browser. Additionally, it constructs working command-line invocations that can be copied and pasted.

It has one page for queries for the API Explorer search, and a separate page for all other API functionality.




The API explorer provides a gentle introduction to the API by providing a number of working, simple examplequeries. For instance, downloading annotated sequences requires specifying a data set, a database (one of the databases included in the union M5nr database) , and cut-off thresholds for the similarity table. Indices for both taxonomy (Figure 1) and functions (see Figure 2) allow retrieval of annotated sequences with organism name or function labels attached.








Figure 3 shows the MG-RAST API Explorer web interface and the creation of a metadata driven query.



We note that the API returns structured data in JSON format and  abundance tables in BIOM format [12]. While JSON is not particularly readable, there are plenty of tools to convert JSON into other formats, e.g. CSV for use in spreadsheets.


There are many tools to render or manipulate downloaded JSON data structures. See Figure 4 for an example with jq, a popular JSON rendering and filtering tool.




-->
The API is not limited to abundance and taxonomy tables; sequences labeled with unstructured, free-text functional annotations from included databases can also be listed or extracted. The matrix function of the API allows for merging information on taxonomy and function.

For more details see the API description itself, the API explorer manuscript or our user manual.



Comments