Skip to content

Commit

Permalink
Change location of working dir, not sure what is correct here
Browse files Browse the repository at this point in the history
  • Loading branch information
bosborne committed Dec 14, 2011
1 parent d678bf9 commit 7be4a04
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/Bio/Tools/Run/Phylo/Raxml.pm
Expand Up @@ -80,6 +80,7 @@ use Bio::SeqIO;
use Bio::TreeIO;
use Bio::AlignIO;
use Bio::Root::IO;
use Cwd;

use base qw(Bio::Root::Root Bio::Tools::Run::WrapperBase);

Expand Down Expand Up @@ -255,7 +256,7 @@ sub _run {
my $status = system($command);

# raxml creates tree files with names like "RAxML_bestTree.ABDBxjjdfg3"
my $outfile = $self->tempdir . '/RAxML_bestTree.' . $self->outfile_name;
my $outfile = 'RAxML_bestTree.' . $self->outfile_name;

if ( !-e $outfile || -z $outfile ) {
$self->warn("Raxml call had status of $status: $? [command $command]\n");
Expand Down Expand Up @@ -372,9 +373,10 @@ sub _setparams {
# Raxml insists that the output file name not contain '/' and its
# output directory is set using the '-w' argument.
if ( !$self->outfile_name ) {
$self->w($self->tempdir);
my $dir = getcwd();
$self->w($dir);
my ( $tfh, $outfile ) = $self->io->tempfile( -dir => $self->tempdir );
my ( $tfh, $outfile ) = $self->io->tempfile( -dir => $dir );
close($tfh);
undef $tfh;
$outfile = basename($outfile);
Expand Down
2 changes: 2 additions & 0 deletions t/Raxml.t
Expand Up @@ -15,6 +15,8 @@ BEGIN {
use_ok('Bio::AlignIO');
}

END { unlink glob "RAxML_*.*"; }

ok(my $raxml = Bio::Tools::Run::Phylo::Raxml->new(-p => 100, -quiet => 1), "Make the object");
isa_ok( $raxml, 'Bio::Tools::Run::Phylo::Raxml');

Expand Down

0 comments on commit 7be4a04

Please sign in to comment.