From 766ad5225a78970eef161db44b8ea86f3e37bbc9 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Thu, 28 Feb 2008 02:18:23 +0000 Subject: [PATCH 1/1] skip ENSG results, and use average weight git-svn-id: file:///srv/svn/function2gene/trunk@38 a0738b58-4706-0410-8799-fb830574a030 --- bin/combine_results | 4 ++-- bin/get_genecard_results | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/combine_results b/bin/combine_results index 3760b3e..49c1ca6 100755 --- a/bin/combine_results +++ b/bin/combine_results @@ -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); diff --git a/bin/get_genecard_results b/bin/get_genecard_results index ac38e29..1b94f62 100755 --- a/bin/get_genecard_results +++ b/bin/get_genecard_results @@ -121,6 +121,7 @@ while (<$terms>) { $mech->get($url); my $response = $mech->content(); my @result_urls = $response =~ m##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 $!"; -- 2.39.2