[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.4 - (view) (download) (as text)

1 : overbeek 1.1 use FIG;
2 :    
3 :     $usage = "usage: build_protein_families Sources";
4 :    
5 :     (
6 :     ($sources = shift @ARGV)
7 :     )
8 :     || die $usage;
9 :    
10 : overbeek 1.4 &FIG::verify_dir("$FIG_Config::temp/ProteinFamilies");
11 :     &FIG::verify_dir("$FIG_Config::temp/ProteinFamilies/previous");
12 :     &FIG::run("cp $FIG_Config::global/ProteinFamilies/local* $FIG_Config::global/ProteinFamilies/id.map $FIG_Config::temp/ProteinFamilies/previous");
13 :     &FIG::run("build_syn $sources $FIG_Config::temp/ProteinFamilies/syn$$");
14 :     &FIG::run("make_fam_tabs $sources $FIG_Config::temp/ProteinFamilies/syn$$ $FIG_Config::global/ProteinFamilies");
15 : overbeek 1.3 &load_idmaps($sources);
16 : overbeek 1.4 #unlink("/tmp/syn$$");
17 : overbeek 1.2 &FIG::run("load_protein_families");
18 : overbeek 1.3
19 :    
20 :    
21 :    
22 :     sub load_idmaps {
23 :     my $sources=shift;
24 :     opendir(SOURCES, $sources) || die "Can't open $sources while trying to load id.maps";
25 :     my @idmaps = map { "$sources/$_/id.map" } grep { ($_ !~ /^\./) && (-s "$sources/$_/id.map") } readdir(SOURCES);
26 :     open(OUT, ">$FIG_Config::global/ProteinFamilies/id.map") || die "Can't open $FIG_Config::global/ProteinFamilies/id.map for writing";
27 :     foreach my $file (@idmaps)
28 :     {
29 :     open(IN, $file) || die "can't open $idmaps";
30 : overbeek 1.4 while (<IN>)
31 :     {
32 :     my @line=split /\t/;
33 :     unless ($#line==1)
34 :     {
35 :     print STDERR "Error reading the data at $_ in $dir/$f/id.map\n";
36 :     next;
37 :     }
38 :     if (length($line[0])>32 || length($line[1])>32)
39 :     {
40 :     print STDERR "One of the entries in $_ from $dir/$f/id.map is too long. Each piece can only be 32 characters\n";
41 :     next;
42 :     }
43 :     print OUT $_;
44 :     }
45 : overbeek 1.3 }
46 :     }
47 : overbeek 1.4
48 :    
49 :    
50 :    
51 : overbeek 1.3

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3