[Bio] / FigKernelPackages / P2Pupdate.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/P2Pupdate.pm

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

revision 1.4, Sat Dec 20 15:19:21 2003 UTC revision 1.5, Mon Dec 22 02:56:46 2003 UTC
# Line 449  Line 449 
449    
450  =head1 package_aassignments  =head1 package_aassignments
451    
452  usage: &package_assignments($fig_base,$genomes,$file)  usage: &package_assignments($fig_base,$who,$date,$genomes,$file)
453    
454  $fig_base must be an absolute filename (begins with "/") giving the FIG from which  $fig_base must be an absolute filename (begins with "/") giving the FIG from which
455     the updated code release will be taken.     the updated code release will be taken.
456    
457    $who designates whose assignments you want (defaults to "master")
458    
459    $date if given indicates a point in time (get assignments after that point)
460    
461  $genomes is a pointer to a list of genome IDs that will be exchanged.  $genomes is a pointer to a list of genome IDs that will be exchanged.
462    
463  $file must be an absolute filename where the "assignment package" will be built.  $file must be an absolute filename where the "assignment package" will be built.
# Line 464  Line 468 
468      my($fig_base,$who,$date,$genomes,$file) = @_;      my($fig_base,$who,$date,$genomes,$file) = @_;
469    
470      $who   = $who ? $who : "master";      $who   = $who ? $who : "master";
   
471      &force_absolute($fig_base);      &force_absolute($fig_base);
     &force_absolute($file);  
472      if (-d "$fig_base/Tmp/Assignments") { system "rm -rf $fig_base/Tmp/Assignments" }      if (-d "$fig_base/Tmp/Assignments") { system "rm -rf $fig_base/Tmp/Assignments" }
473      mkdir("$fig_base/Tmp/Assignments",0777) || die "could not make $fig_base/Tmp/Assignments";      mkdir("$fig_base/Tmp/Assignments",0777) || die "could not make $fig_base/Tmp/Assignments";
474      foreach $genome (@$genomes)      foreach $genome (@$genomes)
# Line 484  Line 486 
486                  if (($assignment =~ /^(\S+)\t(\S.*\S)/) && (! $seen{$1}))                  if (($assignment =~ /^(\S+)\t(\S.*\S)/) && (! $seen{$1}))
487                  {                  {
488                      $seen{$1} = 1;                      $seen{$1} = 1;
489                      push(@possible,["master",$1,$2]);                      push(@possible,[$1,$2]);
490                  }                  }
491              }              }
492          }          }
# Line 498  Line 500 
500                  if (($assignment =~ /^(\S+)\t(\S.*\S)/) && (! $seen{$1}))                  if (($assignment =~ /^(\S+)\t(\S.*\S)/) && (! $seen{$1}))
501                  {                  {
502                      $seen{$1} = 1;                      $seen{$1} = 1;
503                      push(@possible,[$who,$1,$2]);                      push(@possible,[$1,$2]);
504                  }                  }
505              }              }
506          }          }
507            if (open(TMP,">$fig_base/Tmp/Assignments/$genome/$who"))
508          if (@poss > 0)          {
509                if (@possible > 0)
510          {          {
511              if ($date)              if ($date)
512              {              {
513  ####                      %poss = map { $_->[0] => $_->[1] } @possible;
514                        if (open(ANN,"<$FIG_Config::organisms/$genome/annotations"))
515                        {
516                            $/ = "\n//\n";
517                            while (defined($ann = <ANN>))
518                            {
519                                if (($ann =~ /^(fig\|\d+\.\d+\.peg\.\d+)\n(\d+)\n(\S+)\nSet ([^\n]*)function[^\n]*\n(\S[^\n]+\S)/s) &&
520                                    (($who eq $3) || (($4 eq "master ") && ($who eq "master"))) &&
521                                    ($x = $poss{$1}) &&
522                                    ($2 >= $date) &&
523                                    ($5 eq $x))
524                                {
525                                    print TMP "$1\t$5\n";
526                                }
527                            }
528                            $/ = "\n";
529                            close(ANN);
530                        }
531                    }
532    
533              }              }
534                close(TMP);
535          }          }
536      }      }
537      &FIG::run("cd $fig_base/Tmp; tar czf $file Assignments; rm -rf Assignments");      &FIG::run("cd $fig_base/Tmp; tar czf $file Assignments; rm -rf Assignments");

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3