Class: Bio::TRANSFAC::MATRIX
- Inherits:
-
Bio::TRANSFAC
- Object
- DB
- EMBLDB
- Bio::TRANSFAC
- Bio::TRANSFAC::MATRIX
- Defined in:
- lib/bio/db/transfac.rb
Constant Summary
Constants inherited from Bio::TRANSFAC
Instance Method Summary collapse
-
#ba ⇒ Object
BA Statistical basis.
-
#bf ⇒ Object
BF List of linked factor entries.
-
#de ⇒ Object
DE Short factor description.
-
#initialize(entry) ⇒ MATRIX
constructor
A new instance of MATRIX.
- #ma ⇒ Object
-
#na ⇒ Object
NA Name of the binding factor.
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
#ba ⇒ Object
BA Statistical basis
132 133 134 |
# File 'lib/bio/db/transfac.rb', line 132 def ba field_fetch('BA') end |
#bf ⇒ Object
BF List of linked factor entries
105 106 107 |
# File 'lib/bio/db/transfac.rb', line 105 def bf field_fetch('bf') end |
#de ⇒ Object
DE Short factor description
100 101 102 |
# File 'lib/bio/db/transfac.rb', line 100 def de field_fetch('DE') end |
#ma ⇒ Object
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 |
#na ⇒ Object
NA Name of the binding factor
95 96 97 |
# File 'lib/bio/db/transfac.rb', line 95 def na field_fetch('NA') end |