Thanks!!!! It works fine now and, as you said, substantially faster also.
This is what I did,
foreach my $pair (@lpairs) {
my $n = 0;
my $z = 0;
my $hl;
my $pvalue = 0;
my $pvt = 0;
my $fk;
foreach $fk (%ipairs) {
if( exists $ipairs{$fk} && exists $ipairs{$fk}{$pair} && exi
+sts $ipairs{$fk}{$pair}{'pvalue'}){
#if($ipairs{$fk}{$pair}{'pvalue'}){
$pvt = $ipairs{$fk}{$pair}{'pvalue'};
if($pvt){
unless($hl){
$hl = $ipairs{$fk}{$pair}{'head'};
}
$n++;
$z+= qnorm($ipairs{$fk}{$pair}{'pvalue'});
}
}
}
if($n>2){
$z = $z/sqrt($n);
$pvalue = pnorm($z);
}
if ($pvalue) {
#printf "$pair -> %.4f\n", $pvalue;
printf OF "$hl %.4f $n\n", $pvalue;
}
}
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|