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

Y24-313 scRNA pooling calculation changes #1951

Merged
merged 12 commits into from
Sep 25, 2024

Conversation

andrewsparkes
Copy link
Member

Closes #1909

@andrewsparkes andrewsparkes self-assigned this Sep 23, 2024
Copy link

codecov bot commented Sep 23, 2024

Codecov Report

Attention: Patch coverage is 94.73684% with 1 line in your changes missing coverage. Please review.

Project coverage is 77.92%. Comparing base (9ca1fb6) to head (17dce0e).
Report is 32 commits behind head on develop.

Files with missing lines Patch % Lines
...encescape/sequencescape/api/v2/request_metadata.rb 80.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1951      +/-   ##
===========================================
- Coverage    77.95%   77.92%   -0.03%     
===========================================
  Files          459      460       +1     
  Lines        17692    17715      +23     
  Branches       225      225              
===========================================
+ Hits         13791    13805      +14     
- Misses        3899     3908       +9     
  Partials         2        2              
Flag Coverage Δ
javascript 69.69% <ø> (ø)
pull_request 77.95% <94.73%> (?)
push 77.95% <94.73%> (+<0.01%) ⬆️
ruby 91.01% <94.73%> (-0.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@yoldas yoldas left a comment

Choose a reason for hiding this comment

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

Looks good. I have added a few notes.

source_wells.first&.aliquots&.first&.request&.request_metadata&.number_of_samples_per_pool || nil

if number_of_samples_per_pool.nil?
raise StandardError, 'Error: request_metadata.number_of_samples_per_pool is nil'
Copy link
Member

Choose a reason for hiding this comment

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

Note that if the option is not provided in submission or added to the request metadata using the rake task, this will cause a 500 error while creating the PBMC Pools plate. So, the number_of_samples_per_pool option is not optional.

Copy link
Member Author

Choose a reason for hiding this comment

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

Which is correct, but maybe the message should be customer friendly like saying it should have been set on submission? Not sure how they'd fix that other than support issue.

@@ -218,7 +238,7 @@ def tag_depth_hash
def build_pools
groups = split_single_group_by_study_and_project(source_wells_for_pooling)
groups = split_groups_by_unique_donor_ids(groups)
distribute_groups_across_pools(groups, number_of_pools)
distribute_groups_across_pools(groups, calculated_number_of_pools)
Copy link
Member

Choose a reason for hiding this comment

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

Note that distribute_groups_across_pools uses a halving algorithm in distribution at the moment, which causes uneven distribution in small number of pools. I think It needs a weighted sharing of pools to each group based on size first and then either a round robin or a fair sharing of remainder after integer division for distribution in them.

# frozen_string_literal: true

# Represents a request metadatum in Limber via the Sequencescape API
class Sequencescape::Api::V2::RequestMetadata < Sequencescape::Api::V2::Base
Copy link
Member

Choose a reason for hiding this comment

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

metadatum in the comment is confusing I think. RequestMetadata is set to be singular for this resource (inflections, uncountable). I would avoid using both forms in the same context.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I changed the class name and forgot the comment. Will fix.

Copy link

codeclimate bot commented Sep 25, 2024

Code Climate has analyzed commit 17dce0e and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 94.7% (50% is the threshold).

This pull request will bring the total coverage in the repository to 91.1% (0.0% change).

View more on Code Climate.

@andrewsparkes andrewsparkes merged commit ed5d0b4 into develop Sep 25, 2024
14 checks passed
@andrewsparkes andrewsparkes deleted the y24-313-scrna-pooling-v2 branch September 25, 2024 10:07
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.

Y24-313 - PBMC donor pooling - use requested number of samples per pool
2 participants