Skip to content

Commit

Permalink
Added new option to set number of assemblies
Browse files Browse the repository at this point in the history
  • Loading branch information
genomewalker committed Oct 4, 2022
1 parent 9e4e1c0 commit c9fb823
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
6 changes: 3 additions & 3 deletions derep_genomes/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ def main():

if not to_do.empty:
assm_min = 2
assm_max = 10
assm_max = args.assm_max

# log.info("Calculating assembly lengths")

Expand Down Expand Up @@ -763,8 +763,8 @@ def main():
}
else:
log.info(
"Dereplicating {:,} taxa with more than 5 assemblies using {} threads".format(
len(taxons), args.threads
"Dereplicating {:,} taxa with more than {} assemblies using {} threads".format(
len(taxons), args.assm_max, args.threads
)
)
log.warning("This can take a long time!!!")
Expand Down
11 changes: 10 additions & 1 deletion derep_genomes/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def is_valid_file(parser, arg, var):
"copy": "Copy assembly files to the output folder",
"min_genome_size": "Minimum genome size where to apply heuristics to find ANI fragment size",
"ani_fraglen_fraction": "Fraction of the genome size used to estimate the ANI used fragment length",
"assm_max": "Maximum number of assemblies to process for small batches",
}


Expand Down Expand Up @@ -156,6 +157,14 @@ def get_arguments(argv=None):
help=help_msg["mash_threshold"],
dest="mash_threshold",
)
optional.add_argument(
"--max-assemblies",
type=int,
metavar="INT",
dest="assm_max",
default=10,
help=help_msg["assm_max"],
)
slurm.add_argument(
"--slurm-config",
dest="slurm_config",
Expand Down Expand Up @@ -394,4 +403,4 @@ def applyParallel(dfGrouped, func, threads, parms):
p.map(func, [group for name, group in dfGrouped]),
total=len([group for name, group in dfGrouped]),
)
return pd.concat(ret_list)
return pd.concat(ret_list)

0 comments on commit c9fb823

Please sign in to comment.