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

Annotation of /FigKernelScripts/make_proml_tree.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (view) (download) (as text)

1 : overbeek 1.1 ########################################################################
2 :    
3 :     use FIG;
4 :     use tree_utilities;
5 : overbeek 1.3 use Sys::Hostname;
6 : overbeek 1.1
7 :     $usage = "usage: make_proml_tree [-a Alpha] Alignment Outfile OutTree";
8 :    
9 : overbeek 1.3 my $host = hostname;
10 : overbeek 1.4 my $dir = "$FIG_Config::temp/proml.$host.$$";
11 :     mkdir($dir,0777) || die "could not make $dir";
12 : overbeek 1.3
13 : overbeek 1.1 my $alpha = undef;
14 :     while ($ARGV[0] =~ /^-/)
15 :     {
16 :     $_ = shift @ARGV;
17 :     if ($_ =~ s/^-a//) { $alpha = ($_ || shift @ARGV) }
18 :     else { die "Bad Flag: $_" }
19 :     }
20 :    
21 :    
22 :     (
23 :     ($aliF = shift @ARGV) &&
24 :     ($outF = shift @ARGV) &&
25 :     ($treeF = shift @ARGV)
26 :     )
27 :     || die $usage;
28 :    
29 :     &FIG::run("fasta_to_phylip < $aliF > $dir/infile");
30 :     open(PARMS,">$dir/parms") || die "could not open $dir/parms";
31 :     $val = (int(rand() * 500000000) * 2) + 1;
32 :     print PARMS "J\n$val\n1\n";
33 :     if ($alpha) { print PARMS "R\nY\n",1 / sqrt($alpha),"\n5\n"; }
34 :     else { print PARMS "Y\n"; }
35 :     close(PARMS);
36 : overbeek 1.2 system "cd $dir; proml < parms > log";
37 : overbeek 1.1 system "mv $dir/outfile $outF; mv $dir/outtree $treeF; rm -r $dir";
38 : overbeek 1.4 system "/bin/rm -r $dir";

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3