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

experiment_name[RW]
forward_matching_sequence[RW]

A String representing the matching part of the sequence

forward_mismatches[RW]
forward_primer_sequence[RW]

A String representing the matching primer

length[RW]
matches[RW]
primers[RW]
product[RW]
result_type[RW]
reverse_matching_sequence[RW]

A String representing the matching part of the sequence

reverse_mismatches[RW]
reverse_primer_sequence[RW]

A String representing the matching primer

start[RW]
target[RW]

Public Instance Methods

recalculate_mismatches_from_alignments() click to toggle source

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