Class: TagGroup

Inherits:
ApplicationRecord show all
Includes:
Uuid::Uuidable
Defined in:
app/models/tag_group.rb

Defined Under Namespace

Classes: AdapterType, FormObject

Constant Summary collapse

CHROMIUM_ADAPTER_TYPE =
'Chromium'.freeze

Instance Method Summary collapse

Methods included from Uuid::Uuidable

included, #unsaved_uuid!, #uuid

Methods inherited from ApplicationRecord

convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!

Methods included from Warren::BroadcastMessages

#broadcast, included, #queue_associated_for_broadcast, #queue_for_broadcast, #warren

Instance Method Details

#adapter_type_nameObject


22
23
24
# File 'app/models/tag_group.rb', line 22

def adapter_type_name
  adapter_type.try(:name) || TagGroup::AdapterType::UNSPECIFIED
end

#indexed_tagsObject

Returns a Hash that maps from the tag index in the group to the oligo sequence for the tag


27
28
29
# File 'app/models/tag_group.rb', line 27

def indexed_tags
  Hash[tags.map { |tag| [tag.map_id, tag.oligo] }]
end

#tags_sorted_by_map_idObject


18
19
20
# File 'app/models/tag_group.rb', line 18

def tags_sorted_by_map_id
  tags.sort_by(&:map_id)
end