Skip to content

Commit

Permalink
Delete old flow cell before adding re-demultiplexed flow cell (#2593)…
Browse files Browse the repository at this point in the history
…(minor))

### Changed
- Removed `Delete_flow_cell_API`
- Removed the `cg demultiplex delete-flow-cell` CLI command
- No longer checks for active cases before removing stuff (Does one not always want to restart with new data?)
#### Before post-processing:
- The sequencing_metrics are removed from status_db
- The sequencing files (FASTQ, SPRING, SPRING-metadata) are removed from housekeeper and disk
  • Loading branch information
diitaz93 authored Dec 8, 2023
1 parent 13e4682 commit e53a094
Show file tree
Hide file tree
Showing 12 changed files with 197 additions and 926 deletions.
2 changes: 0 additions & 2 deletions cg/cli/demultiplex/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
confirm_flow_cell_sync,
copy_novaseqx_flow_cells,
create_manifest_files,
delete_flow_cell,
demultiplex_all,
demultiplex_flow_cell,
)
Expand All @@ -27,7 +26,6 @@ def demultiplex_cmd_group():
for sub_cmd in [
create_manifest_files,
confirm_flow_cell_sync,
delete_flow_cell,
demultiplex_flow_cell,
demultiplex_all,
finish_group,
Expand Down
61 changes: 0 additions & 61 deletions cg/cli/demultiplex/demux.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
)
from cg.constants.demultiplexing import OPTION_BCL_CONVERTER, DemultiplexingDirsAndFiles
from cg.exc import FlowCellError
from cg.meta.demultiplex.delete_demultiplex_api import DeleteDemuxAPI
from cg.meta.demultiplex.utils import (
create_manifest_file,
is_flow_cell_sync_confirmed,
Expand Down Expand Up @@ -121,66 +120,6 @@ def demultiplex_flow_cell(
)


@click.command(name="delete-flow-cell")
@click.option(
"-f",
"--flow-cell-name",
required=True,
help="The name of the flow cell you want to delete, e.g. HVKJCDRXX",
)
@click.option(
"--demultiplexing-dir", is_flag=True, help="Delete flow cell demultiplexed dir on file system"
)
@click.option("--housekeeper", is_flag=True, help="Delete flow cell in housekeeper")
@click.option("--init-files", is_flag=True, help="Delete flow cell init-files")
@click.option("--run-dir", is_flag=True, help="Delete flow cell run on file system")
@click.option(
"--sample-lane-sequencing-metrics",
is_flag=True,
help="Delete flow cell in sample lane sequencing metrics",
)
@click.option(
"--status-db",
is_flag=True,
help="Delete flow cell in status-db, if passed all other entries are also deleted",
)
@click.option("--yes", is_flag=True, help="Pass yes to click confirm")
@DRY_RUN
@click.pass_obj
def delete_flow_cell(
context: CGConfig,
dry_run: bool,
demultiplexing_dir: bool,
housekeeper: bool,
init_files: bool,
run_dir: bool,
sample_lane_sequencing_metrics: bool,
status_db: bool,
yes: bool,
flow_cell_name: str,
):
"""Delete a flow cell. If --status-db is passed then all other options will be treated as True."""

delete_demux_api: DeleteDemuxAPI = DeleteDemuxAPI(
config=context, dry_run=dry_run, flow_cell_name=flow_cell_name
)

if yes or click.confirm(
f"Are you sure you want to delete the flow cell from the following databases:\n"
f"Housekeeper={True if status_db else housekeeper}\nInit_files={True if status_db else init_files}\n"
f"Run-dir={True if status_db else run_dir}\nStatusdb={status_db}\n"
f"\nSample-lane-sequencing-metrics={True if sample_lane_sequencing_metrics else sample_lane_sequencing_metrics}"
):
delete_demux_api.delete_flow_cell(
demultiplexing_dir=demultiplexing_dir,
housekeeper=housekeeper,
init_files=init_files,
sample_lane_sequencing_metrics=sample_lane_sequencing_metrics,
run_dir=run_dir,
status_db=status_db,
)


@click.command(name="copy-completed-flow-cell")
@click.pass_obj
def copy_novaseqx_flow_cells(context: CGConfig):
Expand Down
279 changes: 0 additions & 279 deletions cg/meta/demultiplex/delete_demultiplex_api.py

This file was deleted.

Loading

0 comments on commit e53a094

Please sign in to comment.