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-382 - Research - updating volume after cherrypicking #4412

Closed
4 tasks done
KatyTaylor opened this issue Oct 11, 2024 · 10 comments · Fixed by #4529 or #4547 · May be fixed by #4544
Closed
4 tasks done

Y24-382 - Research - updating volume after cherrypicking #4412

KatyTaylor opened this issue Oct 11, 2024 · 10 comments · Fixed by #4529 or #4547 · May be fixed by #4544
Assignees
Labels
Cherrypicking Research Research only Size: M Medium - medium effort & risk

Comments

@KatyTaylor
Copy link
Contributor

KatyTaylor commented Oct 11, 2024

Description
As an SSR (Liz C) I would like to know when well volumes in Sequencescape are updated after cherrypicks, so that I am confident when re-picking from a well that the remaining volume shown is correct.

Acceptance Criteria
The following outputs from the research are produced:

  • Find where in the code the volume update is done after cherrypicking. N.B. I think it doesn't happen during the cherrypicking pipeline, but rather during the bed verification that follows.
  • Check whether anything affects whether that volume update happens e.g. which option they pick out of ‘pick by volume (μl)’, ‘pick by concentration (ng/μl)’ and ‘pick by amount (ng)’.
  • Document findings to an appropriate level in the user facing documentation produced by this story.
  • Look into Liz C's findings when she tested this - get spreadsheet from Katy - not sure if it's appropriate to attach. Are there any bugs here? If so, update this placeholder story with what needs to be fixed.

Who the primary contacts are for this work
Katy

Knowledge or Stake holders
Liz C

Additional context or information
Related stories:

@KatyTaylor KatyTaylor added Research Research only Size: M Medium - medium effort & risk labels Oct 11, 2024
@psd-issuer psd-issuer bot changed the title Updating volume after cherrypicking Y24-382 - Updating volume after cherrypicking Oct 11, 2024
@KatyTaylor KatyTaylor changed the title Y24-382 - Updating volume after cherrypicking Y24-382 - Research - updating volume after cherrypicking Oct 11, 2024
@StephenHulme StephenHulme self-assigned this Nov 11, 2024
@StephenHulme
Copy link
Contributor

StephenHulme commented Nov 12, 2024

Subject to verification, it appears that the volume reduction is triggered by https://github.com/sanger/sequencescape/blob/master/app/models/cherrypicking_pipeline.rb#L15 and clearly not in https://github.com/sanger/sequencescape/blob/master/app/models/pipeline.rb#L139. The actual calculation occurs in https://github.com/sanger/sequencescape/blob/master/app/models/cherrypick_request.rb#L19.

@StephenHulme
Copy link
Contributor

StephenHulme commented Nov 19, 2024

Confirmed that the code in app/models/cherrypicking_pipeline.rb::CherrypickingPipeline.robot_verified! is executed on robot verification through Sample Management (Lab View) > Bed Verification.

Once this has been completed, then a Robot verification completed and source volumes updated. event appears at the bottom of the Batch page.

The destination plate is created and updates as soon as the Approve Plate Layout step has been completed.

The confluence page Cherrypicking options in Sequencescape has been updated with this info.

Screenshot 2024-11-19 at 16 27 28 Screenshot 2024-11-19 at 16 27 50

@StephenHulme
Copy link
Contributor

StephenHulme commented Nov 27, 2024

Calculations (and explanations) for volumes can be found in app/models/cherrypick/volume_by_micro_litre.rb and sibling files. This is also where validity checks are for volume being defined. This is likely to be particularly helpful for Y24-383.

@StephenHulme
Copy link
Contributor

StephenHulme commented Dec 6, 2024

Given the table of results from test cherrypicks below, there appear to be some bugs:

Plate ID Initial Volume µl Initial Concentration ng/µl Initial Quantity ng Picking Strategy Parameters WS Values Batch Destination Plate Final Concentration ng/µl Final Volume µl Final Quantity ng Plate ID
SQPD-10857 50 Volume Pick Volume: 10 v10, b0 7 SQPD-10858 40.0 SQPD-10857
SQPD-10858 10.0 SQPD-10858
SQPD-10859 50 70 3500 Concentration Pick Volume Required: 15, Concentration Required: 50, Minimum Picking Volume: 5 v10.71, b5.00 8 SQPD-10860 70 39.2857 2749 SQPD-10859
SQPD-10860 15.0 750 SQPD-10860
SQPD-10861 50 70 3500 Amount Pick Quantity: 1000, Minimum Volume: 10, Maximum Volume: 50, Robot Minimum Picking Volume: 5 v14.29, b0.00 10 SQPD-10863 70 35.7143 2500 SQPD-10861
SQPD-10863 10.0 SQPD-10863
SQPD-10864 1 200 200 Amount Pick Quantity: 200, Minimum Volume: 50, Maximum Volume: 50, Robot Minimum Picking Volume: 5 v1.00, b49.00 11 SQPD-10865 200 0.0 0 SQPD-10864
SQPD-10865 50.0 SQPD-10865
SQPD-10866 100 98 9800 Amount Pick Quantity: 9800, Minimum Volume: 50, Maximum Volume: 50, Robot Minimum Picking Volume: 5 v50.00, b0.00 12 SQPD-10867 98 50.0 4900 SQPD-10866
SQPD-10867 50.0 SQPD-10867
SQPD-10868 100 100 10000 Amount Pick Quantity: 9800, Minimum Volume: 50, Maximum Volume: 50, Robot Minimum Picking Volume: 5 v50.00, b0.00 13 SQPD-10869 100 50.0 5000 SQPD-10868
SQPD-10869 50.0 SQPD-10869

Assuming simple arithmetic (which might not be the case), there are some unexpected final volumes.

For plate SQPD-10857 with an initial volume of 50 ul, a 10 ul pick with no buffer, results in a plate of 40 ul and 10 ul - this is expected.

For plate SQPD-10859 with an initial volume of 50 ul, a 10.71 ul pick with 5 ul buffer results in a plate of 39.29 ul (correct), but 15.0 ul in the destination plate - this is expected to be 15.71 ul.

Similarly, for plate SQPD-10861 with an intial volume of 50 ul, a 14.29 ul pick with no buffer results in a plate of 35.71 ul (correct), but 10.0 ul in the destination plate - this is expected to be 14.29 ul.

Plate SQPD-10864 replicates the issue identified in the training SS spreadsheet where the volume pick is less than 1 ul is 1 ul - less than the expected 5 ul required by the Robot Minimum Picking Volume.

Plates SQPD-10866 and SQPD-10868 attempt to replicate the inverse, to get 1 ul of buffer picked. In both cases 50 ul of well volume and no buffer is picked - which appears correct but would result in a greater quantity than expected - which is also correct.

@StephenHulme
Copy link
Contributor

This is largely complete, only the questions below to Liz C are outstanding. The responses to these will tell us if there are any bugs in the calculations:

  1. I would like to confirm how the Robot Minimum Picking Volume is meant to work. Should this minimum volume apply to just the wells (v in the worksheet), buffer (b in the worksheet), or both?
  2. a. Is the resulting volume in the destination plate important?
    b. If so, if v10.71, b5.00 is cherrypicked (Concentration Pick, Volume Required: 15), should the resulting volume in the destination plate be 15 ul or 15.71 ul?
    c. Likewise, if v14.29, b0.00 is cherrypicked (Amount Pick, Minimum Volume: 10), should the destination volume be 10 ul or 14.29 ul?

@KatyTaylor
Copy link
Contributor Author

A bit of extra detail after reading the code that updates the source well volume:

  • When the cherrypick pipeline pages are clicked through, picked_volume on the well_attributes table is set, for the target well.
  • When the bed verification happens, this value is retrieved and subtracted from the source well's current_volume (also on well_attributes.

@StephenHulme can you confirm if this is correct?

@KatyTaylor
Copy link
Contributor Author

Given the table of results from test cherrypicks below, there appear to be some bugs:

Thanks for this investigation, it looks great. Looks like there is a bug in the setting of destination plate well volumes.

Plate SQPD-10864 replicates the issue identified in the training SS spreadsheet where the volume pick is less than 1 ul.

That plate is missing from your table, could you add it? Could you describe a bit more about the "issue identified in the training SS spreadsheet where the volume pick is less than 1 ul", please?
I think the issue is that the volume pick is less than the specified 'robot minimum picking volume' - is that correct?

One more question - was the one mentioned above the only issue raised by Liz in her spreadsheet, or are there more to look into?

Thanks.

@StephenHulme
Copy link
Contributor

That plate is missing from your table, could you add it?

Sorry, copy-paste error. Plate SQPD-10864 has been added to the table.

Plate SQPD-10864 replicates the issue identified in the training SS spreadsheet where the volume pick is less than 1 ul.

Correct, the volume pick (1 ul) is less than the specified 'robot minimum picking volume', in this instance of (5 ul). I think a typo crept in there...

was the one mentioned above the only issue raised by Liz in her spreadsheet[?]

As I understand the accompanying email there were two concerns associated with the spreadsheet. The first (I think, though could be wrong) was confirmation of volume and total micrograms changing, rather than a specific bug. The second concern was a potential bug with robot minimum picking volume which I have been able to replicate. While it appears clear that this behaviour is incorrect, there is currently fairly complex logic regarding the minimum picking volume making it challenging to identify the correct behaviour without additional information (see question 1 above).

@StephenHulme
Copy link
Contributor

  • When the cherrypick pipeline pages are clicked through, picked_volume on the well_attributes table is set, for the target well.

Yes. More specifically, when the Finish Cherrypick page is reached (but before Release) concentration, current_volume, buffer_volume, requested_volume, and picked_volume on the well_attributes table is set for the target well (for a Concentration Pick when contration and volume data is available).

  • When the bed verification happens, this value is retrieved and subtracted from the source well's current_volume (also on well_attributes.

Correct. See screenshots below (identical wells, top 3 are source plate, bottom 3 destination).

When the Finish Cherrypick page is reached:

Screenshot 2024-12-13 at 11 22 32

After bed verification:

Screenshot 2024-12-13 at 11 26 30

@KatyTaylor
Copy link
Contributor Author

Thanks for the answers to my questions. Looks like we're just waiting on some clarification from Liz on your 2 q's then (v or v+b, and destination volume).

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