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

fix: pass threads to mash sketch #238

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions drep/d_cluster/compare_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ def __init__(self, locations, number, sketch_folder, genome_names, no_create=Fal
if not os.path.exists(self.chunk_folder):
os.makedirs(self.chunk_folder)

def gen_sketch_cmds(self, mash_exe, MASH_s):
def gen_sketch_cmds(self, mash_exe, MASH_s, p):
cmds = []
for location, name in zip(self.genome_locations, self.genome_names):
file = os.path.join(self.chunk_folder, name)
if not os.path.isfile(file + '.msh'):
cmd = [mash_exe, 'sketch', location, '-s', str(MASH_s), '-o',
cmd = [mash_exe, 'sketch', location, '-p', str(p), '-s', str(MASH_s), '-o',
file]
cmds.append(cmd)
return cmds
Expand Down Expand Up @@ -170,7 +170,7 @@ def run_mash_on_genome_chunks(genome_chunks, mash_exe, sketch_folder, MASH_folde
# Step 1) Create Mash sketches
cmds = []
for GC in genome_chunks:
cmds += GC.gen_sketch_cmds(mash_exe, MASH_s)
cmds += GC.gen_sketch_cmds(mash_exe, MASH_s, p)
if (not dry) & (len(cmds) > 0):
drep.thread_cmds(cmds, logdir=logdir, t=int(p))

Expand Down