comparison phylogenies/raxml.pl @ 0:5b9a38ec4a39 draft default tip

First commit of old repositories
author osiris_phylogenetics <ucsb_phylogenetics@lifesci.ucsb.edu>
date Tue, 11 Mar 2014 12:19:13 -0700
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:5b9a38ec4a39
1 #! /usr/bin/perl -w
2
3 use strict;
4 use warnings;
5 #raxml.pl Galaxy wrapper calls raxml from raxml.xml
6 #xml file contains:
7 #raxml.pl [GTR|CAT] [PROT|DNA] [protmodel] [morphmodel] [phylip file] [constraint] [partition] [best_tree?] [invar?] [#bootreps] [outgroup]
8
9 ##For debugging command line pass, uncomment next
10 #for (my $i=0; $i < @ARGV; $i++){
11 # print "Parameter #$i ".$ARGV[$i]."\n\n";
12 #}
13 #exit;
14
15 my $rate_het=shift(@ARGV); #0 rate heterogeneity? value will = GAMMA or CAT
16 my $datatype = shift(@ARGV); #1 datatype? True=Protein False=DNA
17 my $protmodel = shift(@ARGV); #2 which protein model
18 my $morphmodel = shift(@ARGV); #3 which morphology multistate model
19 my $data_file= shift(@ARGV); #4 input a phylip file
20 my $part_file = shift(@ARGV); #5 optional partition file
21 my $constraint_tree = shift(@ARGV); #6 optional constraint tree
22 my $find_best = shift(@ARGV); #7 if ML find ML tree as well as bootstrapping
23 my $invar = shift(@ARGV); #8 if INVAR include invariant site parameter in model
24 my $nboots = shift(@ARGV); #9 Number of bootstrap reps
25 my $seed = shift(@ARGV); #10 Number of bootstrap reps
26 my $long = shift(@ARGV); #11 decide whether to do a long or bootstrap call or not, with multiple threads
27 my $outgroup = shift(@ARGV); #12 Specify the outgroup
28 my $model;
29
30
31
32 # From shell pipeline
33 # raxmlHPC-PTHREADS7.2.6 -T $processors -f a -s $data_name.data -q $data_name.part -m $model -n $data_name -N 100 -x 1234567890 -o Limulus_polyphemus
34 # cp RAxML_bestTree.$data_name $data_nameBootBest.tre
35 # cp RAxML_bipartitions.$data_name $data_nameBoot.tre
36
37 #ADD OPTIONS TO BUILD FULL RAXML COMMANDLINE ARGUMENT
38
39 my $build_command;
40 #First CALL RAXML THROUGH PATH with 8 threads
41 if($long eq 'Long'){ #Currently both raxml and raxml_long call with 'long'
42 $build_command = "raxmlHPC-PTHREADS-SSE3 -T 8";
43 }else{
44 $build_command = "mpirun -np 10 raxmlHPC-MPI-SSE3 ";
45 }
46 #Check if find best tree is desired
47 if($find_best eq "ML"){
48 $build_command = $build_command." -f a ";
49 }
50 #Next add call to input phylip file
51 $build_command = $build_command." -s ".$data_file;
52 #Add call to partition file name
53 unless($part_file eq 'None'){
54 $build_command = $build_command." -q ".$part_file;
55 }
56 #Build substitution model
57 if($datatype eq "PROT"){
58 $model = "PROT";
59 }elsif($datatype eq "DNA"){
60 $model = "GTR";
61 }
62 if($rate_het eq "GTR"){
63 $model = $model."GAMMA";
64 }elsif($rate_het eq "CAT"){
65 $model = $model."CAT";
66 }
67 if($invar eq "INVAR"){
68 $model = $model."I";
69 }
70 if($datatype eq "PROT"){
71 $model = $model.$protmodel;
72 }
73 $build_command = $build_command." -m ".$model;
74 #Add multistate morphology model
75 $build_command = $build_command." -K ".$morphmodel;
76 #check constraint tree
77 unless($constraint_tree eq 'None'){
78 $build_command = $build_command." -g ".$constraint_tree;
79 }
80 #N Bootstraps
81 $build_command = $build_command." -N ".$nboots;
82 #Bootstrap seed
83 $build_command = $build_command." -x ".$seed;
84 #Parsimony seed
85 $build_command = $build_command." -p "."1234567";
86
87
88 #name output files galaxy
89 $build_command = $build_command." -n galaxy";
90 #Outgroup
91 if(defined $outgroup){
92 $build_command = $build_command." -o ".$outgroup;
93 }
94
95 print "Galaxy COMMAND BUILD WAS: $build_command\n";
96
97 #Uncomment to actually call raxml
98 system $build_command;