[Bioperl-l] HMMER/Results

Jason Stajich jason@cgt.mc.duke.edu
Thu, 4 Jul 2002 14:13:02 -0400 (EDT)


There's a duplicate add there - the add_Domain in the object Set needs to
know that it should only add an unknown domain to its set.

I've fixed on the branch and trunk.  You'll have to excercise logic
outside of the object for now in order to work around this (plop all the
domains in a hash keyed on the value from the get_nse() function), patch
your local version, or run off the code tagged with branch-1-0-0 from CVS.

-jason

On Thu, 4 Jul 2002, Mick Watson wrote:

> Hi
>
> I've found a bug in the bioperl-1.0.1 HMMER/Results module (I think!!)
>
> The script I've pasted below instantiates a HMMER/Results object and prints
> out the number of domains it contains.  It then iterates through each Set
> object, counting the number of domains for each set.  In theory both of
> these should be the same, and they are.  However, the script then goes on to
> create a new HMMER/Results object using the &filter_on_cutoff method.  It
> then does the same thing to the new object.  What it finds is that somehow,
> each Set now has twice as many domains as it should have ie they have been
> duplicated.
>
> Either that or I am going completely mad!
>
> Any ideas?
>
> Thanks
>
> Mick
>
> #!/usr/bin/perl
>
> use Bio::Tools::HMMER::Results;
>
> my $res = new Bio::Tools::HMMER::Results( -file => "test.hmmout",
>        -type => 'hmmsearch');
>
> my $count = 0;
>
> print "res has ", $res->number, " domains\n";
> foreach $set ($res->each_Set) {
>     $count += scalar($set->each_Domain);
> }
> print "res count = $count\n\n";
>
>
>
> my $newres = $res->filter_on_cutoff(0,0);
>
> my $count = 0;
>
> print "newres has ", $newres->number, " domains\n";
> foreach $set ($newres->each_Set) {
>     $count += scalar($set->each_Domain);
> }
> print "newres count = $count\n\n";
>
>
> ####OUTPUT#####
> res has 4 domains
> res count = 4
>
> newres has 4 domains
> newres count = 8
>
>
> Jason Stajich wrote:
>
> > I believe this is already fixed as of bioperl-1.0.1
> > Can you report what version of bioperl or the revision ID for that
> > module (% perldoc -m Bio::Tools::HMMER::Result | grep Id)
> >
> > -j
> >
> > On Thu, 4 Jul 2002, Mick Watson wrote:
> >
> > > Hi
> > >
> > > In Bio::Tools::HMMER::Results, line 348 has the code:
> > >
> > >     $new = Bio::Tools::HMMER::Results->new();
> > >
> > > This is in the &filter_on_cutoff method.
> > >
> > > However, &new in the same module complains if you don't give it a -type
> > > argument!
> > >
> > > The correct line should be:
> > >
> > >     $new = Bio::Tools::HMMER::Results->new(-type => 'hmmsearch');
> > >
> > > There should also be a "return $new;" as the last line in the method
> > >
> > > Thanks
> > > Mick
> > >
> > > _______________________________________________
> > > Bioperl-l mailing list
> > > Bioperl-l@bioperl.org
> > > http://bioperl.org/mailman/listinfo/bioperl-l
> > >
> >
> > --
> > Jason Stajich
> > Duke University
> > jason at cgt.mc.duke.edu
>

-- 
Jason Stajich
Duke University
jason at cgt.mc.duke.edu