Class: Robots::PoolingAndSplittingRobot

Inherits:
Robot
  • Object
show all
Defined in:
app/models/robots/pooling_and_splitting_robot.rb

Overview

This Pooling and Splitting robot handles the situation where you are pooling wells from multiple parent plates into wells on multiple child plates, where the child plates have identical well layouts to one another (the content of the source well is split into two destination wells).

For example, in Combined LCM there are 1-4 source plates each with 1-24 samples in the first three columns, being stamped into two child plates with each identical layouts. A1 to H3 on source 1 are stamped into A1 to H3 on both destinations. A4 to H6 on source 2 are stamped into A4 to H6 on both destinations. A7 to H9 on source 3 are stamped into A7 to H9 on both destinations. and A10 to H12 on source 4 are stamped into A10 to H12 on both destinations.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#relationships=(value) ⇒ Object (writeonly)

Sets the attribute relationships

Parameters:

  • value

    the value to set the attribute relationships to.



16
17
18
# File 'app/models/robots/pooling_and_splitting_robot.rb', line 16

def relationships=(value)
  @relationships = value
end

Instance Method Details

#bed_classObject



53
54
55
# File 'app/models/robots/pooling_and_splitting_robot.rb', line 53

def bed_class
  Robots::Bed::PoolingAndSplitting
end

#child_bedsObject



30
31
32
# File 'app/models/robots/pooling_and_splitting_robot.rb', line 30

def child_beds
  @child_beds ||= []
end

#parent_bedsObject



26
27
28
# File 'app/models/robots/pooling_and_splitting_robot.rb', line 26

def parent_beds
  @parent_beds ||= []
end

#used_parentsObject



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

def used_parents
  @used_parents ||= []
end

#valid_relationshipsHash<String => Boolean>

Returns a hash of bed barcodes and their valid state Also adds any errors describing invalid bed states

Returns:

  • (Hash<String => Boolean>)

    Hash of boolean indexed by bed barcode

Raises:

  • (StandardError)


39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'app/models/robots/pooling_and_splitting_robot.rb', line 39

def valid_relationships
  raise StandardError, "Relationships for #{name} are empty" if @relationships.empty?

  @relationships.each do |relationship|
    @parent_beds = relationship.dig('options', 'parents')
    @child_beds = relationship.dig('options', 'children')

    @used_parents = []
    verify_child_beds
    check_for_unused_parents
  end
  verified
end

#verifiedObject



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

def verified
  @verified ||= {}
end