[BioRuby-cvs] bioruby/lib/bio/appl/genscan report.rb,1.3,1.4
Mitsuteru C. Nakao
nakao at pub.open-bio.org
Sun Aug 7 02:20:44 EDT 2005
Update of /home/repository/bioruby/bioruby/lib/bio/appl/genscan
In directory pub.open-bio.org:/tmp/cvs-serv16971/lib/bio/appl/genscan
Modified Files:
report.rb
Log Message:
* Re-formated codes.
Index: report.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/genscan/report.rb,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** report.rb 5 Nov 2004 06:41:06 -0000 1.3
--- report.rb 7 Aug 2005 05:35:18 -0000 1.4
***************
*** 29,40 ****
class Genscan
! # Bio::Genscan::Report
class Report
! attr_reader :genscan_version, :date_run, :time
attr_reader :query_name
alias_method :sequence_name, :query_name
alias_method :name, :query_name
! attr_reader :length, :gccontent, :isochore
attr_reader :matrix
attr_reader :predictions
--- 29,44 ----
class Genscan
! # Bio::Genscan::Report - Class for Genscan report output.
class Report
! attr_reader :genscan_version
! attr_reader :date_run
! attr_reader :time
attr_reader :query_name
alias_method :sequence_name, :query_name
alias_method :name, :query_name
! attr_reader :length
! attr_reader :gccontent
! attr_reader :isochore
attr_reader :matrix
attr_reader :predictions
***************
*** 44,52 ****
# Bio::Genscan::Report.new(str)
def initialize(report)
@predictions = []
@genscan_version = nil
! @date_run = nil
! @time = nil
@query_name = nil
@length = nil
--- 48,58 ----
# Bio::Genscan::Report.new(str)
+ #
+ # Parse a Genscan report output string.
def initialize(report)
@predictions = []
@genscan_version = nil
! @date_run = nil
! @time = nil
@query_name = nil
@length = nil
***************
*** 55,59 ****
@matrix = nil
! report.each("\n") {|line|
case line
when /^GENSCAN/
--- 61,65 ----
@matrix = nil
! report.each("\n") do |line|
case line
when /^GENSCAN/
***************
*** 66,70 ****
break
end
! }
# rests
--- 72,76 ----
break
end
! end
# rests
***************
*** 85,91 ****
sequence_region.gsub!(/^Predicted .+?:/, '')
sequence_region.gsub!(/^\s*$/, '')
! sequence_region.split(Bio::FastaFormat::RS).each {|ff|
add_seq(Bio::FastaFormat.new(ff))
! }
end
--- 91,97 ----
sequence_region.gsub!(/^Predicted .+?:/, '')
sequence_region.gsub!(/^\s*$/, '')
! sequence_region.split(Bio::FastaFormat::RS).each do |ff|
add_seq(Bio::FastaFormat.new(ff))
! end
end
***************
*** 100,103 ****
--- 106,110 ----
private :parse_headline
+
# Bio::Genscan::Report#parse_sequence
def parse_sequence(line)
***************
*** 182,186 ****
@polyA = nil
end
! attr_reader :number, :aaseq, :naseq, :exons, :promoter, :polyA
--- 189,198 ----
@polyA = nil
end
! attr_reader :number
! attr_reader :aaseq
! attr_reader :naseq
! attr_reader :exons
! attr_reader :promoter
! attr_reader :polyA
***************
*** 238,242 ****
! # Bio::Genescan::Report::Exon.new(gene_number, exon_type, strand, first, end, length, frame, phase, acceptor_score, donor_score, score, p_value, t_score)
def initialize(gnex, t, s, b, e, len, fr, ph, iac, dot, cr, prob, ts)
@gene_number, @number = gnex.split(".").map {|n| n.to_i }
--- 250,256 ----
! # Bio::Genescan::Report::Exon.new(gene_number, exon_type, strand, first,
! # end, length, frame, phase, acceptor_score, donor_score, score, p_value,
! # t_score)
def initialize(gnex, t, s, b, e, len, fr, ph, iac, dot, cr, prob, ts)
@gene_number, @number = gnex.split(".").map {|n| n.to_i }
***************
*** 254,259 ****
@t_score = ts.to_f
end
! attr_reader :gene_number, :number, :exon_type, :strand,
! :first, :last, :frame, :phase, :score, :p_value, :t_score
alias_method :coding_region_score, :score
--- 268,282 ----
@t_score = ts.to_f
end
! attr_reader :gene_number
! attr_reader :number
! attr_reader :exon_type
! attr_reader :strand
! attr_reader :first
! attr_reader :last
! attr_reader :frame
! attr_reader :phase
! attr_reader :score
! attr_reader :p_value
! attr_reader :t_score
alias_method :coding_region_score, :score
***************
*** 308,386 ****
puts "= class Bio::Genscan::Report "
! rpt = Bio::Genscan::Report.new(report)
! puts "==> rpt.genscan_version "
! p rpt.genscan_version
! puts "==> rpt.date_run "
! p rpt.date_run
! puts "==> rpt.time "
! p rpt.time
! puts "==> rpt.query_name "
! p rpt.query_name
! puts "==> rpt.length "
! p rpt.length
! puts "==> rpt.gccontent "
! p rpt.gccontent
! puts "==> rpt.isochore "
! p rpt.isochore
! puts "==> rpt.matrix "
! p rpt.matrix
! puts "==> rpt.predictions (Array of Bio::Genscan::Report::Gene) "
! puts "==> rpt.predictions.size "
! p rpt.predictions.size
! puts "\n== class Bio::Genscan::Report::Gene "
! rpt.predictions.each {|gene|
! puts " ==> gene.number "
p gene.number
! puts " ==> gene.aaseq (Bio::FastaFormat)"
p gene.aaseq
! puts " ==> gene.naseq (Bio::FastaFormat) "
p gene.naseq
! puts " ==> gene.promoter (Bio::Genscan::Report::Exon)"
p gene.promoter
! puts " ==> gene.polyA (Bio::Genscan::Report::Exon) "
p gene.polyA
! puts " ==> gene.exons (Array of Bio::Genscan::Report::Exon) "
! puts " ==> gene.exons.size "
p gene.exons.size
! puts "\n== class Bio::Genscan::Report::Exon "
gene.exons.each {|exon|
! puts " ==> exon.number "
p exon.number
! puts " ==> exon.exon_type "
p exon.exon_type
! puts " ==> exon.exon_type_long "
p exon.exon_type_long
! puts " ==> exon.strand "
p exon.strand
! puts " ==> exon.first "
p exon.first
! puts " ==> exon.last"
p exon.last
! puts " ==> exon.range (Range)"
p exon.range
! puts " ==> exon.frame"
p exon.frame
! puts " ==> exon.phase"
p exon.phase
! puts " ==> exon.acceptor_score"
p exon.acceptor_score
! puts " ==> exon.donor_score"
p exon.donor_score
! puts " ==> exon.initiation_score"
p exon.initiation_score
! puts " ==> exon.termination_score"
p exon.termination_score
! puts " ==> exon.score"
p exon.score
! puts " ==> exon.p_value"
p exon.p_value
! puts " ==> exon.t_score"
p exon.t_score
puts
--- 331,411 ----
puts "= class Bio::Genscan::Report "
! report = Bio::Genscan::Report.new(report)
! print " report.genscan_version #=> "
! p report.genscan_version
! print " report.date_run #=> "
! p report.date_run
! print " report.time #=> "
! p report.time
! print " report.query_name #=> "
! p report.query_name
! print " report.length #=> "
! p report.length
! print " report.gccontent #=> "
! p report.gccontent
! print " report.isochore #=> "
! p report.isochore
! print " report.matrix #=> "
! p report.matrix
! puts " report.predictions (Array of Bio::Genscan::Report::Gene) "
! print " report.predictions.size #=> "
! p report.predictions.size
!
! report.predictions.each {|gene|
! puts "\n== class Bio::Genscan::Report::Gene "
! print " gene.number #=> "
p gene.number
! print " gene.aaseq (Bio::FastaFormat) #=> "
p gene.aaseq
! print " gene.naseq (Bio::FastaFormat) #=> "
p gene.naseq
! print " ene.promoter (Bio::Genscan::Report::Exon) #=> "
p gene.promoter
! print " gene.polyA (Bio::Genscan::Report::Exon) #=> "
p gene.polyA
! puts " gene.exons (Array of Bio::Genscan::Report::Exon) "
! print " gene.exons.size #=> "
p gene.exons.size
!
gene.exons.each {|exon|
! puts "\n== class Bio::Genscan::Report::Exon "
! print " exon.number #=> "
p exon.number
! print " exon.exon_type #=> "
p exon.exon_type
! print " exon.exon_type_long #=> "
p exon.exon_type_long
! print " exon.strand #=> "
p exon.strand
! print " exon.first #=> "
p exon.first
! print " exon.last #=> "
p exon.last
! print " exon.range (Range) #=> "
p exon.range
! print " exon.frame #=> "
p exon.frame
! print " exon.phase #=> "
p exon.phase
! print " exon.acceptor_score #=> "
p exon.acceptor_score
! print " exon.donor_score #=> "
p exon.donor_score
! print " exon.initiation_score #=> "
p exon.initiation_score
! print " exon.termination_score #=> "
p exon.termination_score
! print " exon.score #=> "
p exon.score
! print " exon.p_value #=> "
p exon.p_value
! print " exon.t_score #=> "
p exon.t_score
puts
More information about the bioruby-cvs
mailing list