[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.575, Mon Feb 26 21:30:18 2007 UTC revision 1.576, Wed Mar 7 01:47:05 2007 UTC
# Line 6138  Line 6138 
6138    
6139  }  }
6140    
6141    =head1 rewrite_db_xrefs_brc
6142    
6143    Convert an alias to a db_xref. This uses the BRC format db_xref, which is a conglomeration of NCBI, GO, and BioMoby.
6144    
6145    This method will return a correctly formatted db_ref if the argument is one of our currently recognized formats, otherwise it returns undef.
6146    
6147    This example code should provide the functions you want
6148    
6149    foreach my $alias ($fig->feature_aliases($peg))
6150    {
6151            if (my $dbxref=$fig->rewrite_db_xrefs_brc($alias)) {print "The dbxref is $dbxref\n"}
6152            else {print "The alias is $alias\n"}
6153    }
6154    
6155    
6156    For a list of approved dbxrefs, see http://www.brc-central.org/cgi-bin/brc-central/dbxref_list.cgi
6157    
6158    =cut
6159    
6160    sub rewrite_db_xrefs_brc {
6161    
6162            my ($self, $alias) = @_;
6163    
6164            if ($alias =~ /^COG\:/ || $alias =~ /GeneID\:/ ||  $alias =~ /^CDD\:/ || $alias =~ /^Locus_Tag\:/)
6165            { # these are valid db_xrefs and don't need changing
6166                    return $alias;
6167            }
6168            elsif ($alias =~ /^NP\_/ || $alias =~ /^YP\_/ || $alias =~ /^ZP\_/)
6169            {
6170                    $alias =~ s/^/RefSeq_Protein:/;
6171                    return $alias;
6172            }
6173            elsif ($alias =~ s/^eric\|/ERIC\:/)     {return $alias}
6174            elsif ($alias =~ s/^gi\|/NCBI_gi:/)     {return $alias}
6175            elsif ($alias =~ s/^uni\|/UniProtKB:/)  {return $alias}
6176            elsif ($alias =~ s/^kegg\|(.*?)\:/KEGG\:$1\+/i)         {return $alias}
6177            elsif ($alias =~ s/^sp\|/Swiss-Prot:/)  {return $alias}
6178            elsif ($alias =~ s/^tr\|/TrEMBL:/)      {return $alias}
6179            elsif ($alias =~ s/^tigr\|/TIGR_CMR:/)  {return $alias}
6180            elsif ($alias =~ s/^LocusTag/Locus_Tag/) {return $alias}
6181            elsif ($alias =~ s/^img\|/IMG:/)        {return $alias}
6182            else
6183            {
6184                    return undef;
6185            }
6186    }
6187    
6188    
6189    
6190  =head3 by_alias  =head3 by_alias

Legend:
Removed from v.1.575  
changed lines
  Added in v.1.576

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3