Class: SequencescapeExcel::SpecialisedField::DualIndexTagWell
- Inherits:
-
Object
- Object
- SequencescapeExcel::SpecialisedField::DualIndexTagWell
- Includes:
- Base, ValueRequired, ValueToUpcase
- Defined in:
- app/sequencescape_excel/sequencescape_excel/specialised_field/dual_index_tag_well.rb
Overview
DualIndexTagWell
Constant Summary collapse
- PLATE_SIZE =
96
Instance Attribute Summary collapse
-
#sf_dual_index_tag_set ⇒ Object
Returns the value of attribute sf_dual_index_tag_set.
Attributes included from Base
#sample_manifest_asset, #value
Instance Method Summary collapse
-
#dual_index_tag_set ⇒ Object
From the validation in DualIndexTagSet, we know this tag set is a valid dual index tag set with a visible tag group and visible tag2 group.
- #link(other_fields) ⇒ Object
- #tag2_group_id ⇒ Object
- #tag_group_id ⇒ Object
- #update(_attributes = {}) ⇒ Object
Methods included from ValueToUpcase
Instance Attribute Details
#sf_dual_index_tag_set ⇒ Object
Returns the value of attribute sf_dual_index_tag_set.
17 18 19 |
# File 'app/sequencescape_excel/sequencescape_excel/specialised_field/dual_index_tag_well.rb', line 17 def sf_dual_index_tag_set @sf_dual_index_tag_set end |
Instance Method Details
#dual_index_tag_set ⇒ Object
From the validation in DualIndexTagSet, we know this tag set is a valid dual index tag set with a visible tag group and visible tag2 group
43 44 45 |
# File 'app/sequencescape_excel/sequencescape_excel/specialised_field/dual_index_tag_well.rb', line 43 def dual_index_tag_set @dual_index_tag_set = TagSet.find(sf_dual_index_tag_set.tag_set_id) if sf_dual_index_tag_set&.tag_set_id end |
#link(other_fields) ⇒ Object
37 38 39 |
# File 'app/sequencescape_excel/sequencescape_excel/specialised_field/dual_index_tag_well.rb', line 37 def link(other_fields) self.sf_dual_index_tag_set = other_fields[SequencescapeExcel::SpecialisedField::DualIndexTagSet] end |
#tag2_group_id ⇒ Object
51 52 53 |
# File 'app/sequencescape_excel/sequencescape_excel/specialised_field/dual_index_tag_well.rb', line 51 def tag2_group_id @tag2_group_id ||= ::TagGroup.find_by(id: dual_index_tag_set.tag2_group_id, visible: true).id end |
#tag_group_id ⇒ Object
47 48 49 |
# File 'app/sequencescape_excel/sequencescape_excel/specialised_field/dual_index_tag_well.rb', line 47 def tag_group_id @tag_group_id ||= ::TagGroup.find_by(id: dual_index_tag_set.tag_group_id, visible: true).id end |
#update(_attributes = {}) ⇒ Object
26 27 28 29 30 31 32 33 34 35 |
# File 'app/sequencescape_excel/sequencescape_excel/specialised_field/dual_index_tag_well.rb', line 26 def update(_attributes = {}) return unless valid? # NB. asset here is a well, and a the well_has_single_aliquot? validation ensures there is only one aliquot stock_aliquot = asset.aliquots.first # Update all downstream aliquots as well as current aliquot matching_aliquots = identify_all_matching_aliquots(stock_aliquot) update_all_relevant_aliquots(matching_aliquots, tag, tag2) end |