class Bio::Sim4::Report::SeqDesc

Bio::Sim4::Report::SeqDesc stores sequence information of query or subject of sim4 report.

Attributes

definition[R]

definition of the sequence

entry_id[R]

identifier of the sequence

filename[R]

filename of the sequence

len[R]

sequence length of the sequence

Public Class Methods

new(seqid, seqdef, len, filename) click to toggle source

Creates a new object. It is designed to be called internally from Bio::Sim4::Report object. Users shall not use it directly.

   # File lib/bio/appl/sim4/report.rb
88 def initialize(seqid, seqdef, len, filename)
89   @entry_id   = seqid
90   @definition = seqdef
91   @len        = len
92   @filename   = filename
93 end
parse(str, str2 = nil) click to toggle source

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.

    # File lib/bio/appl/sim4/report.rb
106 def self.parse(str, str2 = nil)
107   /^seq[12] \= (.*)(?: \((.*)\))?\,\s*(\d+)\s*bp\s*$/ =~ str
108   seqid = $2
109   filename = $1
110   len = $3.to_i
111   if str2 then
112     seqdef = str2.sub(/^\>\s*/, '')
113     seqid  =seqdef.split(/\s+/, 2)[0] unless seqid
114   else
115     seqdef = (seqid or filename)
116     seqid = filename unless seqid
117   end
118   self.new(seqid, seqdef, len, filename)
119 end