class Ulla::Esst

Attributes

colnames[RW]
label[RW]
matrix[RW]
no[RW]
rownames[RW]
type[RW]

Public Class Methods

new(type, label, no, colnames=[], rownames=[], matrix = nil) click to toggle source
# File lib/ulla/esst.rb, line 6
def initialize(type, label, no, colnames=[], rownames=[], matrix = nil)
  @type     = type
  @label    = label
  @no       = no
  @colnames = colnames
  @rownames = rownames
  @matrix   = matrix
end

Public Instance Methods

score(from_aa, to_aa) click to toggle source
# File lib/ulla/esst.rb, line 25
def score(from_aa, to_aa)
  i = colnames.index(from_aa)
  j = rownames.index(to_aa)
  @matrix[i, j]
end
scores_from(aa) click to toggle source
# File lib/ulla/esst.rb, line 15
def scores_from(aa)
  i = colnames.index(aa)
  @matrix[i, 0..-1]
end
scores_to(aa) click to toggle source
# File lib/ulla/esst.rb, line 20
def scores_to(aa)
  j = rownames.index(aa)
  @matrix[0..-1, j]
end