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

DPL-914 scRNA create tube rack (plate) from banked pmbc tubes #1586

Merged

Conversation

andrewsparkes
Copy link
Member

@andrewsparkes andrewsparkes commented Feb 16, 2024

Closes #1388

Changes proposed in this pull request

  • Adds the labware creator for making the scRNA cryostor plate from the Seq and Spare Bank tubes using a tube rack scan

Instructions for Reviewers

[All PRs] - Confirm PR template filled
[Feature Branches] - Review code
[Production Merges to main]
    - Check story numbers included
    - Check for debug code
    - Check version

@andrewsparkes andrewsparkes linked an issue Feb 26, 2024 that may be closed by this pull request
3 tasks
Copy link

codecov bot commented Feb 26, 2024

Codecov Report

Attention: Patch coverage is 96.51163% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 90.78%. Comparing base (4879b00) to head (47cad6a).

Files Patch % Lines
app/models/state_changers.rb 72.72% 3 Missing ⚠️
...creators/common_file_handling/csv_file/row_base.rb 85.71% 2 Missing ⚠️
.../models/labware_creators/pooled_tubes_by_sample.rb 0.00% 2 Missing ⚠️
app/sequencescape/sequencescape/api/v2.rb 33.33% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1586      +/-   ##
===========================================
- Coverage    90.82%   90.78%   -0.05%     
===========================================
  Files          359      362       +3     
  Lines         7424     7452      +28     
===========================================
+ Hits          6743     6765      +22     
- Misses         681      687       +6     
Flag Coverage Δ
javascript 93.65% <ø> (ø)
pull_request 90.78% <96.51%> (?)
push 90.78% <96.51%> (-0.05%) ⬇️
ruby 90.37% <96.51%> (-0.06%) ⬇️

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.

@andrewsparkes andrewsparkes marked this pull request as ready for review February 26, 2024 17:09
@andrewsparkes andrewsparkes self-assigned this Mar 4, 2024
Copy link
Contributor

@KatyTaylor KatyTaylor left a comment

Choose a reason for hiding this comment

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

Haven't looked at the state changer or api stuff yet, but submitting these comments in a batch as I might not get a chance to finish reviewing until later this afternoon.

# type(s).
# 5) The request on the tube must be active, and must match to one of the expected ones from a list in the plate
# purpose config. This is to check that the tubes are at the appropriate stage of their pipeline to transfer.
#
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice docs, thank you.

Copy link
Contributor

Choose a reason for hiding this comment

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

Really nice and easy to read, thanks for the sensible method order and informative comments.

Copy link
Contributor

Choose a reason for hiding this comment

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

Definitely some code duplication going on here - did you consider whether to try to share code with other CsvFile classes?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes can have a look, was having the same in the Targeted NanoSeq stories. Maybe can create some common classes for all of these file upload classes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Same here - code duplication. Might be easier to refactor considering the thinking you put into it already in the last similar story?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep ok

Copy link
Contributor

Choose a reason for hiding this comment

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

Would be good to have a standard 'upload tube rack scan file' view (maybe a partial?) that we could reuse, as we now have these uploads in several different places. Could break that out into a different technical debt story though maybe, as it might take some thinking.

Copy link
Member Author

Choose a reason for hiding this comment

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

The other one in this pipeline has 2 files, for contingency and sequencing racks.
Agree it should be possible to make a common one, maybe that allows for an array of files. Set up from attributes in the labware creator.

Copy link
Contributor

@KatyTaylor KatyTaylor left a comment

Choose a reason for hiding this comment

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

Left some comments. The API stuff looks like a good change to me. I agree we should be cautious though and make sure the Integration Suite tests pass.

app/sequencescape/sequencescape/api/v2.rb Outdated Show resolved Hide resolved
Copy link
Contributor

@KatyTaylor KatyTaylor left a comment

Choose a reason for hiding this comment

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

Thanks for doing all that refactoring. I've left a few extra comments but they're all minor.

#
class CsvFile::RowForTubeRack < CsvFile::RowBase
TUBE_LOCATION_NOT_RECOGNISED = 'contains an invalid coordinate, in %s'
TUBE_BARCODE_MISSING = 'cannot be empty, in %s'
Copy link
Contributor

Choose a reason for hiding this comment

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

The error messages could flow better, I think, but I guess you are copy pasting from an existing class? What does it end up as, something like:

Tube barcode cannot be empty, in CsvFile::RowForTubeRack

?

Copy link
Member Author

Choose a reason for hiding this comment

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

The 'in' part is the to_s method that gives you a row number reference (plus well coord if available)
e.g. Tube barcode cannot be empty, in row 11 [G5]


# Override in subclass if needed
def reset_variables
@parent_barcode = nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure why @parent_barcode is being reset, do you know? The other 3 are initialized in this class.

Copy link
Member Author

Choose a reason for hiding this comment

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

well spotted, removed
cut and paste error from the pcr cycles version of csv file base

# Generates a hash of position details based on the tube rack scan data in the CSV file.
#
# @return [Hash] A hash of position details, where the keys are positions and the values
# are hashes containing the tube rack barcode and tube barcode for each position.
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
# are hashes containing the tube rack barcode and tube barcode for each position.
# are hashes containing the tube barcode for each position.

Is this correct? Does not contain the tube rack barcode?

Copy link
Member Author

Choose a reason for hiding this comment

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

correct, fixed

@row_data = row_data
super(index, row_data)

# initialize pipeline specific columns
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
# initialize pipeline specific columns

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.

Added some comments. I will continue in a new batch.

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.

One more comment.

Copy link

codeclimate bot commented Mar 21, 2024

Code Climate has analyzed commit 47cad6a and detected 3 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 3

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

This pull request will bring the total coverage in the repository to 90.3% (-0.1% change).

View more on Code Climate.

@andrewsparkes andrewsparkes merged commit 3a28ac1 into develop Mar 22, 2024
12 checks passed
@andrewsparkes andrewsparkes deleted the dpl-914-scrna-create-tube-rack-banked-pmbc-tubes branch March 22, 2024 11:54
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.

DPL-914 Create tube rack containing banked PBMC tubes
3 participants