-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A class for aliquot table is added to mlwh ORM.
- Loading branch information
Showing
2 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,9 +18,12 @@ | |
# @author mgcam <[email protected]> | ||
|
||
import datetime | ||
import decimal | ||
from typing import List, Optional | ||
|
||
from sqlalchemy import ( | ||
DECIMAL, | ||
BigInteger, | ||
Computed, | ||
DateTime, | ||
Float, | ||
|
@@ -33,6 +36,7 @@ | |
from sqlalchemy.dialects.mysql import ( | ||
BIGINT, | ||
CHAR, | ||
DATETIME, | ||
INTEGER, | ||
SMALLINT, | ||
TEXT, | ||
|
@@ -190,6 +194,71 @@ class Sample(Base): | |
) | ||
|
||
|
||
class Aliquot(Base): | ||
__tablename__ = "aliquot" | ||
__table_args__ = ({"mysql_collate": "utf8_unicode_ci"},) | ||
|
||
id: Mapped[int] = mapped_column(BigInteger, primary_key=True) | ||
id_lims: Mapped[str] = mapped_column( | ||
VARCHAR(255), | ||
nullable=False, | ||
comment="The LIMS system that the aliquot was created in", | ||
) | ||
aliquot_uuid: Mapped[str] = mapped_column( | ||
VARCHAR(255), | ||
nullable=False, | ||
comment="The UUID of the aliquot in the LIMS system", | ||
) | ||
aliquot_type: Mapped[str] = mapped_column( | ||
VARCHAR(255), nullable=False, comment="The type of the aliquot" | ||
) | ||
source_type: Mapped[str] = mapped_column( | ||
VARCHAR(255), nullable=False, comment="The type of the source of the aliquot" | ||
) | ||
source_barcode: Mapped[str] = mapped_column( | ||
VARCHAR(255), nullable=False, comment="The barcode of the source of the aliquot" | ||
) | ||
sample_name: Mapped[str] = mapped_column( | ||
VARCHAR(255), | ||
nullable=False, | ||
comment="The name of the sample that the aliquot was created from", | ||
) | ||
used_by_type: Mapped[str] = mapped_column( | ||
VARCHAR(255), | ||
nullable=False, | ||
comment="The type of the entity that the aliquot is used by", | ||
) | ||
used_by_barcode: Mapped[str] = mapped_column( | ||
VARCHAR(255), | ||
nullable=False, | ||
comment="The barcode of the entity that the aliquot is used by", | ||
) | ||
volume: Mapped[decimal.Decimal] = mapped_column( | ||
DECIMAL(10, 2), comment="The volume of the aliquot (uL)" | ||
) | ||
last_updated: Mapped[datetime.datetime] = mapped_column( | ||
DATETIME(fsp=6), | ||
nullable=False, | ||
comment="The date and time that the aliquot was last updated", | ||
) | ||
recorded_at: Mapped[datetime.datetime] = mapped_column( | ||
DATETIME(fsp=6), | ||
nullable=False, | ||
comment="The date and time that the aliquot was recorded", | ||
) | ||
created_at: Mapped[datetime.datetime] = mapped_column( | ||
DATETIME(fsp=6), | ||
nullable=False, | ||
comment="The date and time that this record was created", | ||
) | ||
concentration: Mapped[Optional[decimal.Decimal]] = mapped_column( | ||
DECIMAL(10, 2), comment="The concentration of the aliquot (ng/ul)" | ||
) | ||
insert_size: Mapped[Optional[int]] = mapped_column( | ||
Integer, comment="The size of the insert in base pairs" | ||
) | ||
|
||
|
||
class Study(Base): | ||
__tablename__ = "study" | ||
__table_args__ = ( | ||
|