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

Diff of /FigKernelScripts/export_phage_data.pl

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

revision 1.2, Fri May 27 19:15:38 2011 UTC revision 1.3, Sun Oct 9 18:46:38 2011 UTC
# Line 77  Line 77 
77          foreach my $peg ($fig->pegs_of($phage)) {          foreach my $peg ($fig->pegs_of($phage)) {
78                  my $trans= $fig->get_translation($peg);                  my $trans= $fig->get_translation($peg);
79                  my $fn = scalar($fig->function_of($peg));                  my $fn = scalar($fig->function_of($peg));
80                  print PROT ">$peg [$fn]\n$trans\n";                  my $ss = join("; ", map {$_->[0]} $fig->subsystems_for_peg($peg));
81                  print PROTEINS ">$peg [$fn] [$phage] [$gs]\n$trans\n";                  if (!$ss) {$ss = "Not in a subsystem"}
82                    print PROT ">$peg [$fn] [$ss]\n$trans\n";
83                    print PROTEINS ">$peg [$fn] [$ss] [$phage] [$gs]\n$trans\n";
84          }          }
85          close PROT;          close PROT;
86    
# Line 103  Line 105 
105          $n++;          $n++;
106          unless ($n % 5) {sleep 5}          unless ($n % 5) {sleep 5}
107  }  }
108    close PROTEINS;
109    close CONTIGS;
110    
111    #compress those files
112    
113    system("gzip $destdir/DNA/all_sequences/phage_contigs_$timestamp.fasta");
114    system("gzip $destdir/proteins/all_sequences/phage_proteins_$timestamp.fasta");
115    
116    # now update the link to current
117    unlink("$destdir/proteins/all_sequences/current");
118    system("ln -s $destdir/proteins/all_sequences/phage_proteins_$timestamp.fasta $destdir/proteins/all_sequences/current");
119    unlink("$destdir/DNA/all_sequences/current");
120    system("ln -s $destdir/DNA/all_sequences/phage_contigs_$timestamp.fasta $destdir/DNA/all_sequences/current");
121    
122    
123  # now we have to wait for the children to die before we can make tar archives  # now we have to wait for the children to die before we can make tar archives
124  print  STDERR "waiting for children to finish\n"; my $t=time;  print  STDERR "waiting for children to finish\n"; my $t=time;
# Line 129  Line 145 
145    
146    
147    
148    # update the current symlink. Do this last in case anything craps out
149    foreach my $thisdir ("$destdir/DNA/by_genome/", "$destdir/proteins/by_genome/", "$destdir/genomes/genbank/", "$destdir/genomes/gff3/") {
150            if (-l "$thisdir/current") {unlink "$thisdir/current"}
151            `ln -s $thisdir/$date $thisdir/current`;
152    }
153    
154    # create the mysql dump file
155    system("mysqldump -S /var/run/mysqld/mysqld.sock -u seed -ptheseed seed > $destdir/MySQLDump/mysqldump.$date");
156    system("gzip $destdir/mysqldump.$date");
157    
158    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3