Class: Seq
- Inherits:
-
Object
- Object
- Seq
- Defined in:
- lib/full_lengther_next/cdhit.rb
Instance Attribute Summary collapse
-
#comments ⇒ Object
Returns the value of attribute comments.
-
#db ⇒ Object
Returns the value of attribute db.
-
#master ⇒ Object
Returns the value of attribute master.
-
#name ⇒ Object
Returns the value of attribute name.
-
#seq_fasta ⇒ Object
Returns the value of attribute seq_fasta.
Instance Method Summary collapse
-
#initialize(name, comments, seq_fasta, master) ⇒ Seq
constructor
master = more representative sequence on a cluster.
- #parse_db(name, comments) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name, comments, seq_fasta, master) ⇒ Seq
master = more representative sequence on a cluster
5 6 7 8 9 10 11 |
# File 'lib/full_lengther_next/cdhit.rb', line 5 def initialize(name, comments, seq_fasta, master) #master = more representative sequence on a cluster @name = name @comments = comments @seq_fasta = seq_fasta @db= parse_db(name, comments) @master = master end |
Instance Attribute Details
#comments ⇒ Object
Returns the value of attribute comments.
4 5 6 |
# File 'lib/full_lengther_next/cdhit.rb', line 4 def comments @comments end |
#db ⇒ Object
Returns the value of attribute db.
4 5 6 |
# File 'lib/full_lengther_next/cdhit.rb', line 4 def db @db end |
#master ⇒ Object
Returns the value of attribute master.
4 5 6 |
# File 'lib/full_lengther_next/cdhit.rb', line 4 def master @master end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/full_lengther_next/cdhit.rb', line 4 def name @name end |
#seq_fasta ⇒ Object
Returns the value of attribute seq_fasta.
4 5 6 |
# File 'lib/full_lengther_next/cdhit.rb', line 4 def seq_fasta @seq_fasta end |
Instance Method Details
#parse_db(name, comments) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/full_lengther_next/cdhit.rb', line 13 def parse_db(name, comments) db=nil if name =~ /^[sp]/ || comments =~ /^[sp]/ db='sp' elsif comments =~ /^[tr]/ db='tr' end return db end |
#to_s ⇒ Object
23 24 25 |
# File 'lib/full_lengther_next/cdhit.rb', line 23 def to_s return ">#{@name} #{@comments}\n#{@seq_fasta}" end |