class Role(Entity): """Clarity Role, hosting permissions""" name = StringDescriptor('name') researchers = NestedEntityListDescriptor('researcher', Researcher, 'researchers') permissions = NestedEntityListDescriptor('permission', Permission, 'permissions')
class Workflow(Entity): """ Workflow, introduced in 3.5""" _URI = "configuration/workflows" _TAG = "workflow" name = StringAttributeDescriptor("name") status = StringAttributeDescriptor("status") protocols = NestedEntityListDescriptor('protocol', Protocol, 'protocols') stages = NestedEntityListDescriptor('stage', Stage, 'stages')
class Queue(Entity): """Queue of a given step""" _URI = "queues" _TAG = "queue" _PREFIX = "que" artifacts = NestedEntityListDescriptor("artifact", Artifact, "artifacts")
class Protocol(Entity): """Protocol, holding ProtocolSteps and protocol-properties""" _URI = 'configuration/protocols' _TAG = 'protocol' steps = NestedEntityListDescriptor('step', ProtocolStep, 'steps') properties = NestedAttributeListDescriptor('protocol-property', 'protocol-properties')
class Automation(Entity): """Automation, holding Automation configurations""" _URI = 'configuration/automations' _TAG = 'automation' process_types = NestedEntityListDescriptor('process-type', Processtype, 'process-types') string = NestedStringDescriptor('string') name = StringAttributeDescriptor('name') context = NestedStringDescriptor('context')
class ProtocolStep(Entity): """Steps key in the Protocol object""" _TAG = 'step' name = StringAttributeDescriptor("name") type = EntityDescriptor('process-type', Processtype) permittedcontainers = NestedStringListDescriptor('container-type', 'permitted-containers') permitted_control_types = NestedEntityListDescriptor( 'control-type', ControlType, 'permitted-control-types') required_reagent_kits = NestedEntityListDescriptor( 'reagent-kit', ReagentKit, 'required-reagent-kits') queue_fields = NestedAttributeListDescriptor('queue-field', 'queue-fields') step_fields = NestedAttributeListDescriptor('step-field', 'step-fields') sample_fields = NestedAttributeListDescriptor('sample-field', 'sample-fields') step_properties = NestedAttributeListDescriptor('step-property', 'step-properties') epp_triggers = NestedAttributeListDescriptor('epp-trigger', 'epp-triggers')
class StepReagentLots(Entity): reagent_lots = NestedEntityListDescriptor('reagent-lot', ReagentLot, 'reagent-lots')
super(ReagentType, self).__init__(lims, uri, id) assert self.uri is not None self.root = lims.get(self.uri) self.sequence = None for t in self.root.findall('special-type'): if t.attrib.get("name") == "Index": for child in t.findall("attribute"): if child.attrib.get("name") == "Sequence": self.sequence = child.attrib.get("value") class Queue(Entity): """Queue of a given step. Will recursively get all the pages of artifacts, and therefore, can be quite slow to load""" _URI = "queues" _TAG = "queue" _PREFIX = "que" artifacts = MultiPageNestedEntityListDescriptor("artifact", Artifact, "artifacts") Sample.artifact = EntityDescriptor('artifact', Artifact) StepActions.step = EntityDescriptor('step', Step) Stage.workflow = EntityDescriptor('workflow', Workflow) Artifact.workflow_stages = NestedEntityListDescriptor('workflow-stage', Stage, 'workflow-stages') Step.configuration = EntityDescriptor('configuration', ProtocolStep) StepProgramStatus.configuration = EntityDescriptor('configuration', ProtocolStep) Researcher.roles = NestedEntityListDescriptor('role', Role, 'credentials')
category = StringDescriptor('reagent-category') def __init__(self, lims, uri=None, id=None): super(ReagentType, self).__init__(lims, uri, id) assert self.uri is not None self.root = lims.get(self.uri) self.sequence = None for t in self.root.findall('special-type'): if t.attrib.get("name") == "Index": for child in t.findall("attribute"): if child.attrib.get("name") == "Sequence": self.sequence = child.attrib.get("value") class Queue(Entity): """Queue of a given step""" _URI = "queues" _TAG = "queue" _PREFIX = "que" artifacts = NestedEntityListDescriptor("artifact", Artifact, "artifacts") Sample.artifact = EntityDescriptor('artifact', Artifact) StepActions.step = EntityDescriptor('step', Step) Stage.workflow = EntityDescriptor('workflow', Workflow) Artifact.workflow_stages = NestedEntityListDescriptor('workflow-stage', Stage, 'workflow-stages') Step.configuration = EntityDescriptor('configuration', ProtocolStep)