From 9ae144ab0d203c572d53c5b0cc95c75fd4230c9b Mon Sep 17 00:00:00 2001 From: joshhacksthings Date: Thu, 11 Mar 2021 15:21:14 -0800 Subject: [PATCH] add sample data, add generated containers attr, add tests --- test/sampledata/connection_test.py | 10 ++++++++++ transcriptic/jupyter/instruction.py | 1 + transcriptic/sampledata/_data/r123.json | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/test/sampledata/connection_test.py b/test/sampledata/connection_test.py index def95882..6dafdc2c 100644 --- a/test/sampledata/connection_test.py +++ b/test/sampledata/connection_test.py @@ -94,6 +94,16 @@ def test_jupyter_run(self): assert instructions.loc[0].Id == "i123" assert instructions.loc[1].Id == "i124" + # all instructions have a `generated_container` attribute, if none generated, it is empty list + expected_generated_containers = [ + {"id": "ct123", "label": "container_generated"} + ] + assert ( + instructions.loc[0].Instructions.generated_containers + == expected_generated_containers + ) + assert instructions.loc[1].Instructions.generated_containers == [] + data = run.data assert len(data) == 1 assert data.loc[0].Name == "OD600" diff --git a/transcriptic/jupyter/instruction.py b/transcriptic/jupyter/instruction.py index 17117420..8c0bace0 100644 --- a/transcriptic/jupyter/instruction.py +++ b/transcriptic/jupyter/instruction.py @@ -62,6 +62,7 @@ def __init__(self, attributes, connection=None): self.name = attributes["operation"]["op"] self.started_at = attributes["started_at"] self.completed_at = attributes["completed_at"] + self.generated_containers = attributes["generated_containers"] if len(attributes["warps"]) > 0: device_id_set = set( [warp["device_id"] for warp in self.attributes["warps"]] diff --git a/transcriptic/sampledata/_data/r123.json b/transcriptic/sampledata/_data/r123.json index acb74399..db9e491a 100644 --- a/transcriptic/sampledata/_data/r123.json +++ b/transcriptic/sampledata/_data/r123.json @@ -1 +1 @@ -{"id":"r123","status":"complete","title":"Sample Run","created_at":"2020-05-20T14:57:29.230-07:00","updated_at":"2020-06-01T15:39:55.132-07:00","completed_at":"2020-06-01T15:39:55.116-07:00","conversation_id":"conv123","quote":{"items":[{"cost":"96.09","quantity":1,"title":"Workcell Time","run_id":"r123","run_credit_applicable":true},{"cost":"7.35","quantity":1,"title":"Reagents & Consumables","run_id":"r123","run_credit_applicable":false}],"ppp":false},"results":{},"test_mode":false,"accepted_at":"2020-05-20T14:57:29.229-07:00","started_at":"2020-06-01T15:39:50.860-07:00","canceled_at":null,"aborted_at":null,"draft_quote":null,"progress":100,"protocol_id":null,"request_type":"protocol","launch_request_id":null,"flagged":false,"scheduled_to_start_at":null,"properties":{},"internal_run":true,"bsl":1,"success":null,"success_notes":null,"total_cost":"103.44","has_quote?":true,"can_cancel?":false,"warnings":[],"pending_shipment_ids":[],"billing_valid?":true,"unrealized_input_containers":[],"dependents":[],"datasets":[{"id":"d123","warp_id":"w124","created_at":"2020-06-01T15:40:55.044-07:00","data_type":"platereader","instruction_id":"i124","attachments":[],"title":null,"deleted_at":null,"deletion_requested":false,"run_id":null,"uploaded_by":null,"analysis_tool":null,"analysis_tool_version":null,"is_analysis":false}],"refs":[{"name":"Echo Source Plate","container_id":"ct123","new_container_type":"384-echo","destiny":{"store":{"where":"cold_4","shaking":false}},"container_type":{"id":"384-echo","name":"384-Well Echo Qualified Polypropylene Microplate 2.0","well_count":384,"well_depth_mm":"11.5","well_volume_ul":"135.0","capabilities":["spin","incubate","seal","image_plate","stamp","echo_dest","echo_source","dispense-destination","envision"],"shortname":"384-echo","col_count":24,"is_tube":false,"acceptable_lids":["universal","foil","ultra-clear"],"height_mm":"14.4","vendor":"Labcyte","catalog_number":"PP-0200","retired_at":null,"sale_price":"0.0"},"container":{"id":"ct123","container_type_id":"384-echo","barcode":null,"deleted_at":null,"created_at":"2020-05-20T14:57:29.261-07:00","organization_id":"org123","slot":null,"cover":null,"test_mode":false,"label":"Echo Source Plate","location_id":"loc1bv7bn3sc37v","shipment_id":null,"kit_request_id":null,"storage_condition":"cold_4","shipment_code":null,"status":"available","expires_at":null,"aliquot_count":1,"container_type":{"id":"384-echo","name":"384-Well Echo Qualified Polypropylene Microplate 2.0","well_count":384,"well_depth_mm":"11.5","well_volume_ul":"135.0","capabilities":["spin","incubate","seal","image_plate","stamp","echo_dest","echo_source","dispense-destination","envision"],"shortname":"384-echo","col_count":24,"is_tube":false,"acceptable_lids":["universal","foil","ultra-clear"],"height_mm":"14.4","vendor":"Labcyte","catalog_number":"PP-0200","retired_at":null,"sale_price":"0.0"},"device":{"id":"wc7-handoff1","model":null,"manufacturer":null,"name":"wc7-handoff1","device_class":null,"configuration":{},"location_id":"loc1bv7bn3sc37v","serial_number":null,"purchased_at":null,"manufactured_at":null},"location":{"id":"loc1bv7bn3sc37v","created_at":"2018-08-23T17:12:04.841-07:00","updated_at":"2018-08-23T17:12:04.841-07:00","parent_id":"loc1bv7b4c5u2rb","name":"wc7-handoff1","position":null,"properties":{},"parent_path":["loc1bv7b4c5u2rb"],"merged_properties":{},"row":null,"col":null,"location_type":{"id":"loctyp1959vuy4482f","name":"Unknown","category":"Unknown","capacity":null,"created_at":"2016-06-21T16:30:16.096-07:00","updated_at":"2016-07-18T19:41:00.006-07:00","location_type_categories":[]},"ancestors":[{"id":"loc1bv7b4c5u2rb","parent_id":null,"name":"wc7-frontend1","position":null,"human_path":"wc7-frontend1"}]},"organization":{"id":"org123","name":"Sample Org","subdomain":"sample-org"}}},{"name":"VbottomPlate","container_id":"ct124","new_container_type":"96-well-v-bottom","destiny":{"store":{"where":"cold_4","shaking":false}},"container_type":{"id":"96-well-v-bottom","name":"96-well cell culture multiple well plate, V bottom","well_count":96,"well_depth_mm":"10.668","well_volume_ul":"200.0","capabilities":["dispense","spin","seal","unseal","liquid_handle","cover","echo_dest","spectrophotometry","image_plate","incubate","uncover","dispense-destination","envision","absorbance","fluorescence"],"shortname":"96-well-v-bottom","col_count":12,"is_tube":false,"acceptable_lids":["standard","universal","low_evaporation","ultra-clear","foil"],"height_mm":"3.25","vendor":"Corning","catalog_number":"3894","retired_at":null,"sale_price":"0.0"},"container":{"id":"ct124","container_type_id":"96-well-v-bottom","barcode":null,"deleted_at":null,"created_at":"2020-05-20T14:57:29.241-07:00","organization_id":"org123","slot":null,"cover":null,"test_mode":false,"label":"VbottomPlate","location_id":"loc1bv7bn3sc37v","shipment_id":null,"kit_request_id":null,"storage_condition":"cold_4","shipment_code":null,"status":"available","expires_at":null,"aliquot_count":9,"container_type":{"id":"96-well-v-bottom","name":"96-well cell culture multiple well plate, V bottom","well_count":96,"well_depth_mm":"10.668","well_volume_ul":"200.0","capabilities":["dispense","spin","seal","unseal","liquid_handle","cover","echo_dest","spectrophotometry","image_plate","incubate","uncover","dispense-destination","envision","absorbance","fluorescence"],"shortname":"96-well-v-bottom","col_count":12,"is_tube":false,"acceptable_lids":["standard","universal","low_evaporation","ultra-clear","foil"],"height_mm":"3.25","vendor":"Corning","catalog_number":"3894","retired_at":null,"sale_price":"0.0"},"device":{"id":"wc7-handoff1","model":null,"manufacturer":null,"name":"wc7-handoff1","device_class":null,"configuration":{},"location_id":"loc1bv7bn3sc37v","serial_number":null,"purchased_at":null,"manufactured_at":null},"location":{"id":"loc1bv7bn3sc37v","created_at":"2018-08-23T17:12:04.841-07:00","updated_at":"2018-08-23T17:12:04.841-07:00","parent_id":"loc1bv7b4c5u2rb","name":"wc7-handoff1","position":null,"properties":{},"parent_path":["loc1bv7b4c5u2rb"],"merged_properties":{},"row":null,"col":null,"location_type":{"id":"loctyp1959vuy4482f","name":"Unknown","category":"Unknown","capacity":null,"created_at":"2016-06-21T16:30:16.096-07:00","updated_at":"2016-07-18T19:41:00.006-07:00","location_type_categories":[]},"ancestors":[{"id":"loc1bv7b4c5u2rb","parent_id":null,"name":"wc7-frontend1","position":null,"human_path":"wc7-frontend1"}]},"organization":{"id":"org123","name":"Sample Org","subdomain":"sample-org"}}}],"owner":{"id":"u123","email":"sampler@sample-org.com","name":"Peter Peterson","profile_img_url":""},"project":{"id":"p123","name":"vbottoms","archived_at":null,"bsl":1,"organization":{"id":"org123","name":"Sample Org","subdomain":"sample-org"}},"successors":[],"instructions":[{"id":"i123","sequence_no":0,"operation":{"op":"acoustic_transfer","groups":[{"transfer":[{"from":"Echo Source Plate/0","to":"VbottomPlate/0","volume":"1000:nanoliter"}]}],"droplet_size":"25:nanoliter"},"completed_at":"2020-06-01T15:39:55.049-07:00","data_name":null,"started_at":"2020-06-01T15:39:50.873-07:00","warps":[{"id":"w123","device_id":"wc1-echo1","command":{"name":"AcousticLiquidHandler.Transfer","params":{"sourceContainer":{"id":"ct123","cType":"384-echo"},"destContainer":{"id":"ct124","cType":"96-well-v-bottom"},"transfers":[{"from":"0","to":"0","volume":"1000.0:nanoliter"}],"dataRef":"Echo Source Plate to VbottomPlate","dropletSize":"25.0:nanoliter"}},"state":"Completed","created_at":"2020-06-01T15:39:50.824-07:00","completed_at":"2020-06-01T15:39:55.044-07:00","nominal_duration":"00:00:05.31","min_duration":"00:00:00.81","max_duration":"00:00:11.31","reported_started_at":"2020-06-01T15:39:50.791-07:00","reported_completed_at":"2020-06-01T15:39:54.989-07:00","instruction_id":"i123","run_id":"r123"}]},{"id":"i124","sequence_no":1,"operation":{"op":"absorbance","object":"VbottomPlate","wells":["0","1","2","12","13","14","24","25","26"],"wavelength":"600:nanometer","num_flashes":25,"dataref":"OD600"},"completed_at":"2020-06-01T15:40:55.049-07:00","data_name":null,"started_at":"2020-06-01T15:40:50.873-07:00","warps":[{"id":"w124","device_id":"wc1-infinite1","command":{"name":"PlateReader.ReadAbsorbance","wavelength":"600:nanometer","numFlashes":25,"cType":"96-flat","wells":[0,1,2,12,13,14,24,25,26],"settleTime":"0.0:millisecond"},"state":"Completed","created_at":"2020-06-01T15:40:50.824-07:00","completed_at":"2020-06-01T15:40:55.044-07:00","nominal_duration":"00:00:05.31","min_duration":"00:00:00.81","max_duration":"00:00:11.31","reported_started_at":"2020-06-01T15:40:50.791-07:00","reported_completed_at":"2020-06-01T15:40:54.989-07:00","instruction_id":"i124","run_id":"r123"}]}]} +{"id":"r123","status":"complete","title":"Sample Run","created_at":"2020-05-20T14:57:29.230-07:00","updated_at":"2020-06-01T15:39:55.132-07:00","completed_at":"2020-06-01T15:39:55.116-07:00","conversation_id":"conv123","quote":{"items":[{"cost":"96.09","quantity":1,"title":"Workcell Time","run_id":"r123","run_credit_applicable":true},{"cost":"7.35","quantity":1,"title":"Reagents & Consumables","run_id":"r123","run_credit_applicable":false}],"ppp":false},"results":{},"test_mode":false,"accepted_at":"2020-05-20T14:57:29.229-07:00","started_at":"2020-06-01T15:39:50.860-07:00","canceled_at":null,"aborted_at":null,"draft_quote":null,"progress":100,"protocol_id":null,"request_type":"protocol","launch_request_id":null,"flagged":false,"scheduled_to_start_at":null,"properties":{},"internal_run":true,"bsl":1,"success":null,"success_notes":null,"total_cost":"103.44","has_quote?":true,"can_cancel?":false,"warnings":[],"pending_shipment_ids":[],"billing_valid?":true,"unrealized_input_containers":[],"dependents":[],"datasets":[{"id":"d123","warp_id":"w124","created_at":"2020-06-01T15:40:55.044-07:00","data_type":"platereader","instruction_id":"i124","attachments":[],"title":null,"deleted_at":null,"deletion_requested":false,"run_id":null,"uploaded_by":null,"analysis_tool":null,"analysis_tool_version":null,"is_analysis":false}],"refs":[{"name":"Echo Source Plate","container_id":"ct123","new_container_type":"384-echo","destiny":{"store":{"where":"cold_4","shaking":false}},"container_type":{"id":"384-echo","name":"384-Well Echo Qualified Polypropylene Microplate 2.0","well_count":384,"well_depth_mm":"11.5","well_volume_ul":"135.0","capabilities":["spin","incubate","seal","image_plate","stamp","echo_dest","echo_source","dispense-destination","envision"],"shortname":"384-echo","col_count":24,"is_tube":false,"acceptable_lids":["universal","foil","ultra-clear"],"height_mm":"14.4","vendor":"Labcyte","catalog_number":"PP-0200","retired_at":null,"sale_price":"0.0"},"container":{"id":"ct123","container_type_id":"384-echo","barcode":null,"deleted_at":null,"created_at":"2020-05-20T14:57:29.261-07:00","organization_id":"org123","slot":null,"cover":null,"test_mode":false,"label":"Echo Source Plate","location_id":"loc1bv7bn3sc37v","shipment_id":null,"kit_request_id":null,"storage_condition":"cold_4","shipment_code":null,"status":"available","expires_at":null,"aliquot_count":1,"container_type":{"id":"384-echo","name":"384-Well Echo Qualified Polypropylene Microplate 2.0","well_count":384,"well_depth_mm":"11.5","well_volume_ul":"135.0","capabilities":["spin","incubate","seal","image_plate","stamp","echo_dest","echo_source","dispense-destination","envision"],"shortname":"384-echo","col_count":24,"is_tube":false,"acceptable_lids":["universal","foil","ultra-clear"],"height_mm":"14.4","vendor":"Labcyte","catalog_number":"PP-0200","retired_at":null,"sale_price":"0.0"},"device":{"id":"wc7-handoff1","model":null,"manufacturer":null,"name":"wc7-handoff1","device_class":null,"configuration":{},"location_id":"loc1bv7bn3sc37v","serial_number":null,"purchased_at":null,"manufactured_at":null},"location":{"id":"loc1bv7bn3sc37v","created_at":"2018-08-23T17:12:04.841-07:00","updated_at":"2018-08-23T17:12:04.841-07:00","parent_id":"loc1bv7b4c5u2rb","name":"wc7-handoff1","position":null,"properties":{},"parent_path":["loc1bv7b4c5u2rb"],"merged_properties":{},"row":null,"col":null,"location_type":{"id":"loctyp1959vuy4482f","name":"Unknown","category":"Unknown","capacity":null,"created_at":"2016-06-21T16:30:16.096-07:00","updated_at":"2016-07-18T19:41:00.006-07:00","location_type_categories":[]},"ancestors":[{"id":"loc1bv7b4c5u2rb","parent_id":null,"name":"wc7-frontend1","position":null,"human_path":"wc7-frontend1"}]},"organization":{"id":"org123","name":"Sample Org","subdomain":"sample-org"}}},{"name":"VbottomPlate","container_id":"ct124","new_container_type":"96-well-v-bottom","destiny":{"store":{"where":"cold_4","shaking":false}},"container_type":{"id":"96-well-v-bottom","name":"96-well cell culture multiple well plate, V bottom","well_count":96,"well_depth_mm":"10.668","well_volume_ul":"200.0","capabilities":["dispense","spin","seal","unseal","liquid_handle","cover","echo_dest","spectrophotometry","image_plate","incubate","uncover","dispense-destination","envision","absorbance","fluorescence"],"shortname":"96-well-v-bottom","col_count":12,"is_tube":false,"acceptable_lids":["standard","universal","low_evaporation","ultra-clear","foil"],"height_mm":"3.25","vendor":"Corning","catalog_number":"3894","retired_at":null,"sale_price":"0.0"},"container":{"id":"ct124","container_type_id":"96-well-v-bottom","barcode":null,"deleted_at":null,"created_at":"2020-05-20T14:57:29.241-07:00","organization_id":"org123","slot":null,"cover":null,"test_mode":false,"label":"VbottomPlate","location_id":"loc1bv7bn3sc37v","shipment_id":null,"kit_request_id":null,"storage_condition":"cold_4","shipment_code":null,"status":"available","expires_at":null,"aliquot_count":9,"container_type":{"id":"96-well-v-bottom","name":"96-well cell culture multiple well plate, V bottom","well_count":96,"well_depth_mm":"10.668","well_volume_ul":"200.0","capabilities":["dispense","spin","seal","unseal","liquid_handle","cover","echo_dest","spectrophotometry","image_plate","incubate","uncover","dispense-destination","envision","absorbance","fluorescence"],"shortname":"96-well-v-bottom","col_count":12,"is_tube":false,"acceptable_lids":["standard","universal","low_evaporation","ultra-clear","foil"],"height_mm":"3.25","vendor":"Corning","catalog_number":"3894","retired_at":null,"sale_price":"0.0"},"device":{"id":"wc7-handoff1","model":null,"manufacturer":null,"name":"wc7-handoff1","device_class":null,"configuration":{},"location_id":"loc1bv7bn3sc37v","serial_number":null,"purchased_at":null,"manufactured_at":null},"location":{"id":"loc1bv7bn3sc37v","created_at":"2018-08-23T17:12:04.841-07:00","updated_at":"2018-08-23T17:12:04.841-07:00","parent_id":"loc1bv7b4c5u2rb","name":"wc7-handoff1","position":null,"properties":{},"parent_path":["loc1bv7b4c5u2rb"],"merged_properties":{},"row":null,"col":null,"location_type":{"id":"loctyp1959vuy4482f","name":"Unknown","category":"Unknown","capacity":null,"created_at":"2016-06-21T16:30:16.096-07:00","updated_at":"2016-07-18T19:41:00.006-07:00","location_type_categories":[]},"ancestors":[{"id":"loc1bv7b4c5u2rb","parent_id":null,"name":"wc7-frontend1","position":null,"human_path":"wc7-frontend1"}]},"organization":{"id":"org123","name":"Sample Org","subdomain":"sample-org"}}}],"owner":{"id":"u123","email":"sampler@sample-org.com","name":"Peter Peterson","profile_img_url":""},"project":{"id":"p123","name":"vbottoms","archived_at":null,"bsl":1,"organization":{"id":"org123","name":"Sample Org","subdomain":"sample-org"}},"successors":[],"instructions":[{"id":"i123","sequence_no":0,"operation":{"op":"acoustic_transfer","groups":[{"transfer":[{"from":"Echo Source Plate/0","to":"VbottomPlate/0","volume":"1000:nanoliter"}]}],"droplet_size":"25:nanoliter"},"generated_containers": [{"id": "ct123","label": "container_generated"}],"completed_at":"2020-06-01T15:39:55.049-07:00","data_name":null,"started_at":"2020-06-01T15:39:50.873-07:00","warps":[{"id":"w123","device_id":"wc1-echo1","command":{"name":"AcousticLiquidHandler.Transfer","params":{"sourceContainer":{"id":"ct123","cType":"384-echo"},"destContainer":{"id":"ct124","cType":"96-well-v-bottom"},"transfers":[{"from":"0","to":"0","volume":"1000.0:nanoliter"}],"dataRef":"Echo Source Plate to VbottomPlate","dropletSize":"25.0:nanoliter"}},"state":"Completed","created_at":"2020-06-01T15:39:50.824-07:00","completed_at":"2020-06-01T15:39:55.044-07:00","nominal_duration":"00:00:05.31","min_duration":"00:00:00.81","max_duration":"00:00:11.31","reported_started_at":"2020-06-01T15:39:50.791-07:00","reported_completed_at":"2020-06-01T15:39:54.989-07:00","instruction_id":"i123","run_id":"r123"}]},{"id":"i124","sequence_no":1,"operation":{"op":"absorbance","object":"VbottomPlate","wells":["0","1","2","12","13","14","24","25","26"],"wavelength":"600:nanometer","num_flashes":25,"dataref":"OD600"},"generated_containers": [],"completed_at":"2020-06-01T15:40:55.049-07:00","data_name":null,"started_at":"2020-06-01T15:40:50.873-07:00","warps":[{"id":"w124","device_id":"wc1-infinite1","command":{"name":"PlateReader.ReadAbsorbance","wavelength":"600:nanometer","numFlashes":25,"cType":"96-flat","wells":[0,1,2,12,13,14,24,25,26],"settleTime":"0.0:millisecond"},"state":"Completed","created_at":"2020-06-01T15:40:50.824-07:00","completed_at":"2020-06-01T15:40:55.044-07:00","nominal_duration":"00:00:05.31","min_duration":"00:00:00.81","max_duration":"00:00:11.31","reported_started_at":"2020-06-01T15:40:50.791-07:00","reported_completed_at":"2020-06-01T15:40:54.989-07:00","instruction_id":"i124","run_id":"r123"}]}]}