-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into dpl-829-pbmc-plate-tube-rack-bed-verifica…
…tion
- Loading branch information
Showing
16 changed files
with
956 additions
and
258 deletions.
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
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
Oops, something went wrong.