Thanks for the info. I have actually fixed this in an as yet
unreleased version, for which my fix was slightly different:
# the correction factor should never be less than 1
if ($correctionFactor < 1){
die "Internal Error : The correction factor ($correctionFactor)
cannot be less than 1.";
}
# simply go through each hypothesis and calculate the corrected
# p-value by multiplying the uncorrected p-value by the number of
# nodes in the ontology
foreach my $hypothesis ($self->__pValues){
$hypothesis->{CORRECTED_PVALUE} = $hypothesis->{PVALUE} *
$correctionFactor;
# make sure we have a ceiling of 1
$hypothesis->{CORRECTED_PVALUE} = 1 if ($hypothesis->
{CORRECTED_PVALUE} > 1);
}
became:
# no correction needs to be done if there is 0 or 1 hypotheses
# that were tested
if ($correctionFactor > 1){
# simply go through each hypothesis and calculate the corrected
# p-value by multiplying the uncorrected p-value by the number of
# nodes in the ontology
foreach my $hypothesis ($self->__pValues){
$hypothesis->{CORRECTED_PVALUE} = $hypothesis->{PVALUE} *
$correctionFactor;
# make sure we have a ceiling of 1
$hypothesis->{CORRECTED_PVALUE} = 1 if ($hypothesis->
{CORRECTED_PVALUE} > 1);
}
}
which I think works fine (it eliminates the crash), but I'll have to
think about whether your fix is preferable.
Cheers,
Gavin
On Feb 8, 2008, at 12:36 AM, Patrick Kemmeren via RT wrote:
Show quoted text>
> Fri Feb 08 03:36:24 2008: Request 33010 was acted upon.
> Transaction: Ticket created by pkemmeren
> Queue: GO-TermFinder
> Subject: GO::TermFinder crashes when no pvalues are reported
> and multiple
> testing is enabled
> Broken in: 0.8
> Severity: Important
> Owner: Nobody
> Requestors: p.kemmeren@umcutrecht.nl
> Status: new
> Ticket <URL:
http://rt.cpan.org/Ticket/Display.html?id=33010 >
>
>
> Dear author,
>
> The GO::TermFinder module crashes when no pvalues are found for a
> given
> set of input genes. Most likely this is due to the fact that these
> genes
> have no annotation at all. When I run the GO::TermFinder module using
> two Saccharomyces cerevisiae input genes, YEF1 and UTR1 and search for
> significant cellular components, bonferroni corrected, I'm getting the
> following error message:
>
> Uncaught exception from user code:
> Internal Error : The correction factor (0) cannot be less than
> 1. at
> /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/GO/
> TermFinder.pm
> line 1542.
> at
> /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/GO/
> TermFinder.pm
> line 1542
>
> GO::TermFinder::__correctPvaluesBybonferroni('GO::TermFinder=HASH
> (0xb62f291c)')
> called at
> /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/GO/
> TermFinder.pm
> line 1521
>
> GO::TermFinder::__correctPvalues('GO::TermFinder=HASH(0xb62f291c)')
> called at
> /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/GO/
> TermFinder.pm
> line 658
>
> This is also reproducible on the SGD website itself.
> The underlying problem seems to be at line number 658, where no
> checking
> is done whether actual pvalues are obtained initially and the multiple
> testing procedure is run regardless of pvalues.
>
> I've fixed this accordingly:
>
> Before:
> $self->__correctPvalues unless ($self->__correctionMethod eq
> 'none');
>
> After:
> $self->__correctPvalues unless ($self->__correctionMethod eq
> 'none'
> || scalar( @{ $self->{$kPvalues} } ) == 0 );
>
> Kind regards,
>
> Patrick