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

Diff of /FigKernelScripts/build_protein_families.pl

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

revision 1.1.2.1, Tue Jul 12 15:39:01 2005 UTC revision 1.5, 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  use FIG;  use FIG;
19    
20  $usage = "usage: build_protein_families Sources";  $usage = "usage: build_protein_families Sources";
# Line 7  Line 24 
24  )  )
25      || die $usage;      || die $usage;
26    
27  &FIG::verify_dir("$FIG_Config::global/ProteinFamilies~");  &FIG::verify_dir("$FIG_Config::temp/ProteinFamilies");
28  &FIG::run("cp $FIG_Config::global/ProteinFamilies/local* $FIG_Config::global/ProteinFamilies~");  &FIG::verify_dir("$FIG_Config::temp/ProteinFamilies/previous");
29  &FIG::run("build_syn $sources /tmp/syn$$");  &FIG::run("cp $FIG_Config::global/ProteinFamilies/local* $FIG_Config::global/ProteinFamilies/id.map $FIG_Config::temp/ProteinFamilies/previous");
30  &FIG::run("make_fam_tabs $sources /tmp/syn$$ $FIG_Config::global/ProteinFamilies");  &FIG::run("build_syn $sources $FIG_Config::temp/ProteinFamilies/syn$$");
31    &FIG::run("make_fam_tabs $sources $FIG_Config::temp/ProteinFamilies/syn$$ $FIG_Config::global/ProteinFamilies");
32    &load_idmaps($sources);
33  #unlink("/tmp/syn$$");  #unlink("/tmp/syn$$");
34    &FIG::run("load_protein_families");
35    
36    
37    
38    
39    sub load_idmaps {
40     my $sources=shift;
41     opendir(SOURCES, $sources) || die "Can't open $sources while trying to load id.maps";
42     my @idmaps = map { "$sources/$_/id.map" } grep { ($_ !~ /^\./) && (-s "$sources/$_/id.map") } readdir(SOURCES);
43     open(OUT, ">$FIG_Config::global/ProteinFamilies/id.map") || die "Can't open $FIG_Config::global/ProteinFamilies/id.map for writing";
44     foreach my $file (@idmaps)
45     {
46      open(IN, $file) || die "can't open $idmaps";
47      while (<IN>)
48      {
49       my @line=split /\t/;
50       unless ($#line==1)
51       {
52        print STDERR "Error reading the data at $_ in $dir/$f/id.map\n";
53        next;
54       }
55       if (length($line[0])>32 || length($line[1])>32)
56       {
57        print STDERR "One of the entries in $_ from  $dir/$f/id.map is too long. Each piece can only be 32 characters\n";
58        next;
59       }
60       print OUT $_;
61      }
62     }
63    }
64    
65    
66    
67    
68    

Legend:
Removed from v.1.1.2.1  
changed lines
  Added in v.1.5

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3