[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.2 - (download) (as text) (annotate)
Sat Jan 6 17:39:41 2007 UTC (13 years, 4 months ago) by overbeek
Branch: MAIN
Changes since 1.1: +1 -1 lines
make sure tree insertion code is all committed

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

use FIG;
use tree_utilities;

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

my $dir = "$FIG_Config::temp/proml.$$";
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";


MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3