$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);
$mech->get($url);
my $response = $mech->content();
my @result_urls = $response =~ m#<a\s+target\=\'card\'\s+href=\"(carddisp\.pl\?[^\"]+)\"\s*>#sg;
+ @result_urls = grep {$_ !~ /gene=ENSG\d+\&/i} @result_urls;
my $dir_name = eval qq("$options{name}") or die $@;
if (not -d "$options{dir}/$dir_name") {
mkdir("$options{dir}/$dir_name") or die "Unable to make directory $options{dir}/$dir_name $!";