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, line 88
def initialize(seqid, seqdef, len, filename)
  @entry_id   = seqid
  @definition = seqdef
  @len        = len
  @filename   = filename
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, 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