-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into balsamic_v16
- Loading branch information
Showing
141 changed files
with
3,822 additions
and
890 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
50 changes: 50 additions & 0 deletions
50
alembic/versions/2024_08_09_7770dcad8bde_rename_order_status.py
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
"""Rename order status | ||
Revision ID: 7770dcad8bde | ||
Revises: bb4c6dbad991 | ||
Create Date: 2024-08-09 09:47:47.814700 | ||
""" | ||
|
||
import sqlalchemy as sa | ||
from sqlalchemy import orm | ||
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column | ||
|
||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "7770dcad8bde" | ||
down_revision = "bb4c6dbad991" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
class Base(DeclarativeBase): | ||
pass | ||
|
||
|
||
class Order(Base): | ||
__tablename__ = "order" | ||
|
||
id: Mapped[int] = mapped_column(primary_key=True) | ||
is_open: Mapped[str] | ||
|
||
|
||
def upgrade(): | ||
op.alter_column( | ||
table_name="order", column_name="is_delivered", type_=sa.Boolean, new_column_name="is_open" | ||
) | ||
bind = op.get_bind() | ||
session = orm.Session(bind=bind) | ||
for order in session.query(Order).all(): | ||
order.is_open = not order.is_open | ||
session.commit() | ||
|
||
|
||
def downgrade(): | ||
bind = op.get_bind() | ||
session = orm.Session(bind=bind) | ||
for order in session.query(Order).all(): | ||
order.is_open = not order.is_open | ||
session.commit() | ||
op.alter_column( | ||
table_name="order", new_column_name="is_delivered", type_=sa.Boolean, column_name="is_open" | ||
) |
169 changes: 169 additions & 0 deletions
169
alembic/versions/2024_09_11_18dbadd8c436_rename_fastq_to_raw_data.py
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 |
---|---|---|
@@ -0,0 +1,169 @@ | ||
"""rename_fastq_to_raw_data | ||
Revision ID: 18dbadd8c436 | ||
Revises: bb4c6dbad991 | ||
Create Date: 2024-09-11 13:15:11.876822 | ||
""" | ||
|
||
from enum import StrEnum | ||
|
||
from sqlalchemy import orm | ||
from sqlalchemy.dialects import mysql | ||
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column | ||
|
||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "18dbadd8c436" | ||
down_revision = "7770dcad8bde" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
base_options = ( | ||
"balsamic", | ||
"balsamic-pon", | ||
"balsamic-qc", | ||
"balsamic-umi", | ||
"demultiplex", | ||
"fluffy", | ||
"jasen", | ||
"microsalt", | ||
"mip-dna", | ||
"mip-rna", | ||
"mutant", | ||
"raredisease", | ||
"rnafusion", | ||
"rsync", | ||
"spring", | ||
"taxprofiler", | ||
"tomte", | ||
) | ||
old_options = sorted(base_options + ("fastq",)) | ||
new_options = sorted(base_options + ("raw-data",)) | ||
|
||
old_enum = mysql.ENUM(*old_options) | ||
new_enum = mysql.ENUM(*new_options) | ||
|
||
|
||
class Workflow(StrEnum): | ||
BALSAMIC: str = "balsamic" | ||
BALSAMIC_PON: str = "balsamic-pon" | ||
BALSAMIC_QC: str = "balsamic-qc" | ||
BALSAMIC_UMI: str = "balsamic-umi" | ||
DEMULTIPLEX: str = "demultiplex" | ||
FLUFFY: str = "fluffy" | ||
JASEN: str = "jasen" | ||
MICROSALT: str = "microsalt" | ||
MIP_DNA: str = "mip-dna" | ||
MIP_RNA: str = "mip-rna" | ||
MUTANT: str = "mutant" | ||
RAREDISEASE: str = "raredisease" | ||
RAW_DATA: str = "raw-data" | ||
RNAFUSION: str = "rnafusion" | ||
RSYNC: str = "rsync" | ||
SPRING: str = "spring" | ||
TAXPROFILER: str = "taxprofiler" | ||
TOMTE: str = "tomte" | ||
|
||
|
||
class Base(DeclarativeBase): | ||
pass | ||
|
||
|
||
class Case(Base): | ||
__tablename__ = "case" | ||
id: Mapped[int] = mapped_column(primary_key=True) | ||
data_analysis: Mapped[str | None] | ||
|
||
|
||
class Analysis(Base): | ||
__tablename__ = "analysis" | ||
|
||
id: Mapped[int] = mapped_column(primary_key=True) | ||
workflow: Mapped[str | None] | ||
|
||
|
||
class Order(Base): | ||
__tablename__ = "order" | ||
id: Mapped[int] = mapped_column(primary_key=True) | ||
workflow: Mapped[str | None] | ||
|
||
|
||
class ApplicationLimitations(Base): | ||
__tablename__ = "application_limitations" | ||
id: Mapped[int] = mapped_column(primary_key=True) | ||
workflow: Mapped[str | None] | ||
|
||
|
||
def upgrade(): | ||
bind = op.get_bind() | ||
session = orm.Session(bind=bind) | ||
try: | ||
# Case | ||
op.alter_column("case", "data_analysis", type_=mysql.VARCHAR(64), existing_nullable=True) | ||
session.query(Case).filter(Case.data_analysis == "fastq").update( | ||
{"data_analysis": Workflow.RAW_DATA}, synchronize_session="evaluate" | ||
) | ||
op.alter_column("case", "data_analysis", type_=new_enum, existing_nullable=True) | ||
# Analysis | ||
op.alter_column("analysis", "workflow", type_=mysql.VARCHAR(64), existing_nullable=True) | ||
session.query(Analysis).filter(Analysis.workflow == "fastq").update( | ||
{"workflow": Workflow.RAW_DATA}, synchronize_session="evaluate" | ||
) | ||
op.alter_column("analysis", "workflow", type_=new_enum, existing_nullable=True) | ||
# Order | ||
op.alter_column("order", "workflow", type_=mysql.VARCHAR(64), existing_nullable=True) | ||
session.query(Order).filter(Order.workflow == "fastq").update( | ||
{"workflow": Workflow.RAW_DATA}, synchronize_session="evaluate" | ||
) | ||
op.alter_column("order", "workflow", type_=new_enum, existing_nullable=True) | ||
# Application Limitation | ||
op.alter_column( | ||
"application_limitations", "workflow", type_=mysql.VARCHAR(64), existing_nullable=True | ||
) | ||
session.query(ApplicationLimitations).filter( | ||
ApplicationLimitations.workflow == "fastq" | ||
).update({"workflow": Workflow.RAW_DATA}, synchronize_session="evaluate") | ||
op.alter_column( | ||
"application_limitations", "workflow", type_=new_enum, existing_nullable=True | ||
) | ||
session.commit() | ||
finally: | ||
session.close() | ||
|
||
|
||
def downgrade(): | ||
bind = op.get_bind() | ||
session = orm.Session(bind=bind) | ||
try: | ||
# Case | ||
op.alter_column("case", "data_analysis", type_=mysql.VARCHAR(64), existing_nullable=True) | ||
session.query(Case).filter(Case.data_analysis == Workflow.RAW_DATA).update( | ||
{"data_analysis": "fastq"}, synchronize_session="evaluate" | ||
) | ||
op.alter_column("case", "data_analysis", type_=old_enum, existing_nullable=True) | ||
# Analysis | ||
op.alter_column("analysis", "workflow", type_=mysql.VARCHAR(64), existing_nullable=True) | ||
session.query(Analysis).filter(Analysis.workflow == Workflow.RAW_DATA).update( | ||
{"workflow": "fastq"}, synchronize_session="evaluate" | ||
) | ||
op.alter_column("analysis", "workflow", type_=old_enum, existing_nullable=True) | ||
# Order | ||
op.alter_column("order", "workflow", type_=mysql.VARCHAR(64), existing_nullable=True) | ||
session.query(Order).filter(Order.workflow == Workflow.RAW_DATA).update( | ||
{"workflow": "fastq"}, synchronize_session="evaluate" | ||
) | ||
op.alter_column("order", "workflow", type_=old_enum, existing_nullable=True) | ||
# Application Limitation | ||
op.alter_column( | ||
"application_limitations", "workflow", type_=mysql.VARCHAR(64), existing_nullable=True | ||
) | ||
session.query(ApplicationLimitations).filter( | ||
ApplicationLimitations.workflow == Workflow.RAW_DATA | ||
).update({"workflow": "fastq"}, synchronize_session="evaluate") | ||
op.alter_column( | ||
"application_limitations", "workflow", type_=old_enum, existing_nullable=True | ||
) | ||
session.commit() | ||
finally: | ||
session.close() |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
__title__ = "cg" | ||
__version__ = "63.0.1" | ||
__version__ = "63.2.11" |
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
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 was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.