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

Diff of /FigKernelPackages/FIG.pm

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

revision 1.439, Sat Feb 11 15:17:13 2006 UTC revision 1.440, Tue Feb 14 15:07:07 2006 UTC
# Line 435  Line 435 
435      my($self,$genomes) = @_;      my($self,$genomes) = @_;
436      my($genome);      my($genome);
437    
438        my $x = join(",",@$genomes);
439        &log_update("mark_deleted_genomes\t$x");
440    
441      my $rdbH = $self->db_handle;      my $rdbH = $self->db_handle;
442    
443      my $n = 0;      my $n = 0;
# Line 455  Line 458 
458      my($self,$genomes) = @_;      my($self,$genomes) = @_;
459      my($genome);      my($genome);
460    
461        my $x = join(",",@$genomes);
462        &log_update("unmark_deleted_genomes\t$x");
463      my $rdbH = $self->db_handle;      my $rdbH = $self->db_handle;
464    
465      my $n = 0;      my $n = 0;
# Line 508  Line 513 
513  sub add_genome {  sub add_genome {
514      my($self,$genomeF, $force, $skipnr) = @_;      my($self,$genomeF, $force, $skipnr) = @_;
515    
516        &log_update("add_genome $genomeF $force $skipnr",$genomeF);
517    
518      my $rc = 0;      my $rc = 0;
519    
520      my(undef, $path, $genome) = File::Spec->splitpath($genomeF);      my(undef, $path, $genome) = File::Spec->splitpath($genomeF);
# Line 578  Line 585 
585      return $rc;      return $rc;
586  }  }
587    
588    sub log_update {
589        my($msg,@data) = @_;
590    
591        my $time_made = time;
592        &verify_dir("$FIG_Config::data/Logs/Tars");
593        my($i,$file_or_dir,@tars);
594        for ($i=0; ($i < @data); $i++)
595        {
596            $file_or_dir = $data[$i];
597            my($dir,$file);
598            if ($file_or_dir =~ /^(.*)\/([^\/]+)$/)
599            {
600                ($dir,$file) = ($1,$2);
601            }
602            else
603            {
604                ($dir,$file) = (".",$file_or_dir);
605            }
606            my $tar = "$FIG_Config::data/Logs/Tars/$time_made.$i.tgz";
607            &run("cd $dir; tar czf $tar $file");
608            push(@tars,$tar);
609        }
610        open(LOG,">>$FIG_Config::data/Logs/update.log")
611            || die "could not open $FIG_Config::data/Logs/update.log";
612        print LOG "$time_made\t$msg\t",join(",",@tars),"\n";
613        close(LOG);
614    }
615    
616    
617  =head3 parse_genome_args  =head3 parse_genome_args
618    
619  C<< my ($mode, @genomes) = FIG::parse_genome_args(@args); >>  C<< my ($mode, @genomes) = FIG::parse_genome_args(@args); >>
# Line 13653  Line 13689 
13689  sub delete_feature {  sub delete_feature {
13690      my($self,$fid) = @_;      my($self,$fid) = @_;
13691    
13692        &log_update("delete_feature $fid");
13693      my $genome = &genome_of($fid);      my $genome = &genome_of($fid);
13694      my $type   = &ftype($fid);      my $type   = &ftype($fid);
13695      my $dbh = $self->db_handle();      my $dbh = $self->db_handle();
# Line 13841  Line 13878 
13878          return undef;          return undef;
13879      }      }
13880    
13881        $translation ||= "";
13882      $aliases ||= "";      $aliases ||= "";
13883      my $aliasesT = $aliases;      my $aliasesT = $aliases;
13884      $aliasesT =~ s/,\s*/\t/g;      $aliasesT =~ s/,\s*/\t/g;
# Line 13858  Line 13896 
13896                     . "   minloc   = $beg\n"                     . "   minloc   = $beg\n"
13897                     . "   maxloc   = $end\n"                     . "   maxloc   = $end\n"
13898                     . "   aliases  = $aliases\n"                     . "   aliases  = $aliases\n"
13899                     . "   translation = " . ($translation || '') . "\n";                     . "   translation = $translation\n";
13900      }      }
13901    
13902        &log_update("add_feature\t$fid\t$fidN\t$type\t$genome\t$location\t$contig\t$beg\t$end\t$aliases\t$translation");
13903    
13904      &add_tbl_entry( $fid, $location, $aliasesT );      &add_tbl_entry( $fid, $location, $aliasesT );
13905    
13906      if ( ( $type eq "peg" ) and $translation )      if ( ( $type eq "peg" ) and $translation )
# Line 13934  Line 13974 
13974  sub replace_feature_with {  sub replace_feature_with {
13975      my($self,$from_fid,$to_fid) = @_;      my($self,$from_fid,$to_fid) = @_;
13976    
13977        &log_update("replace_feature_with\t$from_fid\t$to_fid");
13978    
13979      my $genome = &genome_of($from_fid);      my $genome = &genome_of($from_fid);
13980      my $type   = &ftype($from_fid);      my $type   = &ftype($from_fid);
13981      if (($genome ne &genome_of($to_fid)) || ($type ne &ftype($to_fid))) { return undef }      if (($genome ne &genome_of($to_fid)) || ($type ne &ftype($to_fid))) { return undef }

Legend:
Removed from v.1.439  
changed lines
  Added in v.1.440

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3