]> git.donarmstrong.com Git - function2gene.git/commitdiff
skip ENSG results, and use average weight
authorDon Armstrong <don@donarmstrong.com>
Thu, 28 Feb 2008 02:18:23 +0000 (02:18 +0000)
committerDon Armstrong <don@donarmstrong.com>
Thu, 28 Feb 2008 02:18:23 +0000 (02:18 +0000)
git-svn-id: file:///srv/svn/function2gene/trunk@38 a0738b58-4706-0410-8799-fb830574a030

bin/combine_results
bin/get_genecard_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);
index ac38e29d6767e8cb13040eb2b591258f07edf5b2..1b94f626c1f1bab04f51ffd9dfd68754aa375fd7 100755 (executable)
@@ -121,6 +121,7 @@ while (<$terms>) {
      $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 $!";