class Bio::Ipcress::Result
Ipcress
single result (single primer pair match)
Attributes of this class should be largely obvious by inspecting the Ipcress
output
Attributes
A String representing the matching part of the sequence
A String representing the matching primer
A String representing the matching part of the sequence
A String representing the matching primer
Public Instance Methods
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?)
# 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