[Bio] / FigKernelScripts / db_xrefs_of.pl Repository:
ViewVC logotype

Diff of /FigKernelScripts/db_xrefs_of.pl

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

revision 1.1, Tue Mar 29 16:03:24 2005 UTC revision 1.4, Mon Dec 5 18:56:37 2005 UTC
# Line 1  Line 1 
1    #
2    # Copyright (c) 2003-2006 University of Chicago and Fellowship
3    # for Interpretations of Genomes. All Rights Reserved.
4    #
5    # This file is part of the SEED Toolkit.
6    #
7    # The SEED Toolkit is free software. You can redistribute
8    # it and/or modify it under the terms of the SEED Toolkit
9    # Public License.
10    #
11    # You should have received a copy of the SEED Toolkit Public License
12    # along with this program; if not write to the University of Chicago
13    # at info@ci.uchicago.edu or the Fellowship for Interpretation of
14    # Genomes at veronika@thefig.info or download a copy from
15    # http://www.theseed.org/LICENSE.TXT.
16    #
17    
18    
19  use FIG;  use FIG;
20  my $fig = new FIG;  my $fig = new FIG;
# Line 10  Line 27 
27                 nr   => 3,                 nr   => 3,
28                 uni  => 4,                 uni  => 4,
29                 kegg => 5,                 kegg => 5,
30                 gi   => 6                 gi   => 6,
31                   fig  => 7
32               );               );
33    
34  while (defined($_ = <STDIN>))  while (defined($line = <STDIN>))
35  {  {
36      if ($_ =~ /^(\S+)/)      chop $line;
37        if ($line =~ /(\S+)$/)
38      {      {
39          $id = $1;          $id = $1;
40          if ($id =~ /^fig\|/)          if ($id =~ /^fig\|/)
41          {          {
42              @possible_xrefs = $fig->feature_aliases($id);              @possible_xrefs = ($id,$fig->feature_aliases($id));
43            }
44            elsif ($peg = $fig->by_alias($id))
45            {
46                @possible_xrefs = ($peg,$fig->feature_aliases($peg));
47          }          }
48          else          else
49          {          {
50              @possible_xrefs =  grep { $_ ne $id }              @possible_xrefs =  map  { $_->[0] }
                                map  { $_->[0] }  
51              $fig->mapped_prot_ids($id);              $fig->mapped_prot_ids($id);
52          }          }
53    
54          @xrefs =  map { $_->[0] }          @xrefs =  map { $_->[0] }
55                    grep { ($_->[1] ne "misc") && ($_->[1] ne "gene") }                    grep { ($_->[1] ne "misc") && ($_->[1] ne "gene") }
56                    map { [$_,&type_alias($_)] }                    map { [$_,&type_alias($_)] }
57                    @possible_xrefs;                    @possible_xrefs;
58          print "$id\t",join(",",@xrefs),"\n";          print "$line\t",join(",",@xrefs),"\n";
59      }      }
60  }  }
61    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.4

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3