-
Notifications
You must be signed in to change notification settings - Fork 3
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 refactor-enums-sex-phenotypestatus
# Conflicts: # cg/cli/add.py # tests/conftest.py
- Loading branch information
Showing
160 changed files
with
3,166 additions
and
1,431 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
52 changes: 52 additions & 0 deletions
52
alembic/versions/2024_05_16_6e6c36d5157b_add_illumina_run_metrics.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,52 @@ | ||
"""add_illumina_run_metrics | ||
Revision ID: 6e6c36d5157b | ||
Revises: 5c6de08c4aca | ||
Create Date: 2024-05-16 13:40:36.754552 | ||
""" | ||
|
||
from enum import StrEnum | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "6e6c36d5157b" | ||
down_revision = "5c6de08c4aca" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.create_table( | ||
"illumina_sequencing_metrics", | ||
sa.Column( | ||
"id", sa.Integer(), sa.ForeignKey("run_metrics.id"), nullable=False, primary_key=True | ||
), | ||
sa.Column("sequencer_type", sa.String(length=32), nullable=True), | ||
sa.Column("sequencer_name", sa.String(length=32), nullable=True), | ||
sa.Column("sequenced_at", sa.DateTime(), nullable=True), | ||
sa.Column("data_availability", sa.String(length=32), nullable=True), | ||
sa.Column("archived_at", sa.DateTime(), nullable=True), | ||
sa.Column("has_backup", sa.Boolean(), nullable=False), | ||
sa.Column("total_reads", sa.BigInteger(), nullable=True), | ||
sa.Column("total_undetermined_reads", sa.BigInteger(), nullable=True), | ||
sa.Column("percent_q30", sa.Numeric(precision=6, scale=2), nullable=True), | ||
sa.Column("mean_quality_score", sa.Numeric(precision=6, scale=2), nullable=True), | ||
sa.Column("total_yield", sa.BigInteger(), nullable=True), | ||
sa.Column("yield_q30", sa.Numeric(precision=6, scale=2), nullable=True), | ||
sa.Column("cycles", sa.Integer(), nullable=True), | ||
sa.Column("demultiplexing_software", sa.String(length=32), nullable=True), | ||
sa.Column("demultiplexing_software_version", sa.String(length=32), nullable=True), | ||
sa.Column("sequencing_started_at", sa.DateTime(), nullable=True), | ||
sa.Column("sequencing_completed_at", sa.DateTime(), nullable=True), | ||
sa.Column("demultiplexing_started_at", sa.DateTime(), nullable=True), | ||
sa.Column("demultiplexing_completed_at", sa.DateTime(), nullable=True), | ||
) | ||
|
||
|
||
def downgrade(): | ||
|
||
op.drop_table("illumina_run_metrics") |
31 changes: 31 additions & 0 deletions
31
alembic/versions/2024_05_17_fe23de4ed528_add_illumina_flow_cell.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,31 @@ | ||
"""add_illumina_flow_cell | ||
Revision ID: fe23de4ed528 | ||
Revises: 6e6c36d5157b | ||
Create Date: 2024-05-17 15:09:12.088324 | ||
""" | ||
|
||
import sqlalchemy as sa | ||
|
||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "fe23de4ed528" | ||
down_revision = "6e6c36d5157b" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.create_table( | ||
"illumina_flow_cell", | ||
sa.Column( | ||
"id", sa.Integer(), sa.ForeignKey("run_device.id"), nullable=False, primary_key=True | ||
), | ||
sa.Column("model", sa.String(length=32), nullable=False), | ||
) | ||
|
||
|
||
def downgrade(): | ||
op.drop_table("illumina_flow_cell") |
143 changes: 143 additions & 0 deletions
143
alembic/versions/2024_05_21_5fd7e8758fb1_add_autoincrement_to_device_tables.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,143 @@ | ||
"""add_autoincrement_to_device_tables | ||
Revision ID: 5fd7e8758fb1 | ||
Revises: fe23de4ed528 | ||
Create Date: 2024-05-21 09:25:47.751986 | ||
""" | ||
|
||
import sqlalchemy as sa | ||
|
||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "5fd7e8758fb1" | ||
down_revision = "fe23de4ed528" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# Modify illumina flow cell primary key | ||
op.drop_constraint( | ||
constraint_name="illumina_flow_cell_ibfk_1", | ||
table_name="illumina_flow_cell", | ||
type_="foreignkey", | ||
) | ||
op.drop_constraint(constraint_name="fk_device_id", table_name="run_metrics", type_="foreignkey") | ||
op.execute("ALTER TABLE run_device MODIFY COLUMN id INT NOT NULL AUTO_INCREMENT") | ||
op.alter_column( | ||
"illumina_flow_cell", "model", existing_type=sa.String(length=32), nullable=True | ||
) | ||
op.create_foreign_key( | ||
constraint_name="fk_device_id", | ||
source_table="run_metrics", | ||
referent_table="run_device", | ||
local_cols=["device_id"], | ||
remote_cols=["id"], | ||
) | ||
op.create_foreign_key( | ||
constraint_name="illumina_flow_cell_ibfk_1", | ||
source_table="illumina_flow_cell", | ||
referent_table="run_device", | ||
local_cols=["id"], | ||
remote_cols=["id"], | ||
) | ||
|
||
# Modify run metrics primary key | ||
op.drop_constraint( | ||
constraint_name="illumina_sequencing_metrics_ibfk_1", | ||
table_name="illumina_sequencing_metrics", | ||
type_="foreignkey", | ||
) | ||
op.execute("ALTER TABLE run_metrics MODIFY COLUMN id INT NOT NULL AUTO_INCREMENT") | ||
op.create_foreign_key( | ||
constraint_name="illumina_sequencing_metrics_ibfk_1", | ||
source_table="illumina_sequencing_metrics", | ||
referent_table="run_metrics", | ||
local_cols=["id"], | ||
remote_cols=["id"], | ||
) | ||
op.create_foreign_key( | ||
constraint_name="fk_run_metrics_id", | ||
source_table="sample_run_metrics", | ||
referent_table="run_metrics", | ||
local_cols=["run_metrics_id"], | ||
remote_cols=["id"], | ||
) | ||
|
||
# Modify sample run metrics primary key | ||
op.drop_constraint( | ||
constraint_name="illumina_sample_run_metrics_ibfk_1", | ||
table_name="illumina_sample_run_metrics", | ||
type_="foreignkey", | ||
) | ||
op.execute("ALTER TABLE sample_run_metrics MODIFY COLUMN id INT NOT NULL AUTO_INCREMENT") | ||
op.create_foreign_key( | ||
constraint_name="illumina_sample_run_metrics_ibfk_1", | ||
source_table="illumina_sample_run_metrics", | ||
referent_table="sample_run_metrics", | ||
local_cols=["id"], | ||
remote_cols=["id"], | ||
) | ||
|
||
|
||
def downgrade(): | ||
# Downgrade illumina flow cell primary key | ||
op.drop_constraint( | ||
constraint_name="illumina_flow_cell_ibfk_1", | ||
table_name="illumina_flow_cell", | ||
type_="foreignkey", | ||
) | ||
op.drop_constraint(constraint_name="fk_device_id", table_name="run_metrics", type_="foreignkey") | ||
op.alter_column( | ||
"illumina_flow_cell", "model", existing_type=sa.String(length=32), nullable=False | ||
) | ||
op.execute("ALTER TABLE run_device MODIFY COLUMN id INT NOT NULL") | ||
op.create_foreign_key( | ||
constraint_name="fk_device_id", | ||
source_table="run_metrics", | ||
referent_table="run_device", | ||
local_cols=["device_id"], | ||
remote_cols=["id"], | ||
) | ||
op.create_foreign_key( | ||
constraint_name="illumina_flow_cell_ibfk_1", | ||
source_table="illumina_flow_cell", | ||
referent_table="run_device", | ||
local_cols=["id"], | ||
remote_cols=["id"], | ||
) | ||
|
||
# Downgrade illumina run metrics primary key | ||
op.drop_constraint( | ||
constraint_name="fk_run_metrics_id", table_name="sample_run_metrics", type_="foreignkey" | ||
) | ||
op.drop_constraint( | ||
constraint_name="illumina_sequencing_metrics_ibfk_1", | ||
table_name="illumina_sequencing_metrics", | ||
type_="foreignkey", | ||
) | ||
op.execute("ALTER TABLE run_metrics MODIFY COLUMN id INT NOT NULL") | ||
op.create_foreign_key( | ||
constraint_name="illumina_sequencing_metrics_ibfk_1", | ||
source_table="illumina_sequencing_metrics", | ||
referent_table="run_metrics", | ||
local_cols=["id"], | ||
remote_cols=["id"], | ||
) | ||
|
||
# Downgrade illumina run sample metrics primary key | ||
op.drop_constraint( | ||
constraint_name="illumina_sample_run_metrics_ibfk_1", | ||
table_name="illumina_sample_run_metrics", | ||
type_="foreignkey", | ||
) | ||
op.execute("ALTER TABLE sample_run_metrics MODIFY COLUMN id INT NOT NULL") | ||
op.create_foreign_key( | ||
constraint_name="illumina_sample_run_metrics_ibfk_1", | ||
source_table="illumina_sample_run_metrics", | ||
referent_table="sample_run_metrics", | ||
local_cols=["id"], | ||
remote_cols=["id"], | ||
) |
84 changes: 84 additions & 0 deletions
84
alembic/versions/2024_05_22_18e3b2aba252_add_yield_columns.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,84 @@ | ||
"""2024_05_22_add_yield_columns | ||
Revision ID: 18e3b2aba252 | ||
Revises: 5fd7e8758fb1 | ||
Create Date: 2024-05-22 14:01:15.197675 | ||
""" | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "18e3b2aba252" | ||
down_revision = "5fd7e8758fb1" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
|
||
# rename table IlluminaSampleRunMetrics to IlluminaSampleSequencingMetrics | ||
op.rename_table( | ||
old_table_name="illumina_sample_run_metrics", | ||
new_table_name="illumina_sample_sequencing_metrics", | ||
) | ||
# add column yield | ||
op.add_column( | ||
table_name="illumina_sample_sequencing_metrics", | ||
column=sa.Column("yield", sa.Integer(), nullable=True), | ||
) | ||
# add column yield_q30 | ||
op.add_column( | ||
table_name="illumina_sample_sequencing_metrics", | ||
column=sa.Column("yield_q30", sa.Float(), nullable=True), | ||
) | ||
# rename table run metrics to InstrumentRun | ||
op.rename_table( | ||
old_table_name="run_metrics", | ||
new_table_name="instrument_run", | ||
) | ||
# on SampleRunMetrics change run_metrics_id to instrument_run_id | ||
op.alter_column( | ||
table_name="sample_run_metrics", | ||
column_name="run_metrics_id", | ||
new_column_name="instrument_run_id", | ||
type_=sa.Integer(), | ||
) | ||
# rename illumina_sequencing_metrics to illumina_sequencing_run | ||
op.rename_table( | ||
old_table_name="illumina_sequencing_metrics", | ||
new_table_name="illumina_sequencing_run", | ||
) | ||
|
||
|
||
def downgrade(): | ||
# rename illumina_sequencing_metrics to illumina_sequencing_run | ||
op.rename_table( | ||
new_table_name="illumina_sequencing_metrics", | ||
old_table_name="illumina_sequencing_run", | ||
) | ||
|
||
# on SampleRunMetrics change run_metrics_id to instrument_run_id | ||
op.alter_column( | ||
table_name="sample_run_metrics", | ||
new_column_name="run_metrics_id", | ||
column_name="instrument_run_id", | ||
type_=sa.Integer(), | ||
) | ||
# rename run metrics -> InstrumentRun | ||
op.rename_table( | ||
new_table_name="run_metrics", | ||
old_table_name="instrument_run", | ||
) | ||
|
||
# drop columns yield and yield_q30 | ||
op.drop_column(table_name="illumina_sample_sequencing_metrics", column_name="yield") | ||
op.drop_column(table_name="illumina_sample_sequencing_metrics", column_name="yield_q30") | ||
|
||
# rename table IlluminaSampleSequencingMetrics to IlluminaSampleRunMetrics | ||
op.rename_table( | ||
new_table_name="illumina_sample_run_metrics", | ||
old_table_name="illumina_sample_sequencing_metrics", | ||
) |
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__ = "60.7.18" | ||
__version__ = "60.8.7" |
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.