{"_id":"562e652656486b0d00e3dc05","category":{"_id":"562d4dcc8c6e5a0d00d6ed1d","__v":5,"pages":["562d4df5e01a430d00c2c821","562d4f7ae01a430d00c2c823","562d514e54a5be0d00070b3d","562da6b1e01a430d00c2c873","562e652656486b0d00e3dc05"],"project":"5476bf0f817e8d080031f988","version":"5476bf10817e8d080031f98b","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-10-25T21:46:52.564Z","from_sync":false,"order":6,"slug":"command-line-interface","title":"Command-Line Interface"},"project":"5476bf0f817e8d080031f988","user":"5476beec817e8d080031f986","version":{"_id":"5476bf10817e8d080031f98b","__v":17,"project":"5476bf0f817e8d080031f988","createdAt":"2014-11-27T06:05:04.263Z","releaseDate":"2014-11-27T06:05:04.263Z","categories":["5476bf10817e8d080031f98c","5477c46cf3736008009e9eb5","5477c474f3736008009e9eb6","5477c47ef3736008009e9eb7","5477c48ff3736008009e9eb8","5477c4948deb230800808bf0","54e68328154f8e0d0007b55c","54e90194c8e0c00d007ac061","54eed2275bf74a0d00ef4076","54f7a7be0a3cbb0d00d666fb","559b0ebf7ae7f80d0096d871","55d697f9ae529e0d00d34f03","562d4dcc8c6e5a0d00d6ed1d","562e591c4376430d006f17e0","568f0e73bdb9260d00149d8c","5719542aac1e2e0e001834c6","57a14a8ed778850e0047e230"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"parentDoc":null,"__v":1,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-10-26T17:38:46.745Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"The command-line tool can be used to submit Autoprotocol to Transcriptic to launch runs. To analyze some Autoprotocol JSON, you can simply copy it to your clipboard and run:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"pbpaste | transcriptic analyze\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nIt is also useful for submitting one-off scripts written using [the Autoprotocol Python Library](https://github.com/autoprotocol/autoprotocol-python) that print out their protocol, like:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"import json\\nfrom autoprotocol.protocol import Protocol\\n\\np = Protocol()\\n\\nbacterial_sample = p.ref(\\\"bacteria\\\", None, \\\"micro-1.5\\\", discard=True)\\ntest_plate = p.ref(\\\"test_plate\\\", None, \\\"96-flat\\\", storage=\\\"cold_4\\\")\\n\\np.dispense_full_plate(test_plate, \\\"lb-broth-noAB\\\", \\\"50:microliter\\\")\\nw = 0\\namt = 1\\nwhile amt < 20:\\n  p.transfer(bacterial_sample.well(0), test_plate.well(w), \\\"%d:microliter\\\" % amt)\\n  amt += 2\\n  w +=1\\n\\nprint json.dumps(p.as_dict(), indent=2)\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\nto view the JSON output of this script, simply run `python my_script.py` on the command line.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"refs\\\": {\\n    \\\"bacteria\\\": {\\n      \\\"new\\\": \\\"micro-1.5\\\", \\n      \\\"discard\\\": true\\n    }, \\n    \\\"test_plate\\\": {\\n      \\\"new\\\": \\\"96-flat\\\", \\n      \\\"store\\\": {\\n        \\\"where\\\": \\\"cold_4\\\"\\n      }\\n    }\\n  }, \\n  \\\"instructions\\\": [\\n    {\\n      \\\"reagent\\\": \\\"lb-broth-noAB\\\", \\n      \\\"object\\\": \\\"test_plate\\\", \\n      \\\"columns\\\": [\\n        {\\n          \\\"column\\\": 0, \\n          \\\"volume\\\": \\\"50:microliter\\\"\\n        }, \\n        {\\n          \\\"column\\\": 1, \\n          \\\"volume\\\": \\\"50:microliter\\\"\\n        }, \\n        {\\n          \\\"column\\\": 2, \\n          \\\"volume\\\": \\\"50:microliter\\\"\\n        }, \\n ...\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nTo analyze the output of this script and see how much it will cost to run:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ python my_script.py | transcriptic analyze\\n  ✓ Protocol analyzed\\n  2 instructions\\n  2 containers\\n  $9.70\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nThen, to submit it and launch the run:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ python my_script.py | transcriptic submit --project <project_id> --title \\\"my cool run\\\" \",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nAfter a run is submitted, it will be scheduled and executed on a [workcell](https://www.transcriptic.com/workcells/).\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"Your project's id can be found in its URL when viewing it on the Transcriptic website, or you can run `transcriptic projects` on the command line to see a list of your organization's projects, their titles and and their ids\"\n}\n[/block]","excerpt":"","slug":"example-workflow","type":"basic","title":"Example Command Line Workflow"}

Example Command Line Workflow


The command-line tool can be used to submit Autoprotocol to Transcriptic to launch runs. To analyze some Autoprotocol JSON, you can simply copy it to your clipboard and run: [block:code] { "codes": [ { "code": "pbpaste | transcriptic analyze", "language": "shell" } ] } [/block] It is also useful for submitting one-off scripts written using [the Autoprotocol Python Library](https://github.com/autoprotocol/autoprotocol-python) that print out their protocol, like: [block:code] { "codes": [ { "code": "import json\nfrom autoprotocol.protocol import Protocol\n\np = Protocol()\n\nbacterial_sample = p.ref(\"bacteria\", None, \"micro-1.5\", discard=True)\ntest_plate = p.ref(\"test_plate\", None, \"96-flat\", storage=\"cold_4\")\n\np.dispense_full_plate(test_plate, \"lb-broth-noAB\", \"50:microliter\")\nw = 0\namt = 1\nwhile amt < 20:\n p.transfer(bacterial_sample.well(0), test_plate.well(w), \"%d:microliter\" % amt)\n amt += 2\n w +=1\n\nprint json.dumps(p.as_dict(), indent=2)", "language": "python" } ] } [/block] to view the JSON output of this script, simply run `python my_script.py` on the command line. [block:code] { "codes": [ { "code": "{\n \"refs\": {\n \"bacteria\": {\n \"new\": \"micro-1.5\", \n \"discard\": true\n }, \n \"test_plate\": {\n \"new\": \"96-flat\", \n \"store\": {\n \"where\": \"cold_4\"\n }\n }\n }, \n \"instructions\": [\n {\n \"reagent\": \"lb-broth-noAB\", \n \"object\": \"test_plate\", \n \"columns\": [\n {\n \"column\": 0, \n \"volume\": \"50:microliter\"\n }, \n {\n \"column\": 1, \n \"volume\": \"50:microliter\"\n }, \n {\n \"column\": 2, \n \"volume\": \"50:microliter\"\n }, \n ...", "language": "json" } ] } [/block] To analyze the output of this script and see how much it will cost to run: [block:code] { "codes": [ { "code": "$ python my_script.py | transcriptic analyze\n ✓ Protocol analyzed\n 2 instructions\n 2 containers\n $9.70", "language": "shell" } ] } [/block] Then, to submit it and launch the run: [block:code] { "codes": [ { "code": "$ python my_script.py | transcriptic submit --project <project_id> --title \"my cool run\" ", "language": "shell" } ] } [/block] After a run is submitted, it will be scheduled and executed on a [workcell](https://www.transcriptic.com/workcells/). [block:callout] { "type": "warning", "body": "Your project's id can be found in its URL when viewing it on the Transcriptic website, or you can run `transcriptic projects` on the command line to see a list of your organization's projects, their titles and and their ids" } [/block]