[BioRuby] Bio::Blat::Report
Davide Rambaldi
davide.rambaldi at ifom-ieo-campus.it
Wed Sep 3 05:45:05 EDT 2008
Hi, after installing the last version from git (http://github.com/
bioruby/bioruby), I have a couple of warnings using my application:
NOTE: the file test.psl I am using for testing is without psl headers
Oni:~/code/Ruby/bioruby tucano$ ./blatanalyzer list blatanalyzerdir/
test/test.psl
/usr/local/lib/ruby/site_ruby/1.8/bio/io/flatfile/splitter.rb:81:
warning: private attribute?
/usr/local/lib/ruby/site_ruby/1.8/bio/io/flatfile/splitter.rb:84:
warning: private attribute?
/usr/local/lib/ruby/site_ruby/1.8/bio/io/flatfile/splitter.rb:87:
warning: private attribute?
/usr/local/lib/ruby/site_ruby/1.8/bio/io/flatfile/splitter.rb:90:
warning: private attribute?
/usr/local/lib/ruby/site_ruby/1.8/bio/io/flatfile/splitter.rb:93:
warning: private attribute?
/usr/local/lib/ruby/site_ruby/1.8/bio/io/flatfile/splitter.rb:96:
warning: private attribute?
/usr/local/lib/ruby/site_ruby/1.8/bio/io/flatfile/splitter.rb:270:
warning: private attribute?
/usr/local/lib/ruby/site_ruby/1.8/bio/appl/blat/report.rb:89:
warning: instance variable @header_lines not initialized
The previuos version I was using don't give warnings
here the diff of changes in the new git version and in the previous
report.rb:
diff oldreport.rb /usr/local/lib/ruby/site_ruby/1.8/bio/appl/blat/
report.rb
48a49,51
> # Splitter for Bio::FlatFile
> FLATFILE_SPLITTER = Bio::FlatFile::Splitter::LineOriented
>
53c56
< def initialize(text)
---
> def initialize(text = '')
57c60
< text.each do |line|
---
> text.each_line do |line|
74c77,115
< @columns = parse_header(head)
---
> @columns = parse_header(head) unless head.empty?
> end
>
> # Adds a header line if the header data is not yet given and
> # the given line is suitable for header.
> # Returns self if adding header line is succeeded.
> # Otherwise, returns false (the line is not added).
> def add_header_line(line)
> return false if defined? @columns
> line = line.chomp
> case line
> when /^\d/
> @columns = defined? @header_lines ? parse_header
(@header_lines) : []
> return false
> when /\A\-+\s*\z/
> @columns = defined? @header_lines ? parse_header
(@header_lines) : []
> return self
> else
> @header_lines ||= []
> @header_lines.push line
> end
> end
>
> # Adds a line to the entry if the given line is regarded as
> # a part of the current entry.
> # If the current entry (self) is empty, or the line has the
same
> # query name, the line is added and returns self.
> # Otherwise, returns false (the line is not added).
> def add_line(line)
> if /\A\s*\z/ =~ line then
> return @hits.empty? ? self : false
> end
> hit = Hit.new(line.chomp)
> if @hits.empty? or @hits.first.query.name ==
hit.query.name then
> @hits.push hit
> return self
> else
> return false
> end
Best Regards
Davide Rambaldi,
Bioinformatics PhD student.
-----------------------------------------------------
Bioinformatic Group IFOM-IEO Campus
Via Adamello 16, Milano
I-20139 Italy
[t] +39 02574303 066
[e] davide.rambaldi at ifom-ieo-campus.it
[i] http://ciccarelli.group.ifom-ieo-campus.it/fcwiki/DavideRambaldi
(homepage)
[i] http://www.semm.it (PhD school)
[i] http://www.btbs.unimib.it/ (Master)
-----------------------------------------------------
More information about the BioRuby
mailing list