Class: Bio::Sequence

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

Overview

Monkey patching to Bio::Sequence to find snps between sequences. It assumes the sequences are already aligned and doesn’t check if a base on the first sequence is valid on the second.

Class Method Summary collapse

Class Method Details

.snps_between(seq1, seq2) ⇒ Object



128
129
130
131
132
133
134
# File 'lib/bio/BIOExtensions.rb', line 128

def self.snps_between(seq1, seq2)
  snps=0
  for i in (0..seq1.size-1)
    snps += 1 if seq1[i] != seq2[i] 
  end
  snps
end