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

View of /FigKernelScripts/make_proml_tree.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (download) (as text) (annotate)
Fri Jan 12 18:44:25 2007 UTC (13 years, 2 months ago) by overbeek
Branch: MAIN
Changes since 1.4: +0 -2 lines
Remove use File::msktemp. Interfers with the creation of temp files

########################################################################

use FIG;
use tree_utilities;
use Sys::Hostname;

$usage = "usage: make_proml_tree [-a Alpha] Alignment Outfile OutTree";

my $host = hostname;
my $dir = "$FIG_Config::temp/proml.$host.$$";
mkdir($dir,0777) || die "could not make $dir";
 
my $alpha = undef;
while ($ARGV[0] =~ /^-/)
{
    $_ = shift @ARGV;
    if ($_ =~ s/^-a//) { $alpha = ($_ || shift @ARGV) }
    else               { die "Bad Flag: $_" }
}


(
 ($aliF    = shift @ARGV) &&
 ($outF    = shift @ARGV) &&
 ($treeF   = shift @ARGV)
)
    || die $usage;

&FIG::run("fasta_to_phylip < $aliF > $dir/infile");
open(PARMS,">$dir/parms") || die "could not open $dir/parms";
$val = (int(rand() * 500000000) * 2) + 1;
print PARMS "J\n$val\n1\n";
if    ($alpha) { print PARMS "R\nY\n",1 / sqrt($alpha),"\n5\n"; }
else           { print PARMS "Y\n"; }
close(PARMS);
system "cd $dir; proml < parms > log";
system "mv $dir/outfile $outF; mv $dir/outtree $treeF; rm -r $dir";
system "/bin/rm -r $dir";

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3