Class: Bio::Ipcress::Result
- Inherits:
-
Object
- Object
- Bio::Ipcress::Result
- Defined in:
- lib/bio/appl/ipcress.rb
Overview
Ipcress single result (single primer pair match)
Attributes of this class should be largely obvious by inspecting the Ipcress output
Instance Attribute Summary collapse
-
#experiment_name ⇒ Object
Returns the value of attribute experiment_name.
-
#forward_matching_sequence ⇒ Object
A String representing the matching part of the sequence.
-
#forward_mismatches ⇒ Object
Returns the value of attribute forward_mismatches.
-
#forward_primer_sequence ⇒ Object
A String representing the matching primer.
-
#length ⇒ Object
Returns the value of attribute length.
-
#matches ⇒ Object
Returns the value of attribute matches.
-
#primers ⇒ Object
Returns the value of attribute primers.
-
#product ⇒ Object
Returns the value of attribute product.
-
#result_type ⇒ Object
Returns the value of attribute result_type.
-
#reverse_matching_sequence ⇒ Object
A String representing the matching part of the sequence.
-
#reverse_mismatches ⇒ Object
Returns the value of attribute reverse_mismatches.
-
#reverse_primer_sequence ⇒ Object
A String representing the matching primer.
-
#start ⇒ Object
Returns the value of attribute start.
-
#target ⇒ Object
Returns the value of attribute target.
Instance Method Summary collapse
-
#recalculate_mismatches_from_alignments ⇒ Object
When there are wobbles in the primers, Ipcress always reports at least 1 mismatch (1 for all matching wobbles plus regular mismatches).
Instance Attribute Details
#experiment_name ⇒ Object
Returns the value of attribute experiment_name.
133 134 135 |
# File 'lib/bio/appl/ipcress.rb', line 133 def experiment_name @experiment_name end |
#forward_matching_sequence ⇒ Object
A String representing the matching part of the sequence
138 139 140 |
# File 'lib/bio/appl/ipcress.rb', line 138 def forward_matching_sequence @forward_matching_sequence end |
#forward_mismatches ⇒ Object
Returns the value of attribute forward_mismatches.
149 150 151 |
# File 'lib/bio/appl/ipcress.rb', line 149 def forward_mismatches @forward_mismatches end |
#forward_primer_sequence ⇒ Object
A String representing the matching primer
141 142 143 |
# File 'lib/bio/appl/ipcress.rb', line 141 def forward_primer_sequence @forward_primer_sequence end |
#length ⇒ Object
Returns the value of attribute length.
149 150 151 |
# File 'lib/bio/appl/ipcress.rb', line 149 def length @length end |
#matches ⇒ Object
Returns the value of attribute matches.
135 136 137 |
# File 'lib/bio/appl/ipcress.rb', line 135 def matches @matches end |
#primers ⇒ Object
Returns the value of attribute primers.
135 136 137 |
# File 'lib/bio/appl/ipcress.rb', line 135 def primers @primers end |
#product ⇒ Object
Returns the value of attribute product.
135 136 137 |
# File 'lib/bio/appl/ipcress.rb', line 135 def product @product end |
#result_type ⇒ Object
Returns the value of attribute result_type.
135 136 137 |
# File 'lib/bio/appl/ipcress.rb', line 135 def result_type @result_type end |
#reverse_matching_sequence ⇒ Object
A String representing the matching part of the sequence
147 148 149 |
# File 'lib/bio/appl/ipcress.rb', line 147 def reverse_matching_sequence @reverse_matching_sequence end |
#reverse_mismatches ⇒ Object
Returns the value of attribute reverse_mismatches.
149 150 151 |
# File 'lib/bio/appl/ipcress.rb', line 149 def reverse_mismatches @reverse_mismatches end |
#reverse_primer_sequence ⇒ Object
A String representing the matching primer
144 145 146 |
# File 'lib/bio/appl/ipcress.rb', line 144 def reverse_primer_sequence @reverse_primer_sequence end |
#start ⇒ Object
Returns the value of attribute start.
149 150 151 |
# File 'lib/bio/appl/ipcress.rb', line 149 def start @start end |
#target ⇒ Object
Returns the value of attribute target.
135 136 137 |
# File 'lib/bio/appl/ipcress.rb', line 135 def target @target end |
Instance Method Details
#recalculate_mismatches_from_alignments ⇒ Object
When there are wobbles in the primers, Ipcress always reports at least 1 mismatch (1 for all matching wobbles plus regular mismatches).
This method recalculates the mismatches by re-aligning the primers against the sequences that they hit in this Result.
Returns an array of 2 values corresponding to the number of mismatches in the forward and revcomp primers, respectively.
Assumes that there is only wobbles in the primers, not the sequence (Does ipcress itself assume this?)
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
# File 'lib/bio/appl/ipcress.rb', line 162 def recalculate_mismatches_from_alignments calculate_mismatches = lambda do |seq, primer| mismatches = 0 (0..(seq.length-1)).each do |position| regex = Bio::Sequence::NA.new(primer[position].downcase).to_re seqp = seq[position].downcase mismatches += 1 unless regex.match(seqp) end mismatches end return [ calculate_mismatches.call(@forward_matching_sequence, @forward_primer_sequence), calculate_mismatches.call(@reverse_matching_sequence, @reverse_primer_sequence) ] end |