annotate raxml.py @ 0:934206441123 draft

planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
author iuc
date Mon, 30 Nov 2015 22:03:09 -0500
parents
children b0d6eb76ad87
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
1 #!/usr/bin/env python
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
2 """
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
3 Runs RAxML on a sequence file.
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
4 For use with RAxML version 8.2.4
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
5 """
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
6 import os, shutil, subprocess, sys, optparse, fnmatch, glob
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
7
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
8 def stop_err(msg):
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
9 sys.stderr.write("%s\n" % msg)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
10 sys.exit()
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
11
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
12 def getint(name):
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
13 basename = name.partition('RUN.')
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
14 if basename[2] != '':
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
15 num = basename[2]
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
16 return int(num)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
17
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
18 def __main__():
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
19 usage = "usage: %prog -T <threads> -s <input> -n <output> -m <model> [optional arguments]"
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
20
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
21 # Parse the primary wrapper's command line options
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
22 parser = optparse.OptionParser(usage = usage)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
23 # raxml binary name, hardcoded in the xml file
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
24 parser.add_option("--binary", action="store", type="string", dest="binary", help="Command to run")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
25 # (-a)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
26 parser.add_option("--weightfile", action="store", type="string", dest="weightfile", help="Column weight file")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
27 # (-A)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
28 parser.add_option("--secondary_structure_model", action="store", type="string", dest="secondary_structure_model", help="Secondary structure model")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
29 # (-b)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
30 parser.add_option("--bootseed", action="store", type="int", dest="bootseed", help="Bootstrap random number seed")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
31 # (-c)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
32 parser.add_option("--numofcats", action="store", type="int", dest="numofcats", help="Number of distinct rate categories")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
33 # (-d)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
34 parser.add_option("--search_complete_random_tree", action="store_true", dest="search_complete_random_tree", help="Search with a complete random starting tree")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
35 # (-D)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
36 parser.add_option("--ml_search_convergence", action="store_true", dest="ml_search_convergence", help="ML search onvergence criterion")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
37 # (-e)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
38 parser.add_option("--model_opt_precision", action="store", type="float", dest="model_opt_precision", help="Model Optimization Precision (-e)")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
39 # (-E)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
40 parser.add_option("--excludefile", action="store", type="string", dest="excludefile", help="Exclude File Name")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
41 # (-f)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
42 parser.add_option("--search_algorithm", action="store", type="string", dest="search_algorithm", help="Search Algorithm")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
43 # (-F)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
44 parser.add_option("--save_memory_cat_model", action="store_true", dest="save_memory_cat_model", help="Save memory under CAT and GTRGAMMA models")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
45 # (-g)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
46 parser.add_option("--groupingfile", action="store", type="string", dest="groupingfile", help="Grouping File Name")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
47 # (-G)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
48 parser.add_option("--enable_evol_heuristics", action="store_true", dest="enable_evol_heuristics", help="Enable evol algo heuristics")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
49 # (-i)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
50 parser.add_option("--initial_rearrangement_setting", action="store", type="int", dest="initial_rearrangement_setting", help="Initial Rearrangement Setting")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
51 # (-I)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
52 parser.add_option("--posterior_bootstopping_analysis", action="store", type="string", dest="posterior_bootstopping_analysis", help="Posterior bootstopping analysis")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
53 # (-J)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
54 parser.add_option("--majority_rule_consensus", action="store", type="string", dest="majority_rule_consensus", help="Majority rule consensus")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
55 # (-k)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
56 parser.add_option("--print_branch_lengths", action="store_true", dest="print_branch_lengths", help="Print branch lengths")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
57 # (-K)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
58 parser.add_option("--multistate_sub_model", action="store", type="string", dest="multistate_sub_model", help="Multistate substitution model")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
59 # (-m)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
60 parser.add_option("--model_type", action="store", type="string", dest="model_type", help="Model Type")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
61 parser.add_option("--base_model", action="store", type="string", dest="base_model", help="Base Model")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
62 parser.add_option("--aa_empirical_freq", action="store_true", dest="aa_empirical_freq", help="Use AA Empirical base frequences")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
63 parser.add_option("--aa_search_matrix", action="store", type="string", dest="aa_search_matrix", help="AA Search Matrix")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
64 # (-n)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
65 parser.add_option("--name", action="store", type="string", dest="name", help="Run Name")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
66 # (-N/#)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
67 parser.add_option("--number_of_runs", action="store", type="int", dest="number_of_runs", help="Number of alternative runs")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
68 parser.add_option("--number_of_runs_bootstop", action="store", type="string", dest="number_of_runs_bootstop", help="Number of alternative runs based on the bootstop criteria")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
69 # (-M)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
70 parser.add_option("--estimate_individual_branch_lengths", action="store_true", dest="estimate_individual_branch_lengths", help="Estimate individual branch lengths")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
71 # (-o)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
72 parser.add_option("--outgroup_name", action="store", type="string", dest="outgroup_name", help="Outgroup Name")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
73 # (-O)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
74 parser.add_option("--disable_undetermined_seq_check", action="store_true", dest="disable_undetermined_seq_check", help="Disable undetermined sequence check")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
75 # (-p)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
76 parser.add_option("--random_seed", action="store", type="int", dest="random_seed", help="Random Number Seed")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
77 # (-P)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
78 parser.add_option("--external_protein_model", action="store", type="string", dest="external_protein_model", help="External Protein Model")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
79 # (-q)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
80 parser.add_option("--multiple_model", action="store", type="string", dest="multiple_model", help="Multiple Model File")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
81 # (-r)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
82 parser.add_option("--constraint_file", action="store", type="string", dest="constraint_file", help="Constraint File")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
83 # (-R)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
84 parser.add_option("--bin_model_parameter_file", action="store", type="string", dest="bin_model_parameter_file", help="Constraint File")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
85 # (-s)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
86 parser.add_option("--source", action="store", type="string", dest="source", help="Input file")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
87 # (-S)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
88 parser.add_option("--secondary_structure_file", action="store", type="string", dest="secondary_structure_file", help="Secondary structure file")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
89 # (-t)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
90 parser.add_option("--starting_tree", action="store", type="string", dest="starting_tree", help="Starting Tree")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
91 # (-T)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
92 parser.add_option("--threads", action="store", type="int", dest="threads", help="Number of threads to use")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
93 # (-u)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
94 parser.add_option("--use_median_approximation", action="store_true", dest="use_median_approximation", help="Use median approximation")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
95 # (-U)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
96 parser.add_option("--save_memory_gappy_alignments", action="store_true", dest="save_memory_gappy_alignments", help="Save memory in large gapped alignments")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
97 # (-V)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
98 parser.add_option("--disable_rate_heterogeneity", action="store_true", dest="disable_rate_heterogeneity", help="Disable rate heterogeneity")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
99 # (-W)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
100 parser.add_option("--sliding_window_size", action="store", type="string", dest="sliding_window_size", help="Sliding window size")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
101 # (-x)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
102 parser.add_option("--rapid_bootstrap_random_seed", action="store", type="int", dest="rapid_bootstrap_random_seed", help="Rapid Boostrap Random Seed")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
103 # (-y)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
104 parser.add_option("--parsimony_starting_tree_only", action="store_true", dest="parsimony_starting_tree_only", help="Generate a parsimony starting tree only")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
105 # (-z)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
106 parser.add_option("--file_multiple_trees", action="store", type="string", dest="file_multiple_trees", help="Multiple Trees File")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
107
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
108 (options, args) = parser.parse_args()
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
109 cmd = []
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
110
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
111 # Required parameters
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
112 binary = options.binary
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
113 cmd.append(binary)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
114 # Threads
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
115 if options.threads > 1:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
116 threads = "-T %d" % options.threads
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
117 cmd.append(threads)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
118 # Source
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
119 source = "-s %s" % options.source
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
120 cmd.append(source)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
121 #Hardcode to "galaxy" first to simplify the output part of the wrapper
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
122 #name = "-n %s" % options.name
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
123 name = "-n galaxy"
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
124 cmd.append(name)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
125 ## Model
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
126 model_type = options.model_type
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
127 base_model = options.base_model
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
128 aa_search_matrix = options.aa_search_matrix
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
129 aa_empirical_freq = options.aa_empirical_freq
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
130 if model_type == 'aminoacid':
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
131 model = "-m %s%s" % (base_model, aa_search_matrix)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
132 if aa_empirical_freq:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
133 model = "-m %s%s%s" % (base_model, aa_search_matrix, 'F')
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
134 # (-P)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
135 if options.external_protein_model:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
136 external_protein_model = "-P %s" % options.external_protein_model
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
137 cmd.append(external_protein_model)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
138 else:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
139 model = "-m %s" % base_model
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
140 cmd.append(model)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
141 if model == "GTRCAT":
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
142 # (-c)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
143 if options.numofcats:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
144 numofcats = "-c %d" % options.numofcats
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
145 cmd.append(numofcats)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
146 # Optional parameters
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
147 if options.number_of_runs_bootstop:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
148 number_of_runs_bootstop = "-N %s" % options.number_of_runs_bootstop
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
149 cmd.append(number_of_runs_bootstop)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
150 else:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
151 number_of_runs_bootstop = ''
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
152 if options.number_of_runs:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
153 number_of_runs_opt = "-N %d" % options.number_of_runs
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
154 cmd.append(number_of_runs_opt)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
155 else:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
156 number_of_runs_opt = 0
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
157 # (-a)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
158 if options.weightfile:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
159 weightfile = "-a %s" % options.weightfile
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
160 cmd.append(weightfile)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
161 # (-A)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
162 if options.secondary_structure_model:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
163 secondary_structure_model = "-A %s" % options.secondary_structure_model
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
164 cmd.append(secondary_structure_model )
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
165 # (-b)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
166 if options.bootseed:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
167 bootseed = "-b %d" % options.bootseed
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
168 cmd.append(bootseed)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
169 else:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
170 bootseed = 0
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
171 # -C - doesn't work in pthreads version, skipped
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
172 if options.search_complete_random_tree:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
173 cmd.append("-d")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
174 if options.ml_search_convergence:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
175 cmd.append("-D" )
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
176 if options.model_opt_precision:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
177 model_opt_precision = "-e %f" % options.model_opt_precision
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
178 cmd.append(model_opt_precision)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
179 if options.excludefile:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
180 excludefile = "-E %s" % options.excludefile
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
181 cmd.append(excludefile)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
182 if options.search_algorithm:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
183 search_algorithm = "-f %s" % options.search_algorithm
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
184 cmd.append(search_algorithm)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
185 if options.save_memory_cat_model:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
186 cmd.append("-F")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
187 if options.groupingfile:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
188 groupingfile = "-g %s" % options.groupingfile
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
189 cmd.append(groupingfile)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
190 if options.enable_evol_heuristics:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
191 enable_evol_heuristics = "-G %f" % options.enable_evol_heuristics
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
192 cmd.append(enable_evol_heuristics )
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
193 if options.initial_rearrangement_setting:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
194 initial_rearrangement_setting = "-i %s" % options.initial_rearrangement_setting
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
195 cmd.append(initial_rearrangement_setting)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
196 if options.posterior_bootstopping_analysis:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
197 posterior_bootstopping_analysis = "-I %s" % options.posterior_bootstopping_analysis
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
198 cmd.append(posterior_bootstopping_analysis)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
199 if options.majority_rule_consensus:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
200 majority_rule_consensus = "-J %s" % options.majority_rule_consensus
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
201 cmd.append(majority_rule_consensus)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
202 if options.print_branch_lengths:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
203 cmd.append("-k")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
204 if options.multistate_sub_model:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
205 multistate_sub_model = "-K %s" % options.multistate_sub_model
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
206 cmd.append(multistate_sub_model)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
207 if options.estimate_individual_branch_lengths:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
208 cmd.append("-M")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
209 if options.outgroup_name:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
210 outgroup_name = "-o %s" % options.outgroup_name
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
211 cmd.append(outgroup_name)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
212 if options.disable_undetermined_seq_check:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
213 cmd.append("-O")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
214 if options.random_seed:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
215 random_seed = "-p %d" % options.random_seed
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
216 cmd.append(random_seed)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
217 multiple_model = None
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
218 if options.multiple_model:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
219 multiple_model = "-q %s" % options.multiple_model
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
220 cmd.append(multiple_model)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
221 if options.constraint_file:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
222 constraint_file = "-r %s" % options.constraint_file
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
223 cmd.append(constraint_file)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
224 if options.bin_model_parameter_file:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
225 bin_model_parameter_file_name = "RAxML_binaryModelParameters.galaxy"
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
226 os.symlink(options.bin_model_parameter_file, bin_model_parameter_file_name )
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
227 bin_model_parameter_file = "-R %s" % options.bin_model_parameter_file
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
228 #Needs testing. Is the hardcoded name or the real path needed?
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
229 cmd.append(bin_model_parameter_file)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
230 if options.secondary_structure_file:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
231 secondary_structure_file = "-S %s" % options.secondary_structure_file
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
232 cmd.append(secondary_structure_file)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
233 if options.starting_tree:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
234 starting_tree = "-t %s" % options.starting_tree
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
235 cmd.append(starting_tree)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
236 if options.use_median_approximation:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
237 cmd.append("-u")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
238 if options.save_memory_gappy_alignments:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
239 cmd.append("-U")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
240 if options.disable_rate_heterogeneity:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
241 cmd.append("-V")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
242 if options.sliding_window_size:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
243 sliding_window_size = "-W %d" % options.sliding_window_size
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
244 cmd.append(sliding_window_size)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
245 if options.rapid_bootstrap_random_seed:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
246 rapid_bootstrap_random_seed = "-x %d" % options.rapid_bootstrap_random_seed
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
247 cmd.append(rapid_bootstrap_random_seed)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
248 else:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
249 rapid_bootstrap_random_seed = 0
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
250 if options.parsimony_starting_tree_only:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
251 cmd.append("-y")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
252 if options.file_multiple_trees:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
253 file_multiple_trees = "-z %s" % options.file_multiple_trees
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
254 cmd.append(file_multiple_trees)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
255
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
256 print "cmd list: ", cmd, "\n"
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
257
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
258 full_cmd = " ".join(cmd)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
259 print "Command string: %s" % full_cmd
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
260
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
261 try:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
262 proc = subprocess.Popen(args=full_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
263 except Exception, err:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
264 sys.stderr.write("Error invoking command: \n%s\n\n%s\n" % (cmd, err))
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
265 sys.exit(1)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
266 stdout, stderr = proc.communicate()
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
267 return_code = proc.returncode
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
268 if return_code:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
269 sys.stdout.write(stdout)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
270 sys.stderr.write(stderr)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
271 sys.stderr.write("Return error code %i from command:\n" % return_code)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
272 sys.stderr.write("%s\n" % cmd)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
273 else:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
274 sys.stdout.write(stdout)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
275 sys.stdout.write(stderr)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
276
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
277 #Multiple runs - concatenate
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
278 if number_of_runs_opt > 0:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
279 if (bootseed == 0) and (rapid_bootstrap_random_seed == 0 ):
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
280 runfiles = glob.glob('RAxML*RUN*')
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
281 runfiles.sort(key=getint)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
282 # Logs
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
283 outfile = open('RAxML_log.galaxy','w')
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
284 for filename in runfiles:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
285 if fnmatch.fnmatch(filename, 'RAxML_log.galaxy.RUN.*'):
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
286 infile = open(filename, 'r')
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
287 filename_line = "%s\n" % filename
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
288 outfile.write(filename_line)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
289 for line in infile:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
290 outfile.write(line)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
291 infile.close()
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
292 outfile.close()
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
293 # Parsimony Trees
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
294 outfile = open('RAxML_parsimonyTree.galaxy','w')
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
295 for filename in runfiles:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
296 if fnmatch.fnmatch(filename, 'RAxML_parsimonyTree.galaxy.RUN.*'):
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
297 infile = open(filename, 'r')
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
298 filename_line = "%s\n" % filename
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
299 outfile.write(filename_line)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
300 for line in infile:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
301 outfile.write(line)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
302 infile.close()
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
303 outfile.close()
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
304 # Results
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
305 outfile = open('RAxML_result.galaxy','w')
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
306 for filename in runfiles:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
307 if fnmatch.fnmatch(filename, 'RAxML_result.galaxy.RUN.*'):
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
308 infile = open(filename, 'r')
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
309 filename_line = "%s\n" % filename
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
310 outfile.write(filename_line)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
311 for line in infile:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
312 outfile.write(line)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
313 infile.close()
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
314 outfile.close()
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
315 # Multiple Model Partition Files
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
316 if multiple_model:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
317 files = glob.glob('RAxML_bestTree.galaxy.PARTITION.*')
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
318 if len(files) > 0:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
319 files.sort(key=getint)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
320 outfile = open('RAxML_bestTreePartitions.galaxy','w')
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
321 # Best Tree Partitions
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
322 for filename in files:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
323 if fnmatch.fnmatch(filename, 'RAxML_bestTree.galaxy.PARTITION.*'):
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
324 infile = open(filename, 'r')
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
325 filename_line = "%s\n" % filename
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
326 outfile.write(filename_line)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
327 for line in infile:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
328 outfile.write(line)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
329 infile.close()
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
330 outfile.close()
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
331 else:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
332 outfile = open('RAxML_bestTreePartitions.galaxy','w')
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
333 outfile.write("No partition files were produced.\n")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
334 outfile.close()
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
335
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
336 # Result Partitions
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
337 files = glob.glob('RAxML_result.galaxy.PARTITION.*')
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
338 if len(files) > 0:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
339 files.sort(key=getint)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
340 outfile = open('RAxML_resultPartitions.galaxy','w')
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
341 for filename in files:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
342 if fnmatch.fnmatch(filename, 'RAxML_result.galaxy.PARTITION.*'):
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
343 infile = open(filename, 'r')
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
344 filename_line = "%s\n" % filename
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
345 outfile.write(filename_line)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
346 for line in infile:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
347 outfile.write(line)
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
348 infile.close()
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
349 outfile.close()
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
350 else:
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
351 outfile = open('RAxML_resultPartitions.galaxy','w')
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
352 outfile.write("No partition files were produced.\n")
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
353 outfile.close()
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
354
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
355 # DEBUG options
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
356 infof = open('RAxML_info.galaxy','a')
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
357 infof.write('\nOM: CLI options DEBUG START:\n')
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
358 infof.write(options.__repr__())
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
359 infof.write('\nOM: CLI options DEBUG END\n')
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
360
934206441123 planemo upload for repository https://github.com/stamatak/standard-RAxML commit baa6a1ec8b3c440cdf73409ccaafcd303e9f4e72
iuc
parents:
diff changeset
361 if __name__=="__main__": __main__()