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)


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

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



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

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



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

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

#used_aliquots_attributes=(used_aliquot_options) ⇒ Object



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

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