Class: Bio::Jaspar::Record
- Inherits:
-
Array
- Object
- Array
- Bio::Jaspar::Record
- Defined in:
- lib/bio-jaspar/jaspar.rb
Overview
Attributes
-
version
- The JASPAR version used
Instance Method Summary collapse
-
#initialize ⇒ Record
constructor
Construct a record instance.
-
#to_h ⇒ Object
Return the list of matrices as a hash (ruby equivalent of dict) of matrices.
-
#to_s ⇒ Object
Return a string of all JASPAR motifs in the list.
Constructor Details
#initialize ⇒ Record
Construct a record instance
165 166 167 168 |
# File 'lib/bio-jaspar/jaspar.rb', line 165 def initialize super() @version = nil end |
Instance Method Details
#to_h ⇒ Object
Return the list of matrices as a hash (ruby equivalent of dict) of matrices
177 178 179 180 181 182 183 |
# File 'lib/bio-jaspar/jaspar.rb', line 177 def to_h dic = {} self.each { |motif| dic[motif.matrix_id] = motif } return dic end |
#to_s ⇒ Object
Return a string of all JASPAR motifs in the list
171 172 173 |
# File 'lib/bio-jaspar/jaspar.rb', line 171 def to_s return self.map { |the_motif| the_motif.to_s }.join("\n") end |