Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
cf53ac5
changed viability threshold value
andrewsparkes Nov 27, 2025
3c2fab7
modified to add pbmc tube sizes
andrewsparkes Nov 28, 2025
822e6c2
Merge branch 'develop' into y25-598-scrna-add-tube-size-options
andrewsparkes Nov 28, 2025
e8efd12
modified generate tubes uat action to add sample metadata required in…
andrewsparkes Dec 1, 2025
1d03daa
Merge branch 'develop' into y25-598-scrna-add-tube-size-options
andrewsparkes Dec 2, 2025
c1a0dde
Merge branch 'develop' into y25-598-scrna-add-tube-size-options
andrewsparkes Dec 8, 2025
6bc801c
fixes after code review feedback
andrewsparkes Dec 9, 2025
ab4fe14
Merge branch 'develop' into y25-598-scrna-add-tube-size-options
andrewsparkes Dec 15, 2025
316e764
removed dot in purpose names
andrewsparkes Dec 15, 2025
3e7181c
Merge branch 'develop' into y25-598-scrna-add-tube-size-options
andrewsparkes Jan 7, 2026
94e2047
Merge branch 'develop' into y25-598-scrna-add-tube-size-options
andrewsparkes Jan 20, 2026
ea350f6
Merge branch 'develop' into y25-598-scrna-add-tube-size-options
andrewsparkes Feb 2, 2026
cb24043
Merge branch 'develop' into y25-598-scrna-add-tube-size-options
andrewsparkes Feb 4, 2026
75bc565
Merge branch 'develop' into y25-598-scrna-add-tube-size-options
andrewsparkes Feb 5, 2026
c111a0b
Merge branch 'develop' into y25-598-scrna-add-tube-size-options
andrewsparkes Feb 12, 2026
2d99473
Merge branch 'develop' into y25-598-scrna-add-tube-size-options
andrewsparkes Feb 13, 2026
e3268fe
Merge branch 'develop' into y25-598-scrna-add-tube-size-options
andrewsparkes Feb 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion app/uat_actions/uat_actions/generate_tubes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ def perform
sanger_sample_id: sample_name,
studies: [study],
sample_metadata_attributes: {
supplier_name: sample_name
supplier_name: sample_name,
collected_by: UatActions::StaticRecords.collection_site,
donor_id: "#{sample_name}_donor",
sample_common_name: 'human'
}
),
study: study
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ limber_scrna_core_cdna_prep_gem_x_5p:
acceptable_purposes:
- LRC Bank Seq
- LRC Bank Spare
- LRC Bank Input
- LRC Bank Input 1ml
- LRC Bank Input 08ml
limber_scrna_core_cdna_prep_gem_x_5p_gems_input:
name: scRNA Core cDNA Prep GEM-X 5p GEMs Input
asset_type: Well
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ LRC Bank Spare:
target_type: SampleTube
stock_plate: false

LRC Bank Input:
LRC Bank Input 1ml:
type: Tube::Purpose
target_type: SampleTube
stock_plate: true

LRC Bank Input 08ml:
type: Tube::Purpose
target_type: SampleTube
stock_plate: true
2 changes: 1 addition & 1 deletion config/initializers/scrna_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# Key for the required number of cells metadata stored on Study (in poly_metadata)
study_required_number_of_cells_per_sample_in_pool_key: 'scrna_core_pbmc_donor_pooling_required_number_of_cells',
# Default viability threshold when passing/failing samples (in percent)
viability_default_threshold: 65,
viability_default_threshold: 50,
# Default total cell count threshold when passing/failing samples
total_cell_count_default_threshold: 50_000,
# Key for the number of cells per chip well metadata stored on pool wells (in poly_metadata)
Expand Down
73 changes: 66 additions & 7 deletions spec/uat_actions/generate_tubes_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,31 @@

before { allow(AssetBarcode).to receive(:new_barcode).and_return('2') }

it 'can be performed' do
it 'performs the action successfully' do
expect(uat_action.perform).to be true
end

it 'returns the expected barcode in the report' do
uat_action.perform
expect(uat_action.report['tube_0']).to eq report['tube_0']
expect(Tube.find_by_barcode(report['tube_0']).aliquots.first.study).to eq study
end

it 'assigns the correct study to the tube' do
uat_action.perform
tube = Tube.find_by_barcode(report['tube_0'])
expect(tube.aliquots.first.study).to eq study
end

it 'sets the correct sample metadata values' do
uat_action.perform
tube = Tube.find_by_barcode(report['tube_0'])
sample_metadata = tube.aliquots.first.sample.sample_metadata
expect(sample_metadata).to have_attributes(
supplier_name: 'sample_NT2P_0',
collected_by: UatActions::StaticRecords.collection_site,
donor_id: 'sample_NT2P_0_donor',
sample_common_name: 'human'
)
end
end

Expand All @@ -38,12 +59,29 @@

before { allow(AssetBarcode).to receive(:new_barcode).and_return('3', '4', '5') }

it 'can be performed' do
it 'performs the action successfully' do
expect(uat_action.perform).to be true
end

it 'returns the expected barcodes in the report' do
uat_action.perform
expect(uat_action.report['tube_0']).to eq report['tube_0']
expect(uat_action.report['tube_1']).to eq report['tube_1']
expect(uat_action.report['tube_2']).to eq report['tube_2']
end

it 'sets the correct sample metadata values for each tube' do
uat_action.perform
uat_action.report.each_with_index do |(_key, barcode), i|
sample_metadata = Tube.find_by_barcode(barcode).aliquots.first.sample.sample_metadata
expect(sample_metadata).to have_attributes(
supplier_name: "sample_#{barcode}_#{i}",
collected_by: UatActions::StaticRecords.collection_site,
donor_id: "sample_#{barcode}_#{i}_donor",
sample_common_name: 'human'
)
end
end
end

context 'when creating the tube with a fluidx foreign barcode' do
Expand All @@ -55,17 +93,38 @@
foreign_barcode_type: 'FluidX'
}
end
let(:report) do
let(:expected_report) do
# Tube NT6T created with foreign barcode based on machine barcode
{ 'tube_0' => 'SA00006844' }
end

before { allow(AssetBarcode).to receive(:new_barcode).and_return('6') }

it 'can be performed' do
it 'performs the action successfully' do
expect(uat_action.perform).to be true
expect(uat_action.report['tube_0']).to eq report['tube_0']
expect(Tube.find_by_barcode(report['tube_0']).aliquots.first.study).to eq study
end

it 'returns the expected barcode in the report' do
uat_action.perform
expect(uat_action.report['tube_0']).to eq expected_report['tube_0']
end

it 'assigns the correct study to the tube' do
uat_action.perform
tube = Tube.find_by_barcode(expected_report['tube_0'])
expect(tube.aliquots.first.study).to eq study
end

it 'sets the correct sample metadata values' do
uat_action.perform
tube = Tube.find_by_barcode(expected_report['tube_0'])
sample_metadata = tube.aliquots.first.sample.sample_metadata
expect(sample_metadata).to have_attributes(
supplier_name: 'sample_NT6T_0',
collected_by: UatActions::StaticRecords.collection_site,
donor_id: 'sample_NT6T_0_donor',
sample_common_name: 'human'
)
end
end
end
Expand Down
Loading