Class: Rbfam::Rna
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Rbfam::Rna
- Defined in:
- lib/rbfam/rna.rb
Instance Method Summary collapse
- #_id ⇒ Object
- #gapped_sequence ⇒ Object
- #minus_strand? ⇒ Boolean
- #plus_strand? ⇒ Boolean
- #seq_from ⇒ Object
- #seq_to ⇒ Object
- #strand ⇒ Object
Instance Method Details
#_id ⇒ Object
37 38 39 |
# File 'lib/rbfam/rna.rb', line 37 def _id ("%s %s %s" % [accession, from, to]).gsub(/\W+/, "_") end |
#gapped_sequence ⇒ Object
33 34 35 |
# File 'lib/rbfam/rna.rb', line 33 def gapped_sequence as_bioseq(read_attribute(:gapped_sequence)) end |
#minus_strand? ⇒ Boolean
17 18 19 |
# File 'lib/rbfam/rna.rb', line 17 def minus_strand? !plus_strand? end |
#plus_strand? ⇒ Boolean
13 14 15 |
# File 'lib/rbfam/rna.rb', line 13 def plus_strand? to > from end |
#seq_from ⇒ Object
21 22 23 |
# File 'lib/rbfam/rna.rb', line 21 def seq_from [from, to].min end |
#seq_to ⇒ Object
25 26 27 |
# File 'lib/rbfam/rna.rb', line 25 def seq_to [from, to].max end |
#strand ⇒ Object
9 10 11 |
# File 'lib/rbfam/rna.rb', line 9 def strand plus_strand? ? :plus : :minus end |