[Bio] / FigKernelPackages / FIG.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/FIG.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.750, Thu Feb 5 16:32:57 2009 UTC revision 1.751, Mon Feb 9 17:47:16 2009 UTC
# Line 3026  Line 3026 
3026    my $lineage = "";    my $lineage = "";
3027    if ($content =~ /\&lt\;Lineage\&gt\;cellular organisms; (.*)\&lt\;\/Lineage\&gt\;/) {    if ($content =~ /\&lt\;Lineage\&gt\;cellular organisms; (.*)\&lt\;\/Lineage\&gt\;/) {
3028      $lineage = $1;      $lineage = $1;
3029            $lineage =~ s/^\s+//o;
3030            $lineage =~ s/Candidatus\s+//go;
3031            $lineage =~ s/\s+/ /go;
3032            $lineage =~ s/\s+$//o;
3033      $overview->{ lineage } = &decode_html_chars($lineage);      $overview->{ lineage } = &decode_html_chars($lineage);
3034    }    }
3035    
# Line 3033  Line 3037 
3037    my $genus = "";    my $genus = "";
3038    if ($content =~ /\&lt\;ScientificName\&gt\;(.*)\&lt\;\/ScientificName\&gt\;(\W*)\&lt\;Rank\&gt\;genus\&lt\;\/Rank\&gt\;/) {    if ($content =~ /\&lt\;ScientificName\&gt\;(.*)\&lt\;\/ScientificName\&gt\;(\W*)\&lt\;Rank\&gt\;genus\&lt\;\/Rank\&gt\;/) {
3039      $genus = &decode_html_chars($1);      $genus = &decode_html_chars($1);
3040            $genus =~ s/^\s+//o;
3041            $genus =~ s/^Candidatus\s+//o;
3042            $genus =~ s/\s+$//o;
3043      $overview->{ genus } = $genus ;      $overview->{ genus } = $genus ;
3044    }    }
3045    
# Line 3040  Line 3047 
3047    my $species = "";    my $species = "";
3048    if ($content =~ /\&lt\;ScientificName\&gt\;(.*)\&lt\;\/ScientificName\&gt\;(\W*)\&lt\;Rank\&gt\;species\&lt\;\/Rank\&gt\;/) {    if ($content =~ /\&lt\;ScientificName\&gt\;(.*)\&lt\;\/ScientificName\&gt\;(\W*)\&lt\;Rank\&gt\;species\&lt\;\/Rank\&gt\;/) {
3049      $species = &decode_html_chars($1);      $species = &decode_html_chars($1);
3050      $species =~ s/$genus\s//;          $species =~ s/^\s+//o;
3051            $species =~ s/^Candidatus\s+//o;
3052            $species =~ s/$genus\s+//;
3053            $species =~ s/\s+$//o;
3054      #$species =~ s/ii$/i/;      #$species =~ s/ii$/i/;
3055      #$species =~ s/ae$/a/;      #$species =~ s/ae$/a/;
3056    
# Line 3052  Line 3062 
3062    if ($content =~ /\&lt\;ScientificName\&gt\;(.*)\&lt\;\/ScientificName\&gt\;(\W*)\&lt\;OtherNames\&gt\;/) {    if ($content =~ /\&lt\;ScientificName\&gt\;(.*)\&lt\;\/ScientificName\&gt\;(\W*)\&lt\;OtherNames\&gt\;/) {
3063      $strain = &decode_html_chars($1);      $strain = &decode_html_chars($1);
3064    
3065      $strain =~ s/$genus\s//;          $strain =~ s/^\s+//o;
3066      $strain =~ s/$species\s//;          $strain =~ s/^Candidatus\s+//o;
3067            $strain =~ s/$genus\s+//o;
3068            $strain =~ s/$species\s+//o;
3069            $strain =~ s/\s+/ /go;
3070            $strain =~ s/\s+$//o;
3071    
3072      $overview->{ strain } = $strain;      $overview->{ strain } = $strain;
3073    }    }
# Line 3070  Line 3084 
3084    $overview->{ synonyms } = $names;    $overview->{ synonyms } = $names;
3085    $overview->{ scientific_name } = $scientific_name;    $overview->{ scientific_name } = $scientific_name;
3086    
   
   
3087    return $overview;    return $overview;
3088  }  }
3089    
# Line 4812  Line 4824 
4824      }      }
4825    
4826      $ans =~ s/^\s+//o;      $ans =~ s/^\s+//o;
4827      $ans =~ s/^Candidatus\s*//o;      $ans =~ s/^Candidatus\s+//o;
4828        $ans =~ s/\s+/ /go;
4829        $ans =~ s/\s+$//o;
4830    
4831      return $ans;      return $ans;
4832  }  }
# Line 16342  Line 16356 
16356    
16357      $ans = $taxonomy->{$genome};      $ans = $taxonomy->{$genome};
16358    
16359      if (!defined($ans))      if (!defined($ans)) {
16360      {          if (keys(%$taxonomy) == 0) {
         if (keys(%$taxonomy) == 0)  
         {  
16361              my $rdbH = $self->db_handle;              my $rdbH = $self->db_handle;
16362              my $relational_db_response = $rdbH->SQL("SELECT genome,taxonomy  FROM genome");              my $relational_db_response = $rdbH->SQL("SELECT genome,taxonomy  FROM genome");
16363              my $pair;              my $pair;
16364              foreach $pair (@$relational_db_response)              foreach $pair (@$relational_db_response) {
16365              {                  my ($db_genome, $db_taxonomy) = @$pair;
16366                  $taxonomy->{$pair->[0]} = $pair->[1];  
16367                    $db_taxonomy =~ s/^\s*//o;
16368                    $db_taxonomy =~ s/Candidatus\s+//og;
16369                    $db_taxonomy =~ s/\s+/ /og;
16370                    $db_taxonomy =~ s/\s*$//o;
16371    
16372                    $taxonomy->{$db_genome} = $db_taxonomy;
16373              }              }
16374              $ans = $taxonomy->{$genome};              $ans = $taxonomy->{$genome};
16375          }          }
# Line 16362  Line 16380 
16380      }      }
16381    
16382      $ans =~ s/^\s*//o;      $ans =~ s/^\s*//o;
16383        $ans =~ s/Candidatus\s*//og;
16384        $ans =~ s/\s+/ /og;
16385        $ans =~ s/\s*$//o;
16386    
16387      return $ans;      return $ans;
16388  }  }
# Line 16457  Line 16478 
16478  sub is_bacterial :Scalar {  sub is_bacterial :Scalar {
16479      my($self,$genome) = @_;      my($self,$genome) = @_;
16480    
16481      return ($self->taxonomy_of($genome) =~ /^Bacteria/) ? 1 : 0;      return ($self->taxonomy_of($genome) =~ /^\s*Bacteria/o) ? 1 : 0;
16482  }  }
16483    
16484    
# Line 16472  Line 16493 
16493  sub is_archaeal :Scalar {  sub is_archaeal :Scalar {
16494      my($self,$genome) = @_;      my($self,$genome) = @_;
16495    
16496      return ($self->taxonomy_of($genome) =~ /^Archaea/) ? 1 : 0;      return ($self->taxonomy_of($genome) =~ /^\s*Archaea/o) ? 1 : 0;
16497  }  }
16498    
16499    
# Line 16487  Line 16508 
16508  sub is_prokaryotic :Scalar {  sub is_prokaryotic :Scalar {
16509      my($self,$genome) = @_;      my($self,$genome) = @_;
16510    
16511      return ($self->taxonomy_of($genome) =~ /^(Archaea|Bacteria)/) ? 1 : 0;      return ($self->taxonomy_of($genome) =~ /^\s*(Archaea|Bacteria)/o) ? 1 : 0;
16512  }  }
16513    
16514    
# Line 16502  Line 16523 
16523  sub is_eukaryotic :Scalar {  sub is_eukaryotic :Scalar {
16524      my($self,$genome) = @_;      my($self,$genome) = @_;
16525    
16526      return ($self->taxonomy_of($genome) =~ /^Eukaryota/) ? 1 : 0;      return ($self->taxonomy_of($genome) =~ /^\s*Eukaryota/o) ? 1 : 0;
16527  }  }
16528    
16529    
# Line 16517  Line 16538 
16538  sub is_viral :Scalar {  sub is_viral :Scalar {
16539      my($self,$genome) = @_;      my($self,$genome) = @_;
16540    
16541      return ($self->taxonomy_of($genome) =~ /^Vir/) ? 1 : 0;      return ($self->taxonomy_of($genome) =~ /^\s*Vir/o) ? 1 : 0;
16542  }  }
16543    
16544    
# Line 16531  Line 16552 
16552    
16553  sub is_environmental :Scalar {  sub is_environmental :Scalar {
16554      my($self,$genome) = @_;      my($self,$genome) = @_;
16555      return ($self->taxonomy_of($genome) =~ /environmental samples/) ? 1 : 0;      return ($self->taxonomy_of($genome) =~ /environmental samples/io) ? 1 : 0;
16556  }  }
16557    
16558    

Legend:
Removed from v.1.750  
changed lines
  Added in v.1.751

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3