Entities¶
-
class
pyclarity_lims.entities.Artifact(lims, uri=None, id=None, _create_new=False)[source]¶ Bases:
pyclarity_lims.entities.EntityAny process input or output; analyte or file.
-
concentration¶ _
-
container¶ The container where the artifact is located, or None
-
location¶ The Artifact’s location in a container.
-
name¶ The name of the artifact.
-
output_type¶ The output-type of the Artifact
-
parent_process¶ The
parent processthat generated this artfact.
-
qc_flag¶ The qc-flag applied to the Artifact.
-
reagent_labels¶ List of
Reagent labelsassociated with the artifact.
-
state¶ Parse out the state value from the URI.
-
stateless¶ Return the artifact independently of its state
-
type¶ The type of the artifact: Analyte, ResultFile or SharedResultFile.
-
udf¶ Dictionary of UDFs associated with the artifact.
-
volume¶ _
-
workflow_stages_and_statuses¶ List of tuples containing three elements (A, B, C) where:
- A is a
Stepthis artifact has run through. - B is the status of said Step.
- C the name of the Step.
- A is a
-
working_flag¶ The working-flag of the Artifact.
-
-
class
pyclarity_lims.entities.Container(lims, uri=None, id=None, _create_new=False)[source]¶ Bases:
pyclarity_lims.entities.EntityContainer for analyte artifacts.
-
get_placements()[source]¶ Get the dictionary of locations and artifacts using the more efficient batch call.
-
name¶ Name of the container
-
occupied_wells¶ Number of wells occupied in the container.
-
placements¶ Dictionary of placements in a Container. The key is the location such as “A:1” and the value is the artifact in that well/tube.
-
state¶ State of the container. e.g. Populated
-
udf¶ Dictionary of UDFs associated with the container.
-
udt¶ Dictionary of UDTs associated with the container.
-
-
class
pyclarity_lims.entities.Containertype(lims, uri=None, id=None, _create_new=False)[source]¶ Bases:
pyclarity_lims.entities.EntityType of container for analyte artifacts.
-
calibrant_wells¶ If there are any wells on this container that are use for calibration. They would be defined here.
-
name¶ Name of the type of container (Tube, 96 well plates, …)
If there are any well on this container that should not be used. They would be defined here.
-
x_dimension¶ Number of position on the x axis
-
y_dimension¶ Number of position on the y axis
-
-
class
pyclarity_lims.entities.Entity(lims, uri=None, id=None, _create_new=False)[source]¶ Bases:
objectBase abstract class for every entity in the LIMS database. An Entity corresponds to an XML document and as such it should have at least a uri or an id.
-
classmethod
create(lims, **kwargs)[source]¶ Create an instance from attributes then post it to the LIMS
-
id¶ Return the LIMS id; obtained from the URI.
-
uri¶
-
classmethod
-
class
pyclarity_lims.entities.File(lims, uri=None, id=None, _create_new=False)[source]¶ Bases:
pyclarity_lims.entities.EntityFile attached to a project or a sample.
-
attached_to¶ The uri of the Entity this file is attached to
-
content_location¶ The location of the file on the server
-
is_published¶ Whether the file is published or not
-
original_location¶ The original location of the file when it was uploaded
-
-
class
pyclarity_lims.entities.Lab(lims, uri=None, id=None, _create_new=False)[source]¶ Bases:
pyclarity_lims.entities.EntityA lab is a list of researchers.
-
billing_address¶ Billing address of the lab
-
externalids¶ List of external identifiers associated with the lab
-
name¶ Name of the lab
-
shipping_address¶ Shipping address of the lab
-
udf¶ Dictionary of UDFs associated with the Lab
-
udt¶ Dictionary of UDTs associated with the Lab
-
website¶ URL to the lab website
-
-
class
pyclarity_lims.entities.Note(lims, uri=None, id=None, _create_new=False)[source]¶ Bases:
pyclarity_lims.entities.EntityNote attached to a project or a sample.
-
content¶ The content of the note
-
-
class
pyclarity_lims.entities.Process(lims, uri=None, id=None, _create_new=False)[source]¶ Bases:
pyclarity_lims.entities.EntityProcess (instance of Processtype) executed producing ouputs from inputs.
-
all_inputs(unique=True, resolve=False)[source]¶ Retrieving all input artifacts from input_output_maps. If unique is true, no duplicates are returned.
Parameters: - unique – boolean specifying if the list of artifacts should be uniqued
- resolve – boolean specifying if the artifacts entities should be resolved through a batch query.
Returns: list of input artifacts.
-
all_outputs(unique=True, resolve=False)[source]¶ Retrieving all output artifacts from input_output_maps. If unique is true, no duplicates are returned.
Parameters: - unique – boolean specifying if the list of artifacts should be uniqued
- resolve – boolean specifying if the artifact entities should be resolved through a batch query.
Returns: list of output artifacts.
-
analytes()[source]¶ Retrieving the output Analytes of the process, if existing. If the process is not producing any output analytes, the input analytes are returned. Input/Output is returned as an information string. Makes aggregate processes and normal processes look the same.
-
date_run¶ The date at which the process was finished in format Year-Month-Day i.e. 2016-12-05.
-
input_output_maps¶ List of tuples (input, output) where input and output item are dictionaries representing the input/output. Keys of the dict can be:
for the input:
for the output:
- uri: output
Artifact - limsid: id of the Artifact generated
- output-generation-type: type of output generation (example: PerInput)
- output-type: type of artifact generated (Analyte, or ResultFile)
- uri: output
-
input_per_sample(sample)[source]¶ Getting all the input artifacts derived from the specified sample
Parameters: sample – the sample name to check against Returns: list of input artifacts matching the sample name
-
outputs_per_input(inart, ResultFile=False, SharedResultFile=False, Analyte=False)[source]¶ Getting all the output artifacts related to a particular input artifact
Parameters: - inart – input artifact id or artifact entity use to select the output
- ResultFile – boolean specifying to only return ResultFiles.
- SharedResultFile – boolean specifying to only return SharedResultFiles.
- Analyte – boolean specifying to only return Analytes.
Returns: output artifact corresponding to the input artifact provided
-
process_parameter¶ Parameter for the process
-
protocol_name¶ The name of the protocol
-
result_files(output_generation_type=None)[source]¶ Retrieve all output artifacts where output-type is ResultFile.
Parameters: output_generation_type – string specifying the output-generation-type (PerAllInputs or PerInput) Returns: list of output artifacts.
Retrieve all output artifacts where output-type is SharedResultFile.
Parameters: output_generation_type – string specifying the output-generation-type (PerAllInputs or PerInput) Returns: list of output artifacts.
-
step¶ Retrieve the Step corresponding to this process. They share the same id
-
technician¶ The
researcherthat started the step.
-
udf¶ Dictionary of UDFs associated with the process.
Note that the UDFs cannot be modify in Process. Use
Step detailsto modify UDFs instead. You can access them with process.step.details.udf
-
udt¶ Dictionary of UDTs associated with the process.
-
-
class
pyclarity_lims.entities.Processtype(lims, uri=None, id=None, _create_new=False)[source]¶ Bases:
pyclarity_lims.entities.Entity-
name¶ Name of the process type.
-
-
class
pyclarity_lims.entities.Project(lims, uri=None, id=None, _create_new=False)[source]¶ Bases:
pyclarity_lims.entities.EntityProject concerning a number of samples; associated with a researcher.
-
close_date¶ The date at which the project was closed in format Year-Month-Day i.e. 2016-12-05.
-
externalids¶ List of external identifiers associated with the project
-
files¶ List of files attached to the project
-
invoice_date¶ The date at which the project was invoiced in format Year-Month-Day i.e. 2016-12-05.
-
name¶ The name of the project.
-
open_date¶ The date at which the project was opened in format Year-Month-Day i.e. 2016-12-05.
-
researcher¶ The researcher associated with the project.
-
udf¶ Dictionary of UDFs associated with the project
-
udt¶ Dictionary of UDTs associated with the project
-
-
class
pyclarity_lims.entities.Protocol(lims, uri=None, id=None, _create_new=False)[source]¶ Bases:
pyclarity_lims.entities.EntityProtocol, holding ProtocolSteps and protocol-properties
-
properties¶ List of dicts describing the protocol’s property.
-
-
class
pyclarity_lims.entities.ProtocolStep(lims, uri=None, id=None, _create_new=False)[source]¶ Bases:
pyclarity_lims.entities.EntitySteps key in the Protocol object
-
epp_triggers¶ List of dicts describing the EPP trigger attached to this step.
-
name¶ Name of the step
-
permitted_containers¶ List of names for the permitted container type in that step.
-
queue¶ The queue associated with this protocol step. The link is possible because they share the same id.
-
queue_fields¶ List of dicts describing the fields available in that step’s queue.
-
sample_fields¶ List of dicts describing the field available in that step’s sample view.
-
step_fields¶ List of dicts describing the fields available in that step’s UDF.
-
step_properties¶ List of dicts describing the properties of this step.
-
type¶ Processtypeassociated with this step.
-
-
class
pyclarity_lims.entities.Queue(lims, uri=None, id=None, _create_new=False)[source]¶ Bases:
pyclarity_lims.entities.EntityQueue of a given workflow stage
-
class
pyclarity_lims.entities.ReagentKit(lims, uri=None, id=None, _create_new=False)[source]¶ Bases:
pyclarity_lims.entities.EntityType of Reagent with information about the provider
-
archived¶ Whether the reagent kit is archived or not
-
name¶ Name of the reagent kit
-
supplier¶ Supplier for the reagent kit
-
website¶ Website associated with the reagent kit
-
-
class
pyclarity_lims.entities.ReagentLot(lims, uri=None, id=None, _create_new=False)[source]¶ Bases:
pyclarity_lims.entities.EntityInformation about a particular regaent lot used in a step
-
created_by¶ Researcherthat created that lot.
-
created_date¶ The date at which the lot was created in format Year-Month-Day i.e. 2016-12-05.
-
expiry_date¶ The date at which the lot expires in format Year-Month-Day i.e. 2016-12-05.
-
last_modified_by¶ Researcherthat last modified this lot.
-
last_modified_date¶ The date at which the lot was last modified in format Year-Month-Day i.e. 2016-12-05.
-
lot_number¶ Lot number
-
name¶ Name of the reagent lot
-
reagent_kit¶ Reagent kitassociated with this lot.
-
status¶ Status of the lot.
-
usage_count¶ Number of times the lot was used.
-
-
class
pyclarity_lims.entities.ReagentType(lims, uri=None, id=None)[source]¶ Bases:
pyclarity_lims.entities.EntityReagent Type, usually indexes for sequencing
-
category¶ Reagent category associated with the type
-
name¶ Name of the reagent type.
-
-
class
pyclarity_lims.entities.Reagent_label(lims, uri=None, id=None, _create_new=False)[source]¶ Bases:
pyclarity_lims.entities.EntityReagent label element
-
reagent_label¶ The reagent label
-
-
class
pyclarity_lims.entities.Researcher(lims, uri=None, id=None, _create_new=False)[source]¶ Bases:
pyclarity_lims.entities.EntityPerson; client scientist or lab personnel. Associated with a lab.
-
email¶ Email of the researcher
-
externalids¶ List of external identifiers associated with the researcher
-
fax¶ Fax number of the researcher
-
first_name¶ First name of the researcher
-
initials¶ Initials of the researcher
-
lab¶ Lab associated with the researcher
-
last_name¶ Last name of the researcher
-
name¶ Complete name of the researcher
-
phone¶ Phone number of the researcher
-
udf¶ Dictionary of UDFs associated with the researcher
-
udt¶ Dictionary of UDTs associated with the researcher
-
-
class
pyclarity_lims.entities.Sample(lims, uri=None, id=None, _create_new=False)[source]¶ Bases:
pyclarity_lims.entities.EntityCustomer’s sample to be analyzed; associated with a project.
-
classmethod
create(lims, container, position, **kwargs)[source]¶ Create an instance of Sample from attributes then post it to the LIMS
-
date_completed¶ The date at which the sample was completed in format Year-Month-Day i.e. 2016-12-05.
-
date_received¶ The date at which the sample was received in format Year-Month-Day i.e. 2016-12-05.
-
externalids¶ List of external identifiers associated with the sample
-
files¶ List of files associated with the sample.
-
name¶ Name of the sample.
-
notes¶ List of notes associated with the sample.
-
project¶ The project associated with that sample.
-
submitter¶ The researcher who submitted this sample.
-
udf¶ Dictionary of UDFs associated with the sample.
-
udt¶ Dictionary of UDTs associated with the sample.
-
classmethod
-
class
pyclarity_lims.entities.Stage(lims, uri=None, id=None, _create_new=False)[source]¶ Bases:
pyclarity_lims.entities.EntityHolds Protocol/Workflow
-
index¶ Position of the stage in the protocol.
-
name¶ Name of the stage.
-
-
class
pyclarity_lims.entities.Step(lims, uri=None, id=None, _create_new=False)[source]¶ Bases:
pyclarity_lims.entities.EntityStep, as defined by the genologics API.
-
actions¶ Link to the
StepActionsentity
-
available_programs¶ List of available programs to trigger. Each element is a tuple with the name and the trigger uri
-
configuration¶ Step configurationassociated with the step.
-
classmethod
create(lims, protocol_step, inputs, container_type_name=None, reagent_category=None, replicates=1, **kwargs)[source]¶ Create a new instance of a Step. This method will start a step from queued artifacts.
Parameters: - lims – Lims connection object
- protocol_step – the
ProtocolStepspecifying the step to start. - inputs – A list of
artifactsas input to the step. These need to be queued for that step for the query to be successful. - container_type_name – optional name of the type of container that this step use for its output. if omitted it uses the required type from the ProtocolStep if there is only one.
- reagent_category – optional reagent_category.
- replicates – int or list of ints specifying the number of replicates for each inputs.
-
current_state¶ The current state of the step.
-
date_completed¶ The date at which the step completed in format Year-Month-DayTHour:Min:Sec, e.g. 2016-11-22T10:43:32.857+00:00
-
date_started¶ The date at which the step started in format Year-Month-DayTHour:Min:Sec, e.g. 2016-11-22T10:43:32.857+00:00
-
details¶ Link to the
StepDetailsentity
-
placements¶ Link to the
StepPlacementsentity
-
process¶ Retrieve the Process corresponding to this Step. They share the same id
-
program_names¶ List of available program names.
-
program_status¶ Link to the
StepProgramStatusentity
-
reagent_lots¶ List of reagent lots
-
set_placements(output_containers, output_placement_list)[source]¶ Create a new placement for a new step. This method also modifies the selected containers with the provided output container. It is meant to be used with a newly created step that does not have a placement yet.
Parameters: - output_containers – List of
Containersused to store the output artifacts. - output_placement_list –
List of tuples (A, (B, C)) where:
- output_containers – List of
-
-
class
pyclarity_lims.entities.StepActions(lims, uri=None, id=None, _create_new=False)[source]¶ Bases:
pyclarity_lims.entities.EntityActions associated with the end of the step
-
escalation¶
-
next_actions¶ - List of dicts that represent an action for an artifact. They keys of the dict are:
- artifact: The
artifactassociated with this Action - step: The next
stepassociated with this action - rework-step: The
stepassociated with this action when the Artifact needs to be requeued - action: The type of action to perform.
- leave: Leave the sample in the QC protocol.
- repeat: Repeat this step.
- remove: Remove from workflow.
- review: Request manager review.
- complete: Mark protocol as complete.
- store: Store for later.
- nextstep: Continue to the next step.
- rework: Rework from an earlier step.
- completerepeat: Complete and Repeat
- unknown: The action is unknown.
- artifact: The
-
-
class
pyclarity_lims.entities.StepDetails(lims, uri=None, id=None, _create_new=False)[source]¶ Bases:
pyclarity_lims.entities.EntityDetails associated with a step
-
input_output_maps¶ List of tuples (input, output) where input and output item are dictionaries representing the input/output. Keys of the dict can be:
- for the output:
- uri: output
Artifact - limsid: id of the Artifact generated
- output-generation-type: type of output generation (example: PerInput)
- output-type: type of artifact generated (Analyte, or ResultFile)
- uri: output
-
udf¶ Dictionary of UDFs associated with the step
-
udt¶ Dictionary of UDTs associated with the step
-
-
class
pyclarity_lims.entities.StepPlacements(lims, uri=None, id=None, _create_new=False)[source]¶ Bases:
pyclarity_lims.entities.EntityPlacements from within a step. Supports POST
-
placement_list¶ List of tuples (A, (B, C)) where:
-
selected_containers¶ List of
containers
-
-
class
pyclarity_lims.entities.StepPools(lims, uri=None, id=None, _create_new=False)[source]¶ Bases:
pyclarity_lims.entities.Entity-
available_inputs¶ List of artifact available for pooling.
Note that adding artifacts to a pool will not remove them from this list until put() is run.
-
pooled_inputs¶ Dictionary where the keys are the pool names and the values are tuples (pool, inputs) representing a pool. Each tuple has two elements:
- an output Artifact containing the pool.
- a tuple containing the input artifacts for that pool.
-
-
class
pyclarity_lims.entities.StepProgramStatus(lims, uri=None, id=None, _create_new=False)[source]¶ Bases:
pyclarity_lims.entities.EntityStatus displayed in the step
-
message¶ Message returned by the program
-
status¶ Status of the program
-
-
class
pyclarity_lims.entities.StepReagentLots(lims, uri=None, id=None, _create_new=False)[source]¶ Bases:
pyclarity_lims.entities.Entity-
reagent_lots¶ List of
ReagentLots
-
-
class
pyclarity_lims.entities.Udfconfig(lims, uri=None, id=None, _create_new=False)[source]¶ Bases:
pyclarity_lims.entities.EntityInstance of field type (cnf namespace).
-
allow_non_preset_values¶ Whether the UDF allows presets.
-
attach_to_category¶ _
-
attach_to_name¶ Name of entity type the UDF is attached to.
-
first_preset_is_default_value¶ Whether the first preset of the UDF is the default value.
-
is_controlled_vocabulary¶ Whether the UDF has a controled vocabulary.
-
is_deviation¶ Whether the UDF is a deviation.
-
is_editable¶ Whether the UDF is editable.
-
name¶ Name of the UDF.
-
presets¶ List of presets.
-
show_in_lablink¶ Whether this UDF will be shown in lablink.
-
show_in_tables¶ Whether the UDF can be shown in a table.
-
-
class
pyclarity_lims.entities.Workflow(lims, uri=None, id=None, _create_new=False)[source]¶ Bases:
pyclarity_lims.entities.EntityWorkflow, introduced in 3.5
-
name¶ Name of the workflow.
-
status¶ Status of the workflow.
-