[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.438, Thu Feb 9 20:42:51 2006 UTC revision 1.439, Sat Feb 11 15:17:13 2006 UTC
# Line 762  Line 762 
762  =cut  =cut
763    
764  sub export_similarity_request {  sub export_similarity_request {
765      my($self, $nr_file, $fasta_file) = @_;      my($self, $user_req_dir) = @_;
766    
767        my $nr_file = "$user_req_dir/nr";
768        my $fasta_file = "$user_req_dir/fasta";
769        my $peg_syn_file = "$user_req_dir/peg.synonyms";
770    
771      my $req_dir = "$FIG_Config::fig/var/sim_requests";      my $req_dir = "$FIG_Config::fig/var/sim_requests";
772      &verify_dir("$FIG_Config::fig/var");      &verify_dir("$FIG_Config::fig/var");
# Line 782  Line 786 
786      open(my $user_nr_fh, ">$nr_file") or confess "Cannot open $nr_file for writing: $!";      open(my $user_nr_fh, ">$nr_file") or confess "Cannot open $nr_file for writing: $!";
787      open(my $nr_fh, ">$req_dir/nr") or confess "Cannot open $req_dir/nr for writing: $!";      open(my $nr_fh, ">$req_dir/nr") or confess "Cannot open $req_dir/nr for writing: $!";
788    
789        open(my $user_peg_syn_fh, ">$peg_syn_file") or confess "Cannot open $peg_syn_file for writing: $!";
790        open(my $peg_syn_fh, ">$req_dir/peg.synonyms") or confess "Cannot open $req_dir/peg.synonyms for writing: $!";
791    
792      open(my $nr_read_fh, "<$FIG_Config::data/Global/nr") or die "Cannot open $FIG_Config::data/Global/nr for reading: $!";      open(my $nr_read_fh, "<$FIG_Config::data/Global/nr") or die "Cannot open $FIG_Config::data/Global/nr for reading: $!";
793        open(my $peg_syn_read_fh, "<$FIG_Config::data/Global/peg.synonyms") or die "Cannot open $FIG_Config::data/Global/peg.synonyms for reading: $!";
794    
795      my $sim_q = "$FIG_Config::global/queued_similarities";      my $sim_q = "$FIG_Config::global/queued_similarities";
796    
# Line 799  Line 807 
807      #      #
808    
809      copy("$sim_q", "$req_dir/q") or confess "Copy $sim_q $req_dir/q failed: $!";      copy("$sim_q", "$req_dir/q") or confess "Copy $sim_q $req_dir/q failed: $!";
810        copy("$sim_q", "$user_req_dir/q") or confess "Copy $sim_q $user_req_dir/q failed: $!";
811    
812      my($buf);      my($buf);
813      while (1) {      while (1) {
# Line 813  Line 822 
822      close($nr_fh);      close($nr_fh);
823      close($user_nr_fh);      close($user_nr_fh);
824    
825        while (1) {
826            my $n = read($peg_syn_read_fh, $buf, 4096);
827            defined($n) or confess "Error reading peg.synonyms: $!";
828            last unless $n;
829            syswrite($user_peg_syn_fh, $buf) or confess "Error writing $peg_syn_file: $!";
830            syswrite($peg_syn_fh, $buf) or confess "Error writing $req_dir/peg.synonyms: $!";
831        }
832    
833        close($peg_syn_read_fh);
834        close($peg_syn_fh);
835        close($user_peg_syn_fh);
836    
837      #      #
838      # We can zero out the queue and unlock now.      # We can zero out the queue and unlock now.
839      #      #

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3