Class: PcrOperation

Inherits:
Object
  • Object
show all
Defined in:
lib/pcr_batching_representation.rb

Overview

Object representation for an individual pcr reaction. PcrOperation keeps track of all the necessary factors for a pcr.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ PcrOperation

make a brand new PcrOperation.

Parameters:

  • opts (Hash) (defaults to: {})

    initialization options

Options Hash (opts):

  • :extension_time (Float)

    extension time for this pcr operation

  • :anneal_temp (Float)

    the annealing temperature for this pcr operation

  • :extension_group (Integer)

    a group id for this operation, shared with other pcr operations who could be run together in a reaction with the same extension time

  • :tanneal_group (Integer)

    a group id for this operation, shared with other pcr operations who could be run together in a reaction with the same annealing temperature

  • :unique_id (Integer)

    identifier to track a pcr operation through its being batched



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/pcr_batching_representation.rb', line 28

def initialize opts = {}
    @extension_time     = opts[:extension_time]
    @anneal_temp        = opts[:anneal_temp]
    @extension_group    = opts[:extension_group]
    @tanneal_group      = opts[:tanneal_group]
    @unique_id          = opts[:unique_id]
    
    if @extension_time.nil? || @anneal_temp.nil? || @extension_time.zero? || @anneal_temp.zero?
        raise "Every pcr operation must have a non-zero extension time and anneal temp"
    end
end

Instance Attribute Details

#anneal_tempObject (readonly)

Returns the value of attribute anneal_temp



13
14
15
# File 'lib/pcr_batching_representation.rb', line 13

def anneal_temp
  @anneal_temp
end

#extension_groupObject (readonly)

Returns the value of attribute extension_group



13
14
15
# File 'lib/pcr_batching_representation.rb', line 13

def extension_group
  @extension_group
end

#extension_timeObject (readonly)

Returns the value of attribute extension_time



13
14
15
# File 'lib/pcr_batching_representation.rb', line 13

def extension_time
  @extension_time
end

#tanneal_groupObject (readonly)

Returns the value of attribute tanneal_group



13
14
15
# File 'lib/pcr_batching_representation.rb', line 13

def tanneal_group
  @tanneal_group
end

#unique_idObject (readonly)

Returns the value of attribute unique_id



13
14
15
# File 'lib/pcr_batching_representation.rb', line 13

def unique_id
  @unique_id
end

Instance Method Details

#to_sObject



58
59
60
# File 'lib/pcr_batching_representation.rb', line 58

def to_s 
    "extension_time: #{@extension_time} + \n anneal_temp: #{@anneal_temp} + \n extension_group: #{@extension_group} + \n tanneal_group: #{@tanneal_group}"
end