Class: Sequence
- Inherits:
-
Object
- Object
- Sequence
- Defined in:
- lib/seqtrimnext/classes/sequence.rb
Overview
Author: Almudena Bocinos Rioboo
Defines the class Sequence’s attribute
Direct Known Subclasses
Instance Attribute Summary collapse
-
#seq_comment ⇒ Object
Returns the value of attribute seq_comment.
-
#seq_fasta ⇒ Object
Returns the value of attribute seq_fasta.
-
#seq_name ⇒ Object
Returns the value of attribute seq_name.
-
#seq_qual ⇒ Object
Returns the value of attribute seq_qual.
-
#seq_rejected ⇒ Object
Returns the value of attribute seq_rejected.
-
#seq_rejected_by_message ⇒ Object
Returns the value of attribute seq_rejected_by_message.
-
#seq_repeated ⇒ Object
Returns the value of attribute seq_repeated.
-
#seq_reversed ⇒ Object
Returns the value of attribute seq_reversed.
Instance Method Summary collapse
-
#initialize(seq_name, seq_fasta, seq_qual, seq_comment = '') ⇒ Sequence
constructor
storages the name and the contains from fasta sequence.
- #ns_present? ⇒ Boolean
- #seq_is_long_enough(seq_min_length) ⇒ Object
- #to_fasta ⇒ Object
- #to_qual ⇒ Object
- #xs_present? ⇒ Boolean
Constructor Details
#initialize(seq_name, seq_fasta, seq_qual, seq_comment = '') ⇒ Sequence
storages the name and the contains from fasta sequence
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/seqtrimnext/classes/sequence.rb', line 10 def initialize(seq_name,seq_fasta,seq_qual, seq_comment = '') @seq_fasta=seq_fasta @seq_name=seq_name @seq_qual=seq_qual @seq_comment = seq_comment @seq_rejected=false @seq_repeated=false @seq_reversed=false @seq_rejected_by_message='' @ns_present = ns_present? @xs_present = xs_present? # puts "INIT SEQ >>>> #{seq_name} #{seq_specie}" end |
Instance Attribute Details
#seq_comment ⇒ Object
Returns the value of attribute seq_comment.
32 33 34 |
# File 'lib/seqtrimnext/classes/sequence.rb', line 32 def seq_comment @seq_comment end |
#seq_fasta ⇒ Object
Returns the value of attribute seq_fasta.
32 33 34 |
# File 'lib/seqtrimnext/classes/sequence.rb', line 32 def seq_fasta @seq_fasta end |
#seq_name ⇒ Object
Returns the value of attribute seq_name.
32 33 34 |
# File 'lib/seqtrimnext/classes/sequence.rb', line 32 def seq_name @seq_name end |
#seq_qual ⇒ Object
Returns the value of attribute seq_qual.
32 33 34 |
# File 'lib/seqtrimnext/classes/sequence.rb', line 32 def seq_qual @seq_qual end |
#seq_rejected ⇒ Object
Returns the value of attribute seq_rejected.
32 33 34 |
# File 'lib/seqtrimnext/classes/sequence.rb', line 32 def seq_rejected @seq_rejected end |
#seq_rejected_by_message ⇒ Object
Returns the value of attribute seq_rejected_by_message.
33 34 35 |
# File 'lib/seqtrimnext/classes/sequence.rb', line 33 def @seq_rejected_by_message end |
#seq_repeated ⇒ Object
Returns the value of attribute seq_repeated.
32 33 34 |
# File 'lib/seqtrimnext/classes/sequence.rb', line 32 def seq_repeated @seq_repeated end |
#seq_reversed ⇒ Object
Returns the value of attribute seq_reversed.
32 33 34 |
# File 'lib/seqtrimnext/classes/sequence.rb', line 32 def seq_reversed @seq_reversed end |
Instance Method Details
#ns_present? ⇒ Boolean
35 36 37 |
# File 'lib/seqtrimnext/classes/sequence.rb', line 35 def ns_present? return (@seq_fasta.index('N') != nil) end |
#seq_is_long_enough(seq_min_length) ⇒ Object
43 44 45 |
# File 'lib/seqtrimnext/classes/sequence.rb', line 43 def seq_is_long_enough(seq_min_length) return (@seq_fasta.length>=seq_min_length) end |
#to_fasta ⇒ Object
47 48 49 |
# File 'lib/seqtrimnext/classes/sequence.rb', line 47 def to_fasta return ">"+@seq_name.to_s+"\n"+@seq_fasta end |
#to_qual ⇒ Object
51 52 53 |
# File 'lib/seqtrimnext/classes/sequence.rb', line 51 def to_qual return ">"+@seq_name.to_s+"\n"+"#{@seq_qual}" end |
#xs_present? ⇒ Boolean
39 40 41 |
# File 'lib/seqtrimnext/classes/sequence.rb', line 39 def xs_present? return (@seq_fasta.index('X') != nil) end |