Class Bio::Sim4::Report::SeqDesc
In: lib/bio/appl/sim4/report.rb
Parent: Object

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

Methods

new   parse  

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

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

[Source]

    # File lib/bio/appl/sim4/report.rb, line 88
88:         def initialize(seqid, seqdef, len, filename)
89:           @entry_id   = seqid
90:           @definition = seqdef
91:           @len        = len
92:           @filename   = filename
93:         end

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.

[Source]

     # File lib/bio/appl/sim4/report.rb, line 106
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

[Validate]