Class: Bio::Sim4::Report::SeqDesc
Overview
Bio::Sim4::Report::SeqDesc stores sequence information of query or subject of sim4 report.
Instance Attribute Summary collapse
-
#definition ⇒ Object
readonly
definition of the sequence.
-
#entry_id ⇒ Object
readonly
identifier of the sequence.
-
#filename ⇒ Object
readonly
filename of the sequence.
-
#len ⇒ Object
readonly
sequence length of the sequence.
Class Method Summary collapse
-
.parse(str, str2 = nil) ⇒ Object
Parses part of sim4 result text and creates new SeqDesc object.
Instance Method Summary collapse
-
#initialize(seqid, seqdef, len, filename) ⇒ SeqDesc
constructor
Creates a new object.
Constructor Details
#initialize(seqid, seqdef, len, filename) ⇒ SeqDesc
Creates a new object. It is designed to be called internally from Bio::Sim4::Report object. Users shall not use it directly.
88 89 90 91 92 93 |
# File 'lib/bio/appl/sim4/report.rb', line 88 def initialize(seqid, seqdef, len, filename) @entry_id = seqid @definition = seqdef @len = len @filename = filename end |
Instance Attribute Details
#definition ⇒ Object (readonly)
definition of the sequence
97 98 99 |
# File 'lib/bio/appl/sim4/report.rb', line 97 def definition @definition end |
#entry_id ⇒ Object (readonly)
identifier of the sequence
95 96 97 |
# File 'lib/bio/appl/sim4/report.rb', line 95 def entry_id @entry_id end |
#filename ⇒ Object (readonly)
filename of the sequence
101 102 103 |
# File 'lib/bio/appl/sim4/report.rb', line 101 def filename @filename end |
#len ⇒ Object (readonly)
sequence length of the sequence
99 100 101 |
# File 'lib/bio/appl/sim4/report.rb', line 99 def len @len end |
Class Method Details
.parse(str, str2 = nil) ⇒ Object
Parses part of sim4 result text and creates new SeqDesc object. It is designed to be called internally from Bio::Sim4::Report object. Users shall not use it directly.
106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/bio/appl/sim4/report.rb', line 106 def self.parse(str, str2 = nil) /^seq[12] \= (.*)(?: \((.*)\))?\,\s*(\d+)\s*bp\s*$/ =~ str seqid = $2 filename = $1 len = $3.to_i if str2 then seqdef = str2.sub(/^\>\s*/, '') seqid =seqdef.split(/\s+/, 2)[0] unless seqid else seqdef = (seqid or filename) seqid = filename unless seqid end self.new(seqid, seqdef, len, filename) end |