]> git.donarmstrong.com Git - function2gene.git/blobdiff - bin/combine_results
skip ENSG results, and use average weight
[function2gene.git] / bin / combine_results
index 3760b3e0a03ab2e2223624d390f78878356a47ba..49c1ca6da1b32aea859b0daa132d1648888c0ed5 100755 (executable)
@@ -276,9 +276,9 @@ for my $keyword (keys %keyword_keyword) {
      $auto_weight{$keyword} = $results_by_this_keyword/$results_combined;
 }
 
-my $max_weight = max(values %auto_weight);
+my $avg_weight = sum(values %auto_weight) / scalar keys %auto_weight;
 for my $keyword (keys %auto_weight) {
-     $auto_weight{$keyword} = $auto_weight{$keyword}/$max_weight;
+     $auto_weight{$keyword} = $auto_weight{$keyword}/$avg_weight;
 }
 
 print {$results_fh} join(',',map {qq("$_")} @csv_fields),qq(\n);