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

DEV - Update pacbio flow to accept barcoded samples #3754

Merged
merged 29 commits into from
Oct 3, 2024

Conversation

diitaz93
Copy link
Contributor

@diitaz93 diitaz93 commented Sep 23, 2024

Description

Added

Changed

  • Pacbio runs are expected to be barcoded.

Fixed

How to prepare for test

  • Ssh to relevant server (depending on type of change)
  • Use stage: us
  • Paxa the environment: paxa
  • Install on stage (example for Hasta):
    bash /home/proj/production/servers/resources/hasta.scilifelab.se/update-tool-stage.sh -e S_cg -t cg -b dev-update-pacbio-models -a

How to test

Review

  • Tests executed by IO, SD
  • "Merge and deploy" approved by VJ
    Thanks for filling in who performed the code review and the test!

This version is a

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

Implementation Plan

  • Document in ...
  • Deploy this branch on ...
  • Inform to ...

@diitaz93 diitaz93 changed the title DEV - Update pacbio models to accepts barcoded samples DEV - Update pacbio flow to accept barcoded samples Sep 23, 2024
@diitaz93 diitaz93 added alembic migration Perform a change in database feature New feature labels Sep 23, 2024
islean and others added 2 commits September 23, 2024 14:04
### Changed

- Barcode fields added to the PacBioSequencingRun model
* add reports and reads for barcoded run

* reformat json

* add some fixtures and constant

* renamed fixture names

* fix failing test
islean and others added 6 commits September 23, 2024 15:25
### Added

- SampleMetrics parsing model
* Include barcodes report in the file manager

* Move fixtures to plugins

* parametrise tests to include new run

* Update cg/services/run_devices/pacbio/run_file_manager/run_file_manager.py
* Include barcodes report in the file manager

* Move fixtures to plugins

* parametrise tests to include new run

* add functionality to parse barcode metrics

* add support for parsing barcodes metrics

* address comments by IO

* remove from_attributes
* remove sample_id fetching from dataset metrics

* fixed metrics parsing tests and fixtures

* removed unused fixtures

* move fixtures from conftest to plugins

* add test for new function
diitaz93 and others added 5 commits September 27, 2024 15:37
* commit to initialise branch

* update DTOs and CRUD

* move dto fixtures to plugins

* update fixtures and fix tests

* remove duplicated fixture and unused inits

* fix import error
* Add upgrade migration

* add downgrade

* fix black

* add None to new fields on the db

---------

Co-authored-by: Sebastian Diaz <[email protected]>
@islean
Copy link
Contributor

islean commented Sep 30, 2024

Upgrade and deployment to stage run successfully:

remote: Compressing objects: 100% (42/42), done.
remote: Total 94 (delta 56), reused 83 (delta 52), pack-reused 0 (from 0)
Unpacking objects: 100% (94/94), done.
From github.com:Clinical-Genomics/cg
3c20481..0912472 3767-allow-micro-seq-only-excel -> origin/3767-allow-micro-seq-only-excel
da6ab10..6d6dd60 add-raredisease-scout-upload -> origin/add-raredisease-scout-upload
722338b..fcce1fa add-tomte-delivery-report-to-scout -> origin/add-tomte-delivery-report-to-scout

  • [new branch] allow-mip-rna-json -> origin/allow-mip-rna-json
    3897644..691055f clean-case-dirs -> origin/clean-case-dirs
    0c0c38a..78dc316 dev-update-pacbio-models -> origin/dev-update-pacbio-models
    8093891..8693073 fix-raredisease-sample-pairs-list -> origin/fix-raredisease-sample-pairs-list
    Branch dev-update-pacbio-models set up to track remote branch dev-update-pacbio-models from origin.
    Switched to a new branch 'dev-update-pacbio-models'
    Already up-to-date.
    /home/isak.ohlsson
    INFO [alembic.runtime.migration] Context impl MySQLImpl.
    INFO [alembic.runtime.migration] Will assume non-transactional DDL.
    INFO [alembic.runtime.migration] Running upgrade 18dbadd8c436 -> d6474325c722, Refactor pacbio models
    fatal: Not a git repository (or any parent up to mount point /home)
    Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
    repository is clean
    Logging deploy ...
    Getting deployer... done.
    Getting last commit message and SHA... done.
    Getting version of deploy scripts... /home/isak.ohlsson
    done.
    Log deploy... done.
    cg, version 63.2.25
    [isak.ohlsson@hasta:~] [S_base] $

@islean
Copy link
Contributor

islean commented Sep 30, 2024

Barcoded columns added but potentially wrong database type? Do we need bigint?
image

@islean
Copy link
Contributor

islean commented Sep 30, 2024

image

@islean
Copy link
Contributor

islean commented Sep 30, 2024

Barcoded columns added but potentially wrong database type? Do we need bigint? image

Yes, we need it. Post processing failed otherwise

@islean
Copy link
Contributor

islean commented Sep 30, 2024

Downgrade successful:

image image image

Readded columns have wrong type (int instead of bigint). Revision has been changed to address this

@islean
Copy link
Contributor

islean commented Sep 30, 2024

Correct types added:

image image

Copy link
Contributor

@Vince-janv Vince-janv left a comment

Choose a reason for hiding this comment

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

Can't believe how quick this went 🤩 Well done 💪

islean and others added 10 commits October 1, 2024 09:58
* Removed fixtures from unbarcoded cell

* Remove smrt cell files

* Improve test description
* Removed fixtures from unbarcoded cell

* Remove smrt cell files

* Improve test description

* add run name to database
* remove barcode from database

* update alembic script
### Fixed

- Fixed typo in alias
* create update_sample_reads function in CRUD and add unit test

* fix relative import

* parametrise update_last_sequenced_at unit test

* add sample updating to post-processing and update unit test

* minor name fixes

* address comments by IO
### Changed

- sample_name to sample_internal_id
- Unassigned reads are disregarded.
@diitaz93 diitaz93 marked this pull request as ready for review October 2, 2024 14:57
@diitaz93 diitaz93 requested a review from a team as a code owner October 2, 2024 14:57
Copy link

sonarqubecloud bot commented Oct 2, 2024

@islean islean merged commit fa45dce into master Oct 3, 2024
9 checks passed
@islean islean deleted the dev-update-pacbio-models branch October 3, 2024 07:31
@islean
Copy link
Contributor

islean commented Oct 3, 2024

Deployed to production:

 create mode 100644 tests/fixtures/devices/pacbio/SMRTcells/r84202_20240913_121403/1_C01/statistics/unzipped_reports/barcodes.report.json
 rename tests/fixtures/devices/pacbio/SMRTcells/{r84202_20240522_133539/1_A01 => r84202_20240913_121403/1_C01}/statistics/unzipped_reports/control.report.json (87%)
 rename tests/fixtures/devices/pacbio/SMRTcells/{r84202_20240522_133539/1_A01 => r84202_20240913_121403/1_C01}/statistics/unzipped_reports/loading.report.json (87%)
 rename tests/fixtures/devices/pacbio/SMRTcells/{r84202_20240522_133539/1_A01 => r84202_20240913_121403/1_C01}/statistics/unzipped_reports/raw_data.report.json (88%)
 create mode 100644 tests/fixtures/devices/pacbio/SMRTcells/r84202_20240913_121403/1_C01/statistics/unzipped_reports/smrtlink-datasets.json
 delete mode 100644 tests/services/run_devices/__init__.py
 delete mode 100644 tests/services/run_devices/pacbio/__init__.py
 delete mode 100644 tests/services/run_devices/pacbio/housekeeper_service/conftest.py
 delete mode 100644 tests/services/run_devices/pacbio/metrics_parser/__init__.py
/home/isak.ohlsson
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade 18dbadd8c436 -> d6474325c722, Refactor pacbio models
[isak.ohlsson@hasta:~] [P_base] $ 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alembic migration Perform a change in database feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants