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

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3