-
Notifications
You must be signed in to change notification settings - Fork 8
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-812: FluidX tube rack data report #1433
Merged
Merged
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
028620b
wip: add initial PBMC Bank Tubes Content Report
StephenHulme b104b1b
fix: update values
StephenHulme 887a488
fix: remove duplicate well position
StephenHulme d120b61
fix: tidy up code
StephenHulme 35e2caa
style: lint
StephenHulme 487c631
fix: update values
StephenHulme 5ec5451
fix: remove debug code and lint
StephenHulme b1eee38
fix: update report with units and additional notes
StephenHulme afc431c
refactor: rename destination_tube -> child_tube
StephenHulme 2dc9a9e
tests: add test for well-aliquot-study fixture
StephenHulme 4c54790
fix: remove existing study reference
StephenHulme 2f32679
fix: remove existing project reference
StephenHulme 623ee0f
fix: re-establish relationships
StephenHulme 4107296
tests: add tests for well-aliquot relationships
StephenHulme 66484c1
fix: restore relationships
StephenHulme f3047df
tests: add test for order_group
StephenHulme be1573b
tests: add tests to specify study and project
StephenHulme 219daee
tests: add tests to specify study and project at well level
StephenHulme f438a6a
tests: add tests to specify study and project at plate level
StephenHulme 596ae2c
tests: specify study and project at plate level for submission
StephenHulme 93c187b
tests: add tests for same study and project
StephenHulme 8eb2598
Merge branch 'dpl-812-tests' into dpl-812-fluidx-tube-rack-data-report
StephenHulme e383aa6
tests: update column headings
StephenHulme 4e57dce
fix: remove erroneous leading line
StephenHulme 6008819
tests: refactor and add missing values
StephenHulme 0f7de3c
tests: add missing study
StephenHulme b95584b
tests: add donor and row-by-row evaluation to tests
StephenHulme 15691a5
fix: add extraction-date and study name
StephenHulme 59e35e6
fix: update barcodes
StephenHulme a742683
style: remove development comments
StephenHulme fbc7a10
refactor: rename child_tube -> child_tube_v1
StephenHulme 96cc5f5
style: lint
StephenHulme 2b6b796
style: lindt
StephenHulme cfc6c80
tests: specify donor_id
StephenHulme 451eb64
Merge branch 'develop' into dpl-812-fluidx-tube-rack-data-report
StephenHulme f6c477b
fix: revert inadvertent debugging changes
StephenHulme 7d3868a
fix: rename Parent barcode -> Stock barcode
StephenHulme 3a4e64d
fix: use purpose name instead of tube name to determine destination
StephenHulme 613c3bc
fix: update dev comment
StephenHulme File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<%# This is a report of the contents of the tubes in the PBMC Bank plate %> | ||
<%# Based on app/views/exports/hamilton_lrc_pbmc_bank_to_lrc_bank_seq_and_spare.csv.erb %> | ||
<%= CSV.generate_line ['Workflow', @workflow], row_sep: '' %> | ||
|
||
<%= | ||
CSV.generate_line [ | ||
'Well name', | ||
'Donor ID', | ||
'Stock barcode', | ||
'FluidX barcode', | ||
'Extraction and freeze date', | ||
'Sequencing or contingency', | ||
'Cell count (cells/ml)', | ||
'Viability (%)', | ||
'Volume (µl)', | ||
'Study name', | ||
'Collection site' | ||
], | ||
row_sep: '' | ||
%> | ||
<% | ||
rows_array = [] | ||
@plate.wells_in_columns.each do |source_well| | ||
# skip if well empty (not all wells have samples in them) | ||
next if source_well.empty? | ||
|
||
# skip if well not in passed state | ||
next unless source_well.passed? | ||
|
||
# skip if no downstream tubes for this well (not set up children in Limber yet) | ||
next if source_well.downstream_tubes.empty? | ||
|
||
child_tube_v1 = source_well.downstream_tubes.last | ||
child_tube_v2 = | ||
Sequencescape::Api::V2.tube_with_custom_includes( | ||
'custom_metadatum_collection', | ||
nil, | ||
barcode: child_tube_v1.labware_barcode.machine | ||
) | ||
|
||
next unless child_tube_v2 && child_tube_v2.custom_metadatum_collection | ||
|
||
# get tube metadata from child_tube | ||
metadata = child_tube_v2.custom_metadatum_collection.metadata | ||
|
||
next unless metadata | ||
|
||
tube_rack_barcode = metadata['tube_rack_barcode'] | ||
tube_rack_position = metadata['tube_rack_position'] | ||
|
||
next unless tube_rack_barcode && tube_rack_position | ||
|
||
sample_uuid = source_well.aliquots.first.sample.uuid | ||
source_well_posn = source_well.position['name'] | ||
|
||
sample_metadata = source_well.aliquots.first.sample.sample_metadata | ||
|
||
# donor_id is sourced from the sample metadata provided by Sequencescape | ||
donor_id = sample_metadata.respond_to?(:donor_id) ? sample_metadata.donor_id : nils | ||
child_tube_purpose = child_tube_v2.purpose.name | ||
destination = ((child_tube_purpose == 'LRC Blood Seq') ? 'Sequencing' : 'Contingency') | ||
volume = 135 | ||
|
||
rows_array << [ | ||
source_well.name, # Well name | ||
donor_id, # Donor ID | ||
@ancestor_tubes[sample_uuid].labware_barcode.human, # LRC Blood Vac purpose barcode | ||
child_tube_v2.barcode, # FluidX barcode | ||
child_tube_v2.created_at, # Extraction and freeze date | ||
destination, # Sequencing or contingency | ||
source_well.latest_live_cell_count.value, # Cell count | ||
source_well.latest_cell_viability.value, # Viability | ||
volume, # Volume | ||
source_well.aliquots.first.study.name, # Study name | ||
source_well.aliquots.first.sample.sample_metadata&.collected_by # Collection site | ||
] | ||
end | ||
%> | ||
<% rows_array.sort_by{ |a| WellHelpers.well_coordinate(a[0]) }.each do |row| %> | ||
<%= CSV.generate_line row, row_sep: '' %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copied across from DPL-827