Bioperl: Bioperl SEQ functions

Michael Lonetto lonettma@mh.us.sbphrd.com
Thu, 1 Jul 1999 16:02:45 -0400 (EDT)


Hi,

I'm with Andrew on this one, and willing to work on it.  Basically anything
that runs on each residue of a sequence should be possible through the same
interface. Note that along the single values for each residue, what people most
often want are windowed totals/averages, where the the window size may vary
depending on application.  

For example, I have a user who scans for contig segments with high proportions
of ambiguous residues with a windows of 150 to 200 bp. 

ML

Michael_A_Lonetto@sbphrd.com  lonettma@mh.us.sbphrd.com
SmithKline Beecham Pharmaceuticals R&D

On Thu, 1 Jul 1999, Matthew Pocock wrote:

> Hi.
> 
> Andrew Dalke wrote:
> 
> > Aaron J Mackey <ajm6q@virginia.edu> suggested sample code
> > of the form:
> > > print Bio::Tools::Hydrophobicity->kyte_doolittle($seq); # yee haw!
> >
> > Following is some software philosophy.  I am against this
> > style of interface because it requires the underlying code
> > to have too much duplication.  Here's why, and a different
> > (IMO better :) solution.
> 
> Interface definitions shouldn't require any code duplication. Common
> implementation code can almost always be either put in a base-class (if
> the code defines an algorithm, flow of control, plan), or in a mixin
> module (if it provides some service, data).
> 
> > <snip/>
> 
> >   The general principle is: push decision logic up as early as you
> > can, not embedded in the code.  This simplifies the code, and
> > if you ever have to do code coverage testing, simplifies your
> > test case development by a lot.
> 
> Also, there should be an object to represent a process, a type of objects
> for each part of the process that can change independantly of the others
> (who's abstract methods are called by the process object, not the client
> code), and all client code should know interfaces, not absolute types. I
> think in this case, we have an object that scores a sequence against a
> scale, with one method for scoring the whole sequence and one for scoring
> a window. We also have many different types of objects that represent
> different scores. Mabey the interface we are talking about would let us
> write code like this:
> 
> use Bio::Tools::Scale::Hydrophobicity;
> use Bio::Tools::Scale::MolecularWeight;
> use Bio::Tools::SequenceScorer;
> 
> $scorer = new Bio::Tools::SequenceScorer;
> $m = Bio::Tools::Scale::MolecularWeight->getScale('mw');
> $d = Bio::Tools::Scale::Hydrophobicity->getScale('kyte_doolittle');
> $e = Bio::Tools::Scale::Hydrophobicity->getScale('esg');
> 
> print $scorer->score($seq, $m);
> print $scorer->score($seq, $d);
> print $scorer->score($seq, $e);
> 
> print $scorer->score_window($seq, $m, 10, 14);
> 
> This looks more like factory methods, and unifies all the interfaces. The
> values of $m, $d, $e can be either a hash, or something more complicated,
> but the client code doesn't care. That is up to Bio::Tools::Scorer,
> Bio::Tools::AbstractScale and Bio::Tools::AbstractScaleFactory to sort out
> between them.
> 
> Just my 2c - probably design overkill on my part, but that is how I would
> like to use it in a script.
> 
> >
> >
> >                                                 Andrew Dalke
> >                                                 dalke@bioreason.com
> > =========== Bioperl Project Mailing List Message Footer =======
> > Project URL: http://bio.perl.org/
> > For info about how to (un)subscribe, where messages are archived, etc:
> > http://www.techfak.uni-bielefeld.de/bcd/Perl/Bio/vsns-bcd-perl.html
> > ====================================================================
> 
> =========== Bioperl Project Mailing List Message Footer =======
> Project URL: http://bio.perl.org/
> For info about how to (un)subscribe, where messages are archived, etc:
> http://www.techfak.uni-bielefeld.de/bcd/Perl/Bio/vsns-bcd-perl.html
> ====================================================================
> 

=========== Bioperl Project Mailing List Message Footer =======
Project URL: http://bio.perl.org/
For info about how to (un)subscribe, where messages are archived, etc:
http://www.techfak.uni-bielefeld.de/bcd/Perl/Bio/vsns-bcd-perl.html
====================================================================