Skip to content

Commit

Permalink
add(fields to pacbio sample) (#3826) (patch)
Browse files Browse the repository at this point in the history
# Description

add fields to pacbio orderin
  • Loading branch information
ChrOertlin authored Oct 14, 2024
1 parent d545379 commit 5e2b3ad
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
6 changes: 5 additions & 1 deletion cg/models/orders/samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,12 @@ def str_to_int(cls, v: str) -> int | None:
class PacBioSample(OrderInSample):
_suitable_project = OrderType.PACBIO_LONG_READ

capture_kit: str | None = None
buffer: str
container: ContainerEnum
container_name: str | None = None
sex: SexEnum = SexEnum.unknown
source: str
subject_id: str
tumour: bool


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def order_to_status(order: OrderIn) -> dict:
"samples": [
{
"application": sample.application,
"capture_kit": sample.capture_kit,
"comment": sample.comment,
"data_analysis": sample.data_analysis,
"data_delivery": sample.data_delivery,
Expand All @@ -52,6 +51,7 @@ def order_to_status(order: OrderIn) -> dict:
"sex": sample.sex,
"tumour": sample.tumour,
"volume": sample.volume,
"subject_id": sample.subject_id,
}
for sample in order.samples
],
Expand Down Expand Up @@ -79,7 +79,7 @@ def _store_samples_in_statusdb(
original_ticket=ticket_id,
priority=sample["priority"],
tumour=sample["tumour"],
capture_kit=sample["capture_kit"],
subject_id=sample["subject_id"],
)
new_sample.customer = customer
application_tag: str = sample["application"]
Expand Down
8 changes: 6 additions & 2 deletions tests/fixtures/cgweb_orders/pacbio.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"source": "blood",
"tumour": false,
"volume": "25",
"well_position": ""
"well_position": "",
"buffer": "Nuclease-free water",
"subject_id": "subject2"
},
{
"application": "WGSPCFC060",
Expand All @@ -33,7 +35,9 @@
"source": "cell line",
"tumour": true,
"volume": "35",
"well_position": ""
"well_position": "",
"buffer": "Nuclease-free water",
"subject_id": "subject1"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@
def pacbio_sample() -> PacBioSample:
return PacBioSample(
application="WGSPCFC060",
capture_kit=None,
data_analysis=Workflow.RAW_DATA,
data_delivery=DataDelivery.NO_DELIVERY,
name="PacbioSample",
sex=SexEnum.unknown,
tumour=False,
volume="50",
buffer="buffer",
source="source",
subject_id="subject_id",
container="Tube",
)


Expand Down

0 comments on commit 5e2b3ad

Please sign in to comment.