[Bioperl-l] ProtDist.pm

Jason Stajich jason@cgt.mc.duke.edu
Tue, 3 Dec 2002 17:19:00 -0500 (EST)


Fixed, I think.  Give it a whirl if you get a chance. (i.e. cvs update).

On Tue, 3 Dec 2002, Tyler wrote:

> I'd like to ask Jason or Shawn (or anyone else) whether or not it's
> possible to run ProtDist from two perl scripts (with different process
> ids) at the same time with the same working directory? I've tried
> setting a unique name for the outfiles, yet I still get a message
> saying "protdist did not create matrix correctly" for the script that
> is started second.  I am making the assumption that it is trying to
> write to an outfile that already exists and is in use by the script
> started first, but I can't figure out why!  I'm using version 1.14 from
> the cvs.
>
> (Actually, to be more accurate, it's one script that forks child
> processes that handle client requests. Regardless, the PD* filenames
> are unique.)
>
> Here's a code snippet:
> 	...
> 	print $client "STATUS\nCalculating distance matrix...\n";
> 	my $pdfile = "PD" . $$ . time() . ".out";  #creating a unique filename
> 	my $protdist_factory = Bio::Tools::Run::Phylo::Phylip::ProtDist->new();
> 	$protdist_factory->quiet(1);
> 	$protdist_factory->outfile_name($pdfile);
> 	my $matrix;
> 	eval { $matrix  = $protdist_factory->create_distance_matrix($aln);};
> #$aln created earlier in script
> 		if ($@) {
> 			my $e = $@;
> 			$e =~ s/\n/ /;
> 			print $client "ERROR\n$e\n";
> 			close($client);
> 			return "Error: $e";
> 		 }
> 	...
>
> -Tyler Alioto
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
>

--
Jason Stajich
Duke University
jason at cgt.mc.duke.edu