Skip to content

Commit

Permalink
add new process udf to arnold (#535)(patch)
Browse files Browse the repository at this point in the history
### Added
- New process UDF 'Hamilton instrument' for the TWIST Arnold docs
  • Loading branch information
Karl-Svard authored Sep 26, 2024
1 parent c656c42 commit 61fa9b5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cg_lims/EPPs/udf/calculate/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
calculate_average_size_and_set_qc,
)
from cg_lims.EPPs.udf.calculate.calculate_beads import calculate_beads
from cg_lims.EPPs.udf.calculate.calculate_buffer import volume_buffer
from cg_lims.EPPs.udf.calculate.calculate_microbial_aliquot_volumes import (
calculate_microbial_aliquot_volumes,
)
from cg_lims.EPPs.udf.calculate.calculate_resuspension_buffer_volumes import (
calculate_resuspension_buffer_volume,
)
from cg_lims.EPPs.udf.calculate.calculate_saphyr_concentration import calculate_saphyr_concentration
from cg_lims.EPPs.udf.calculate.calculate_buffer import volume_buffer
from cg_lims.EPPs.udf.calculate.calculate_water_volume_rna import calculate_water_volume_rna
from cg_lims.EPPs.udf.calculate.get_missing_reads import get_missing_reads
from cg_lims.EPPs.udf.calculate.library_normalization import library_normalization
Expand Down
30 changes: 23 additions & 7 deletions cg_lims/EPPs/udf/calculate/calculate_buffer.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
"""CLI module for calculating beads volumes"""

import logging
import sys
from typing import List

import click
from genologics.entities import Artifact

from cg_lims import options
from cg_lims.exceptions import LimsError, MissingUDFsError
from cg_lims.get.artifacts import get_artifacts
from genologics.entities import Artifact

LOG = logging.getLogger(__name__)

Expand All @@ -18,8 +18,13 @@ def calculate_buffer_volume(sample_volume: float, sample_volume_limit: float) ->
return sample_volume_limit - sample_volume if sample_volume < sample_volume_limit else 0.0


def calculate_volumes(artifacts: List[Artifact], total_volume_udf: str,
volume_udf: str, buffer_udf: str, sample_volume_limit: float):
def calculate_volumes(
artifacts: List[Artifact],
total_volume_udf: str,
volume_udf: str,
buffer_udf: str,
sample_volume_limit: float,
):
"""Calculates buffer volume and total volume"""

missing_udfs = 0
Expand Down Expand Up @@ -56,7 +61,13 @@ def calculate_volumes(artifacts: List[Artifact], total_volume_udf: str,
@options.buffer_udf()
@options.sample_volume_limit()
@click.pass_context
def volume_buffer(context: click.Context, total_volume_udf: str, volume_udf: str, buffer_udf: str, sample_volume_limit: float):
def volume_buffer(
context: click.Context,
total_volume_udf: str,
volume_udf: str,
buffer_udf: str,
sample_volume_limit: float,
):
"""Buffer volume calculation."""

LOG.info(f"Running {context.command_path} with params: {context.params}")
Expand All @@ -65,8 +76,13 @@ def volume_buffer(context: click.Context, total_volume_udf: str, volume_udf: str

try:
artifacts: List[Artifact] = get_artifacts(process=process, input=False)
calculate_volumes(artifacts=artifacts, total_volume_udf=total_volume_udf,
volume_udf=volume_udf, buffer_udf=buffer_udf, sample_volume_limit=sample_volume_limit)
calculate_volumes(
artifacts=artifacts,
total_volume_udf=total_volume_udf,
volume_udf=volume_udf,
buffer_udf=buffer_udf,
sample_volume_limit=sample_volume_limit,
)
message = "Volumes have been calculated."
LOG.info(message)
click.echo(message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class ProcessUDFs(BaseModel):
GMSlymphoid_HD829: Optional[str] = Field(None, alias="Batch no GMSlymphoid-HD829")
GMSmyeloid_HD829: Optional[str] = Field(None, alias="Batch no GMSmyeloid-HD829")
GMSsolid_HD832: Optional[str] = Field(None, alias="Batch no GMSsolid-HD832")
hamilton_instrument: Optional[str] = Field(None, alias="Hamilton instrument")
aliquot_samples_library_preparation_method_2: Optional[str] = Field(
None, alias="Method document 2"
)
Expand Down

0 comments on commit 61fa9b5

Please sign in to comment.