Class: Bio::TRANSFAC::MATRIX

Inherits:
Bio::TRANSFAC show all
Defined in:
lib/bio/db/transfac.rb

Constant Summary

Constants inherited from Bio::TRANSFAC

DELIMITER, TAGSIZE

Instance Method Summary collapse

Methods inherited from Bio::TRANSFAC

#ac, #cc, #dt, #oc, #os, #ra, #rl, #rn, #rt

Methods inherited from DB

#entry_id, #exists?, #fetch, #get, open, #tags

Constructor Details

#initialize(entry) ⇒ MATRIX

Returns a new instance of MATRIX.



90
91
92
# File 'lib/bio/db/transfac.rb', line 90

def initialize(entry)
  super(entry)
end

Instance Method Details

#baObject

BA Statistical basis



132
133
134
# File 'lib/bio/db/transfac.rb', line 132

def ba
  field_fetch('BA')
end

#bfObject

BF List of linked factor entries



105
106
107
# File 'lib/bio/db/transfac.rb', line 105

def bf
  field_fetch('bf')
end

#deObject

DE Short factor description



100
101
102
# File 'lib/bio/db/transfac.rb', line 100

def de
  field_fetch('DE')
end

#maObject



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/bio/db/transfac.rb', line 110

def ma
  ma_dat = {}
  ma_ary = []
  key = ''
  @orig.each do |k, v|
    if k =~ /^0*(\d+)/
      key = $1.to_i
      ma_dat[key] = fetch(k) unless ma_dat[key]
    end
  end
  ma_dat.keys.sort.each_with_index do |k, i|
    rep_nt = ma_dat[k].slice!(-1, 1)
    ma_dat[k].slice!(-1, 1)
    ma_ary[i] = ma_dat[k].split(/\s+/)
    ma_ary[i].each_with_index do |x, j|
      ma_ary[i][j] = x.to_i
    end
  end
  Matrix[*ma_ary]
end

#naObject

NA Name of the binding factor



95
96
97
# File 'lib/bio/db/transfac.rb', line 95

def na
  field_fetch('NA')
end