Class: Pacbio::Pool

Inherits:
ApplicationRecord show all
Includes:
Aliquotable, MultiSourcedPool
Defined in:
app/models/pacbio/pool.rb

Overview

Pool

Instance Method Summary collapse

Methods included from MultiSourcedPool

#source_identifier

Methods included from Aliquotable

#used_aliquots_volume

Instance Method Details

#collection?Boolean

Returns:

  • (Boolean)


54
55
56
# File 'app/models/pacbio/pool.rb', line 54

def collection?
  used_aliquots.length > 1
end

#sequencing_platesArray

Returns of Plates attached to a sequencing run.

Returns:

  • (Array)

    of Plates attached to a sequencing run



45
46
47
# File 'app/models/pacbio/pool.rb', line 45

def sequencing_plates
  wells&.collect(&:plate)
end

#sequencing_runsArray

Returns of Runs that the pool is used in.

Returns:

  • (Array)

    of Runs that the pool is used in



50
51
52
# File 'app/models/pacbio/pool.rb', line 50

def sequencing_runs
  wells&.collect(&:run)&.uniq
end

#used_aliquots_attributes=(used_aliquot_options) ⇒ Object



34
35
36
37
38
39
40
41
42
# File 'app/models/pacbio/pool.rb', line 34

def used_aliquots_attributes=(used_aliquot_options)
  self.used_aliquots = used_aliquot_options.map do |attributes|
    if attributes['id']
      update_item(attributes, indexed_used_aliquots, 'Aliquot')
    else
      Aliquot.new(attributes.merge(aliquot_type: :derived))
    end
  end
end