Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/kmeans manyparts #114

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions partfinder/analysis_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
6 changes: 6 additions & 0 deletions partfinder/raxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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), " "])
Expand Down Expand Up @@ -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")
Expand Down