diff --git a/partfinder/analysis_method.py b/partfinder/analysis_method.py index 0f997fcd..3fcc8677 100644 --- a/partfinder/analysis_method.py +++ b/partfinder/analysis_method.py @@ -762,14 +762,25 @@ def setup(self): if the_config.min_subset_size == False: the_config.min_subset_size = 100 - partnum = len(the_config.user_subsets) - the_config.progress.begin(1, 1) + + # we start by putting all the partitions together. + # we do this because I don't like the idea of starting with user-defined + # partitions and trying to split them one by one. But I don't know if + # this is really defensible. Still, we have to start somewhere. + # but doing it this way allows us to first estimate an ML tree with + # all subsets separate, which is generally useful. + user_partnum = len(the_config.user_subsets) # Start with the most partitioned scheme - start_description = range(partnum) + start_description = [0]*user_partnum start_scheme = scheme.create_scheme( the_config, "start_scheme", start_description) + partnum = 1 + the_config.progress.begin(1, 1) + + print start_scheme.subsets + if len(start_scheme.subsets)>1: log.error("The k-means algorithm is designed to analyse \ the entire alignment at once. To use it, please define a \ diff --git a/partfinder/raxml.py b/partfinder/raxml.py index 9f7ef8e6..4f964e4a 100644 --- a/partfinder/raxml.py +++ b/partfinder/raxml.py @@ -71,6 +71,11 @@ def run_raxml(command): def run_raxml_pthreads(command, cpus): global _raxml_pthreads_binary + + # fall back on standard raxml if the number of cpus is 1 + if(cpus==1): + run_raxml(commmand) + if _raxml_pthreads_binary is None: _raxml_pthreads_binary = util.find_program(_binary_name_pthreads) command = " ".join([command, "-T", str(cpus), " "]) @@ -115,6 +120,7 @@ def make_ml_topology(alignment_path, datatype, cmdline_extras, scheme, cpus): command = ''.join([command, " -w '%s'" % os.path.abspath(aln_dir)]) run_raxml_pthreads(command, cpus) + alndir, aln = os.path.split(alignment_path) fast_tree_path = os.path.join(alndir, "RAxML_fastTree.fastTREE")