Class: SequencescapeExcel::SpecialisedField::ChromiumTagWell
- Inherits:
-
Object
- Object
- SequencescapeExcel::SpecialisedField::ChromiumTagWell
- Includes:
- Base
- Defined in:
- app/sequencescape_excel/sequencescape_excel/specialised_field/chromium_tag_well.rb
Overview
ChromiumTagWell
This class represents a single index tag well for Chromium.
Constant Summary collapse
- TAGS_PER_WELL =
4
Instance Attribute Summary collapse
-
#sf_tag_group ⇒ Object
Returns the value of attribute sf_tag_group.
Attributes included from Base
#sample_manifest_asset, #value
Instance Method Summary collapse
- #link(other_fields) ⇒ Object
-
#update(_attributes = {}) ⇒ Object
Updates the tag well.
Instance Attribute Details
#sf_tag_group ⇒ Object
Returns the value of attribute sf_tag_group.
12 13 14 |
# File 'app/sequencescape_excel/sequencescape_excel/specialised_field/chromium_tag_well.rb', line 12 def sf_tag_group @sf_tag_group end |
Instance Method Details
#link(other_fields) ⇒ Object
41 42 43 |
# File 'app/sequencescape_excel/sequencescape_excel/specialised_field/chromium_tag_well.rb', line 41 def link(other_fields) self.sf_tag_group = other_fields[SequencescapeExcel::SpecialisedField::ChromiumTagGroup] end |
#update(_attributes = {}) ⇒ Object
Updates the tag well.
This method updates the tag well if it is valid. It assigns tags to aliquots based on the number of aliquots.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'app/sequencescape_excel/sequencescape_excel/specialised_field/chromium_tag_well.rb', line 26 def update(_attributes = {}) return unless valid? if asset.aliquots.one? .each { |tag| tag.multitag!(asset) } elsif aliquot_count == TAGS_PER_WELL .zip(aliquots).each { |tag, aliquot| aliquot.assign_attributes(tag:) } else # We should never end up here, as our validation should handle this # However if that fails, something has gone wrong, and we shouldn't proceed # Fail noisily raise StandardError, 'Tag aliquot mismatch' end end |