Skip to content

Conversation

@islean
Copy link
Member

@islean islean commented Dec 1, 2025

Description

Closes #4675. Currently, Pacbio samples gets their reads incremented rather than updated. When the same SMRT cell is post processed multiple times (in e.g. deviations), this causes the samples to display the wrong number of reads.

Added

Changed

Fixed

  • Reads are updated rather than incremented for Pacbio samples.

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 fix-pacbio-read-calculation -a

How to test

  • Do ...

Expected test outcome

  • Check that ...
  • Take a screenshot and attach or copy/paste the output.

Review

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

This version is a

  • MAJOR - when you make incompatible API changes
  • MINOR - when you add functionality in a backwards compatible manner
  • PATCH - when you make backwards compatible bug fixes or documentation/instructions

Implementation Plan

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

@islean islean requested a review from a team as a code owner December 1, 2025 15:30
@islean islean marked this pull request as draft December 1, 2025 16:15
@islean islean marked this pull request as ready for review December 2, 2025 10:05
):
pass
def recalculate_sample_reads_pacbio(self, sample_id: str) -> None:
reads = sum(
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 is not obvious that it is an int

Suggested change
reads = sum(
reads: int = sum(

Comment on lines 123 to 130
reads: int = 10000

# WHEN updating the reads for the sample
store.update_sample_reads(internal_id=pacbio_barcoded_sample_internal_id, reads=reads)
store.update_sample_reads_pacbio(internal_id=pacbio_barcoded_sample_internal_id, reads=reads)

# THEN the reads for the sample is updated
sample: Sample = store.get_sample_by_internal_id(pacbio_barcoded_sample_internal_id)
assert sample.reads == reads
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest this test(test_update_sample_reads_pacbio) be removed. Seems to me that the new test (test_update_sample_reads_pacbio_not_incremented) covers all the functionality

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.

Looks great ⭐

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 3, 2025

@islean
Copy link
Member Author

islean commented Dec 3, 2025

Tested by post processing a run name. Recreated the only sample on the sequencing run and after post processing its reads were updated:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Reads for pacbio samples are incremented instead of recalculated per sequencing run

3 participants