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

View of /FigKernelScripts/build_protein_families.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (download) (as text) (annotate)
Mon Nov 28 04:31:07 2005 UTC (14 years, 2 months ago) by overbeek
Branch: MAIN
Changes since 1.3: +25 -11 lines
updating protein families

use FIG;

$usage = "usage: build_protein_families Sources";

(
 ($sources = shift @ARGV)
)
    || die $usage;

&FIG::verify_dir("$FIG_Config::temp/ProteinFamilies");
&FIG::verify_dir("$FIG_Config::temp/ProteinFamilies/previous");
&FIG::run("cp $FIG_Config::global/ProteinFamilies/local* $FIG_Config::global/ProteinFamilies/id.map $FIG_Config::temp/ProteinFamilies/previous");
&FIG::run("build_syn $sources $FIG_Config::temp/ProteinFamilies/syn$$");
&FIG::run("make_fam_tabs $sources $FIG_Config::temp/ProteinFamilies/syn$$ $FIG_Config::global/ProteinFamilies");
&load_idmaps($sources);
#unlink("/tmp/syn$$");
&FIG::run("load_protein_families");




sub load_idmaps {
 my $sources=shift;
 opendir(SOURCES, $sources) || die "Can't open $sources while trying to load id.maps";
 my @idmaps = map { "$sources/$_/id.map" } grep { ($_ !~ /^\./) && (-s "$sources/$_/id.map") } readdir(SOURCES);
 open(OUT, ">$FIG_Config::global/ProteinFamilies/id.map") || die "Can't open $FIG_Config::global/ProteinFamilies/id.map for writing";
 foreach my $file (@idmaps)
 {
  open(IN, $file) || die "can't open $idmaps";
  while (<IN>)
  {
   my @line=split /\t/;
   unless ($#line==1)
   {
    print STDERR "Error reading the data at $_ in $dir/$f/id.map\n";
    next;
   }
   if (length($line[0])>32 || length($line[1])>32)
   {
    print STDERR "One of the entries in $_ from  $dir/$f/id.map is too long. Each piece can only be 32 characters\n";
    next;
   }
   print OUT $_;
  }
 }
}
  
  
  
  


MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3