]> git.donarmstrong.com Git - function2gene.git/blobdiff - bin/parse_ensembl_results
* Finish addition of ensembl support
[function2gene.git] / bin / parse_ensembl_results
index cdd1fbacd7cd6905e29ae59da8c3677486c2e3e7..df20b6c541568e01eca5b261a124dba9b4cfa5ba 100755 (executable)
@@ -107,7 +107,7 @@ if ($options{keywords}) {
      if (@ARGV != 1) {
          pod2usage("If the --keywords option is used, exactly one argument (the keyword) must be passed");
      }
-     $options{dir} = "$ARGV[0]_results_genecard";
+     $options{dir} = "$ARGV[0]_results_ensembl";
 }
 
 if (not -d $options{dir}) {
@@ -118,7 +118,7 @@ my $dir = new IO::Dir $options{dir} or die "Unable to open dir $options{dir}: $!
 
 print join(",", map {qq("$_");} qw(Name RefSeq Location Alias Function Description Keyword DBName Filename)),qq(\n);
 
-my ($keyword) = $options{keyword} || $options{dir} =~ m#(?:^|/)([^\/]+)_results_genecard#;
+my ($keyword) = $options{keyword} || $options{dir} =~ m#(?:^|/)([^\/]+)_results_ensembl#;
 
 while ($_ = $dir->read) {
      my $file_name = $_;
@@ -134,9 +134,11 @@ while ($_ = $dir->read) {
      my @results;
 
      # Find gene name
-     ($results[NAME]) = map {s/^[^:]+://; $_;}$result =~ m{a\s+href=\"[^"]+genenames.org[^"]+">\s*([^<]+?)\s*</a>}xis;
+     ($results[NAME]) = $result =~ m{a\s+href=\"[^"]+genenames.org[^"]+">\s*([^<]+?)\s*</a>}xis;
 
      $results[NAME] ||= 'NO NAME';
+     # strip of leading : bits
+     $results[NAME] =~ s/^[^\:]+\://;
      # Find REF SEQ number
      ($results[REFSEQ]) = $result =~ m{for\s*(ENSG\d+)}xis;