Class: Bio::DB::Alignment

Inherits:
Object
  • Object
show all
Defined in:
lib/bio-cigar/sam.rb

Instance Method Summary collapse

Instance Method Details

#percent_identity(reference_sequence) ⇒ Object

Work out the percent identity given of the query sequence against the reference sequence, using the CIGAR string as the alignment



7
8
9
10
11
12
# File 'lib/bio-cigar/sam.rb', line 7

def percent_identity(reference_sequence)
  return Bio::Cigar.new(self.cigar).percent_identity(
    reference_sequence[self.pos-1...reference_sequence.length],
    self.seq
  )
end