[BioRuby] Bio::Blat

Davide Rambaldi davide.rambaldi at ifom-ieo-campus.it
Tue Sep 2 10:28:59 UTC 2008


Hi all, I am trying to use Ruby and BioRuby to translate a Perl  
script that I am using in my lab to parse psl files.

The blatanalyzer script should:

sort entries according to identity, coverage, score, cut psl files in  
order to keep only alignments with a given identity,
generate report tables (similar to a web blat result table in the  
UCSC server), convert psl to gff and gtf, etc...

USAGE:

Usage ./blatanalyzer.rb [options] action file.psl

and can be used also in a pipe (cat file.psl | ./blatanalyzer.rb action)


I am a newbye of Ruby scripting (and also I am currently trying to  
understand the conventions used in BioRuby) so I am not sure if my  
design is decent or completely stupid/crazy.

First of all, I need some extra methods not present in  
Bio::Blat::Report (like coverage, sorting_by,  grouping, etc...) so  
my idea is to made a subclass of Bio::Blat::Report:

module Bio
   class Blat
     class Analyzer < Report
	def coverage
	  implementation here ...
	end
     end
   end
end

Is this a good idea?


On the other side I am working on a Bio::Blat::Application that  
should initialize options (parsed by a OptParser class), load a  
stream, pass the stream to the Bio::Blat::Analyzer object, choose  
which method (action) apply to the stream.

Is OK to put this code in the Bio::Blat namespace? or I should put it  
in an external Application class?

Actually the structure of my blatanalyzer.rb application is this one

class Color
   # to handle colorized output (use term-ansicolor)
end

class OptParser
   # parse command line options
end

module Bio
   class Blat

     class Analyzer < Report
       # extend the functionality of the Report with sorting,  
grouping and other methods
     end

     class Application
       # load a stream, check options, select action and execute it  
printing result on STDOUT
     end

   end
end

# MAIN.APP
# slurp command line options and start application
options = OptParser.parse(ARGV)
Bio::Blat::Application.new(options,ARGF)


Something I need to change? make sense?

Thanks for your help, any suggestion is really welcome!


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