Class: Align::BasicScoring

Inherits:
Object
  • Object
show all
Defined in:
lib/align/basic_scoring.rb

Overview

Basic Scoring interface

Instance Method Summary collapse

Constructor Details

#initialize(align_match, align_mismatch, gap_penalty) ⇒ BasicScoring

Returns a new instance of BasicScoring.

Parameters:

  • align_match (Numeric)

    Price for alignment.

  • align_mismatch (Numeric)

    Penalty for misalignment

  • gap_penalty (Numeric)

    Gap penalty for insert/delete



7
8
9
10
11
# File 'lib/align/basic_scoring.rb', line 7

def initialize(align_match, align_mismatch, gap_penalty)
  @align_match = align_match
  @align_mismatch = align_mismatch
  @gap_penalty = gap_penalty
end

Instance Method Details

#score_align(a, b) ⇒ Object



13
14
15
# File 'lib/align/basic_scoring.rb', line 13

def score_align(a,b)
  (a == b) ? @align_match : @align_mismatch
end

#score_delete(a) ⇒ Object



21
22
23
# File 'lib/align/basic_scoring.rb', line 21

def score_delete(a)
  @gap_penalty
end

#score_insert(a) ⇒ Object



17
18
19
# File 'lib/align/basic_scoring.rb', line 17

def score_insert(a)
  @gap_penalty
end