class Bio::DB::Alignment

Public Instance Methods

percent_identity(reference_sequence) click to toggle source

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

# 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