Import results through requests
Results may be displayed in pATLAS through a certain route that allow users to send a POST
request. Then users will be provided with a unique url for each dictionary / JSON object sent via the POST
request. This unique url can be used as a link from other resources, such as webpages or even command line tools.
How to send results to pATLAS through POST request
TL;DR
Explanation
In the above example we are sending a post request using python
requests module. Any other language can be used to send this kind of POST
. The only requirements are:
Send the post to
http://www.patlas.site/results/
.Send a
json
with the request. Thisjson
must contain a dictionary,with two keys:
type
: required for pATLAS to recognize the type of import.Available options:
mapping
,mash_screen
andassembly
. It mustbe a string, otherwise an error will be returned from the request.
samples
: An object (dictionary) that contains as keys eachsample and each sample key has as values a dictionary similar to
the one used in import results from files for each
type of import.
Then, if everything seems suitable for pATLAS database to receive the POST
request, the entry will be stored in a database and a unique url will be returned as a response to the POST
.
Lifetime of database entries
Each successful POST
request will be stored in pATLAS database for 1 day. During this period the link can be shared with other users.
How can I visualize results after that period?
There are basically two options to visualize the results after it has been deleted from the database:
1) Send a new POST
request similar to the previous one. This will be the most common use case, where other applications send these POST
s when users are analyzing results. Given that POST
s generate a unique hash, if for some reason a duplicated post is made it will not be added twice to the database. It will return the same url and the routing will properly handle the exception.
2) Import results using the import from file menus.
Last updated