Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Nanopore) Check manifest file to confirm data transfer #2791

Closed
wants to merge 18 commits into from

Conversation

Vince-janv
Copy link
Contributor

@Vince-janv Vince-janv commented Dec 29, 2023

Description

This PR uses the created manifest file to check that the transfer is complete and triggers the next step in the automation by touching a file in a directory.

Added

  • CLI command to check Nanopore runs

Changed

  • Renamed the existing check function to confirm_transfer_of_illumina_flow_cell

This version is a

  • MINOR - when you add functionality in a backwards compatible manner

@Vince-janv Vince-janv added the Project Task Part of a quarterly project label Dec 29, 2023
@Vince-janv Vince-janv self-assigned this Dec 29, 2023
Comment on lines +260 to +270
"""Checks if all relevant files from an Illumina sequencing run have been transferred."""
for source_flow_cell in Path(source_directory).iterdir():
target_flow_cell = Path(target_directory, source_flow_cell.name)
if is_flow_cell_sync_confirmed(target_flow_cell):
LOG.debug(f"Flow cell {source_flow_cell} has already been confirmed, skipping.")
continue
if is_syncing_complete(
source_directory=source_flow_cell,
target_directory=Path(target_directory, source_flow_cell.name),
):
create_copy_complete_file(target_flow_cell)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved logic from CLI-command to here. This is old code

@Vince-janv Vince-janv marked this pull request as ready for review January 8, 2024 14:34
@Vince-janv Vince-janv requested a review from a team as a code owner January 8, 2024 14:34
Copy link
Contributor

@ChrOertlin ChrOertlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice!

cg/cli/demultiplex/demux.py Show resolved Hide resolved
cg/meta/demultiplex/utils.py Show resolved Hide resolved
@@ -257,6 +257,7 @@ class CGConfig(BaseModel):
environment: Literal["production", "stage"] = "stage"
flow_cells_dir: str
madeline_exe: str
nanopore_data_directory: str
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
nanopore_data_directory: str
nanopore_flow_cells_dir: str

The code above makes the distinction between illumina_flow_cells and nanopore_flow_cells Maybe we can keep that theme here as well. It would also give a better context than nanopore_data

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the structure is like this {experiment_id}/{sample_id}/{start_time}_{device_ID}_{flow_cell_id}_{short_protocol_run_id} where the flow cell is three levels down. I thought calling it flow_cell directory could be misleading.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will leave this as is, and revise the naming after the folder restructure

@@ -257,6 +257,7 @@ class CGConfig(BaseModel):
environment: Literal["production", "stage"] = "stage"
flow_cells_dir: str
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
flow_cells_dir: str
illumina_flow_cells_dir: str

perhaps also?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think this should be illumina_data_directory?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it makes sense with the proposed changes in the issue you set up. having both directories under the "sequencing_data" umbrella. Then they could also simply be "illumina" and "nanopore". I don't mind one way or another, just a unified way representing raw sequencing output data would be nice I think

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, will change it when we've decided on the folder structure 👍

tests/cli/demultiplex/test_verify_syncing.py Outdated Show resolved Hide resolved
tests/cli/demultiplex/test_verify_syncing.py Outdated Show resolved Hide resolved
tests/cli/demultiplex/test_verify_syncing.py Outdated Show resolved Hide resolved
tests/cli/demultiplex/test_verify_syncing.py Show resolved Hide resolved
cg/meta/demultiplex/utils.py Outdated Show resolved Hide resolved
Copy link
Contributor

@henrikstranneheim henrikstranneheim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

cg/meta/demultiplex/utils.py Show resolved Hide resolved
cg/meta/demultiplex/utils.py Outdated Show resolved Hide resolved
tests/cli/demultiplex/test_verify_syncing.py Outdated Show resolved Hide resolved
tests/meta/demultiplex/test_utils.py Outdated Show resolved Hide resolved
tests/meta/demultiplex/test_utils.py Outdated Show resolved Hide resolved
Copy link
Contributor

@diitaz93 diitaz93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! ⭐

cg/meta/demultiplex/utils.py Show resolved Hide resolved
Copy link

sonarqubecloud bot commented Jan 9, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@henrikstranneheim
Copy link
Contributor

@Vince-janv Still relevant?

@Vince-janv
Copy link
Contributor Author

@Vince-janv Still relevant?

Yes. This will be needed if IT does not come up with a inotify solution. Waiting to merge in the event that happens. If I complete the database models and post-processing before hearing anything from them I will merge this

@Vince-janv
Copy link
Contributor Author

Closing as stale

@Vince-janv Vince-janv closed this Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Project Task Part of a quarterly project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants