[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.2 - (view) (download) (as text)

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3