API for Server Data Queries: Difference between revisions

From Eterna Wiki

No edit summary
(Friday afternoon update)
Line 4: Line 4:
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>Update: Justin says he'll return the old API, to preserve compatibility with existing scripts.&nbsp; Thanks, Justin!</strong></p>
<p><strong>Update: Justin says he'll return the old API, to preserve compatibility with existing scripts.&nbsp; Thanks, Justin!</strong></p>
<p>&nbsp;</p>
<p>Friday (5:50 PM PDT) update: My Data Mining Tool, which was broken by the change to the type=lab query, now works again.&nbsp; But I think Justin was probably especially careful about fixing the queries it uses.<strong>&nbsp; I advise anyone reading this to test any scripts they really care about, and if it is still broken, post here.&nbsp; Please describe the query URL, and what about the JSON is missing.</strong></p>
<p>The type=lab query returns less info than before, most notably the secondary structure.&nbsp; Here's a sample response now</p>
<p>[[User:Omei|Omei]] ([[User talk:Omei|talk]]) 01:30, 28 September 2013 (UTC)</p>
<p>{"data":{"lab":null,"comments":[{"cid":"29250","name":"ElNando888","uid":"49507","comment":"Voted.  Interesting project. Maybe in a subsequent experiment, it could be  expanded to the more generic GNRA form. Which prompts me that R (or Y or  M) constraints on individual bases do not exist (yet). I'll try to not  forget to ask for it in the upcoming dev chat.","created":"15 May  2013","picture":"sites\/default\/files\/pictures\/picture-49507.png"},{"cid":"29263","name":"wateronthemoon","uid":"57743","comment":"A  great fundamental question, noted in reviewing lab results. +1. (Now if  i can only figure out the rules to design something  too.)","created":"16 May  2013","picture":"sites\/default\/files\/pictures\/picture-57743.jpg"}],"supercomments":[{"cid":"29247","name":"Omei","uid":"57675","comment":"Seems  like it isn't possible to tell with the current UI, but the puzzle  submission has all the tetraloops locked into a GAAA  sequence.","created":"15 May  2013","picture":"sites\/default\/files\/pictures\/picture-57675.png"}],"num_slots":null,"num_synthesized":0,"follow":[{"nid":"2857463","uid":"57675","id":"2857430","updated_time":"1368649258","expired_time":null,"type":"node"}],"sum_picks":"40","num_solutions":null,"my_votes":0,"uid":"57675"},"memcache":true}</p>
<p>---</p>
<p>&nbsp;</p>
<h3>type=past-labs: New fields are needed to access the thumbnail images<strong> (change)<br /></strong></h3>
<p>To get the secondary structure, there's a new type=lab_puzzle that starts out with</p>
<p>I note two related changes here, but I wouldn't consider asking Justin t change it for my scripts.&nbsp; They seem like a reasonable step in moving forward.</p>
<p>&nbsp;</p>
<ol>
<p>{"data":{"puzzle":{"nid":"2857430","title":"The GAAA  loop","secstruct":"((.(((((....))))).(((((....)).((((....)))).)))..))..(((....))).(((((((....))))))).","rna_type":"single","object":null,"cover_image":null,"num_slots":"40","synthesized_solutions":[{"title":"GAAA  Loop 2z","id":"2872419","created":"1369076516","body":"No  comment","sequence":"GGAAAGCAGAUGGGAAACCAUCAGGCCGGAAACGAGCAGGAAACUGCAGCCAAGCAAGCGGAAACGCAGAGUACCUUCGGGUACUCAAAAGAAACAACAACAACAAC","puznid":"2857430","name":"Zanna","uid":"87216","picture":"sites\/default\/files\/pictures\/picture-87216.jpg","synthesis-score":"93","synthesis-round":"1","submitted-round":"1","gu":"0","gc":"20","au":"6","meltpoint":"107.00","energy":"-51.1","SHAPE":"1,  0.708, 0.7335, 1.1768, 0.6047, 0.7158, 0.3601, 0.3418, 0.4304, 0.1566,  0.0495, 0.0165, 0.0989, 0.033, 0.1972, 0.7872, 0.3466, 0.4178, 0.0321,  0.0161, 0.0139, 0.039, 0.2145, 0.2653, 0.6008, 0.3247, 0.1176, 0.0845,  0.2583, 0.9568, 1.2771, 1.2119, 0.4502, 0.2249, 0.9119, 1.175, 0.1892,  0.1214, 0.1837, 0.2113, 0.5323, 1.2314, 0.7564, 0.5279, 0.1902, 0.1093,  0.0402, 0.0689, 0.2536, 0.5254, 0.1629, 0.2216, 0.6726, 1.0855, 0.5482,  0.6624, 0.9893, 1.084, 0.2315, 0.0854, 0.3391, 0.1929, 1.099, 0.8844,  0.3507, 0.1385, 0.0801, 0.3576, 0.586, 0.1796, 0.0631, 0.021, 0.0457,  0.1595, 0.0436, 0.2587, 0.5577, 0.2353, 0.3346, 0,  0","SHAPE-threshold":"0.388","SHAPE-max":"0.712","SHAPE-min":"0.065","synthesis-data":"[{\"start_index\":1,\"target_index\":0,\"reactive\":\"SHAPE\", ...</p>
<li>The thumbnail images have been moved to Amazon's S3 service.&nbsp; The thumbnails don't exist at their old location.&nbsp; This breaks scripts that displayed the thumbnails, like my took that creates the list of past labs here on the wiki.&nbsp; But moving them to Amazon seems good, so I'm just going to update that script.</li>
<p>&nbsp;</p>
<li>The format of the type=past-labs query (e.g. <a href="http://eterna.cmu.edu/get/?type=past_labs&amp;skip=0&amp;size=21">http://eterna.cmu.edu/get/?type=past_labs&amp;skip=0&amp;size=21</a> response has changed.&nbsp; It may well be completely backward compatible; I'm not sure because I don't have a complete record of what it was.&nbsp; But as it stands now, a solution has a field named "puzzles", which is an array of objects.&nbsp; Each element of the array is an object which has a field also called "puzzles", which is also an array.&nbsp; Each element of this array is a nid which seems to correspond to a secondary structure, because the query "<span style="color: #222222; font-family: Consolas, 'Lucida Console', monospace; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: auto; word-spacing: 0px; background-color: #ffffff; display: inline !important; float: none;">https://s3.amazonaws.com/eterna/puzzle_mid_thumbnails/thumbnail&lt;nid&gt;.png" returns a thumbnail image of the target structure for that lab. I think this new level of indirection is there to support labs that allow sequences with differernt lengths and target structures. The reproducibility lab is one example, but I remember Rhiju talking about supporting this, long before the reproducibility lab came into being.</span></li>
</ol>
<p>[[User:Omei|Omei]] ([[User talk:Omei|talk]]) 01:30, 28 September 2013 (UTC)</p>

Revision as of 01:30, 28 September 2013

The intent for this page is to document the RESTful interface to the Eterna data.

 

For the moment,  this is focused on documenting the 9/26 changes that broke a bunch of existing scripts.

 

Update: Justin says he'll return the old API, to preserve compatibility with existing scripts.  Thanks, Justin!

Friday (5:50 PM PDT) update: My Data Mining Tool, which was broken by the change to the type=lab query, now works again.  But I think Justin was probably especially careful about fixing the queries it uses.  I advise anyone reading this to test any scripts they really care about, and if it is still broken, post here.  Please describe the query URL, and what about the JSON is missing.

Omei (talk) 01:30, 28 September 2013 (UTC)

---

type=past-labs: New fields are needed to access the thumbnail images (change)

I note two related changes here, but I wouldn't consider asking Justin t change it for my scripts.  They seem like a reasonable step in moving forward.

  1. The thumbnail images have been moved to Amazon's S3 service.  The thumbnails don't exist at their old location.  This breaks scripts that displayed the thumbnails, like my took that creates the list of past labs here on the wiki.  But moving them to Amazon seems good, so I'm just going to update that script.
  2. The format of the type=past-labs query (e.g. <a href="http://eterna.cmu.edu/get/?type=past_labs&skip=0&size=21">http://eterna.cmu.edu/get/?type=past_labs&skip=0&size=21</a> response has changed.  It may well be completely backward compatible; I'm not sure because I don't have a complete record of what it was.  But as it stands now, a solution has a field named "puzzles", which is an array of objects.  Each element of the array is an object which has a field also called "puzzles", which is also an array.  Each element of this array is a nid which seems to correspond to a secondary structure, because the query "https://s3.amazonaws.com/eterna/puzzle_mid_thumbnails/thumbnail<nid>.png" returns a thumbnail image of the target structure for that lab. I think this new level of indirection is there to support labs that allow sequences with differernt lengths and target structures. The reproducibility lab is one example, but I remember Rhiju talking about supporting this, long before the reproducibility lab came into being.

Omei (talk) 01:30, 28 September 2013 (UTC)