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

Annotation of /FigKernelScripts/build_protein_families.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (view) (download) (as text)

1 : olson 1.5 #
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 : overbeek 1.1 use FIG;
19 :    
20 :     $usage = "usage: build_protein_families Sources";
21 :    
22 :     (
23 :     ($sources = shift @ARGV)
24 :     )
25 :     || die $usage;
26 :    
27 : overbeek 1.4 &FIG::verify_dir("$FIG_Config::temp/ProteinFamilies");
28 :     &FIG::verify_dir("$FIG_Config::temp/ProteinFamilies/previous");
29 :     &FIG::run("cp $FIG_Config::global/ProteinFamilies/local* $FIG_Config::global/ProteinFamilies/id.map $FIG_Config::temp/ProteinFamilies/previous");
30 :     &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 : overbeek 1.3 &load_idmaps($sources);
33 : overbeek 1.4 #unlink("/tmp/syn$$");
34 : overbeek 1.2 &FIG::run("load_protein_families");
35 : overbeek 1.3
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 : overbeek 1.4 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 : overbeek 1.3 }
63 :     }
64 : overbeek 1.4
65 :    
66 :    
67 :    
68 : overbeek 1.3

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3