Open andrewsparkes opened 1 year ago
At the most basic level you can turn any sample into a compound sample by just updating its 'component_samples' as follows:
context 'Can create a compound sample containing 9216 component samples for Bioscan' do
let!(:compound_sample) { create(:sample) }
let(:component_samples) { create_list :sample, 9216 }
before do
compound_sample.update(component_samples: component_samples)
end
it 'contains the expected number of samples' do
expect(compound_sample.component_samples.count).to eq(9216)
expect(compound_sample.component_samples).to match_array component_samples
end
end
The above test takes 2mins 43s to run on my laptop. Although note that this includes the time to create the 9216 samples, the actual join is probably fairly quick.
See app/models/compound_aliquot.rb This is a factory class for creating Aliquots with compound samples in them. Called from Request::SampleCompoundAliquotTransfer, in the context of a Request.
Has validations: That tag depth is unique for each sample That all samples are in the same study That all samples are in the same project Checks that compound sample doesn’t already exist for source_aliquots list
Options for Bioscan:
Option 2 is simpler. As we don't really care about the compound sample on the Limber side.
Options for naming for compound sample: Given we can't combine sample names (9216), or source plate barcodes (96), or 384 plate barcodes (24) because that would be impractical, we have limited options. There should not be more than one compound sample for a group of samples.
Validations for Bioscan compound sample creation: Assumptions:
Validations/checks:
Steps:
Description Research the creation of a compound sample using the 9216 samples from the XP tube, using own wrapper if needed, with specific Bioscan validation. To be called from within an async Sequencescape job worker.
Who the primary contacts are for this work PSD
Knowledge or Stake holders PSD
Additional context or information The existing compound sample code in Cardinal creates the samples in the Sequencing Request class and requires the 3rd 'depth' tag parameter. We would want to create a compound sample in an asynchronous job worker triggered by a button on the Limber XP tube screen, and would not have that depth tag parameter or be doing sequencing yet. We want the sample so there is only one exported to Traction instead of 9216.