Class: Bio::Spidey::Report::SeqDesc

Inherits:
Object
  • Object
show all
Defined in:
lib/bio/appl/spidey/report.rb

Overview

SeqDesc stores sequence information of query or subject.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(seqid, seqdef, len) ⇒ SeqDesc

Creates a new SeqDesc object. It is designed to be called from Bio::Spidey::Report::* classes. Users shall not call it directly.



84
85
86
87
88
# File 'lib/bio/appl/spidey/report.rb', line 84

def initialize(seqid, seqdef, len)
  @entry_id   = seqid
  @definition = seqdef
  @len        = len
end

Instance Attribute Details

#definitionObject (readonly)

Definition of the sequence.



94
95
96
# File 'lib/bio/appl/spidey/report.rb', line 94

def definition
  @definition
end

#entry_idObject (readonly)

Identifier of the sequence.



91
92
93
# File 'lib/bio/appl/spidey/report.rb', line 91

def entry_id
  @entry_id
end

#lenObject (readonly)

Length of the sequence.



97
98
99
# File 'lib/bio/appl/spidey/report.rb', line 97

def len
  @len
end

Class Method Details

.parse(str) ⇒ Object

Parses piece of Spidey result text and creates a new SeqDesc object. It is designed to be called from Bio::Spidey::Report::* classes. Users shall not call it directly.



102
103
104
105
106
107
108
# File 'lib/bio/appl/spidey/report.rb', line 102

def self.parse(str)
  /^(Genomic|mRNA)\:\s*(([^\s]*) (.+))\, (\d+) bp\s*$/ =~ str.to_s
  seqid  = $3
  seqdef = $2
  len    = ($5 ? $5.to_i : nil)
  self.new(seqid, seqdef, len)
end