Method: Bio::Sim4::Report::SeqDesc.parse

Defined in:
lib/bio/appl/sim4/report.rb

.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