Skip to content

Commit

Permalink
Updated CLI parameters and help messages
Browse files Browse the repository at this point in the history
  • Loading branch information
alneberg committed Jan 26, 2024
1 parent 316b981 commit c9dda46
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
25 changes: 14 additions & 11 deletions anglerfish/explore/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,65 +11,68 @@
"--threads",
default=4,
type=int,
help="Number of threads specified by minimap2",
help="Number of threads specified to minimap2",
)
@click.option(
"-n", "--no_overwrite", is_flag=True, help="Do not overwrite existing alignments"
"-e",
"--use-existing",
is_flag=True,
help="Use existing alignments if found in the specified output directory.",
)
@click.option(
"-g",
"--good_hit_threshold",
default=0.9,
type=float,
help="Fraction of bases before and after index insert required to match perfectly for a hit to be considered a good hit. Default=0.9",
help="Fraction of adaptor bases immediately before and immediately after index insert required to match perfectly for a hit to be considered a good hit (default=0.9).",
)
@click.option(
"-i",
"--insert_thres_low",
default=4,
type=int,
help="Lower threshold for insert length, with value included",
help="Lower threshold for index(+UMI) insert length, with value included (deafult=4).",
)
@click.option(
"-j",
"--insert_thres_high",
default=30,
type=int,
help="Upper threshold for insert length, with value included",
help="Upper threshold for index(+UMI) insert length, with value included (default=30).",
)
@click.option(
"-B",
"--minimap_b",
default=4,
type=int,
help="Minimap2 -B parameter, mismatch penalty",
help="Minimap2 -B parameter, mismatch penalty (default=4).",
)
@click.option(
"-m",
"--min_hits_per_adaptor",
default=50,
type=int,
help="Minimum number of good hits for an adaptor to be included in the analysis",
help="Minimum number of good hits for an adaptor to be included in the analysis (default=50).",
)
@click.option(
"-u",
"--umi_threshold",
default=11,
type=float,
help="Minimum number of bases in insert to perform entropy calculation",
help="Minimum number of bases in insert to perform entropy calculation (default=11).",
)
@click.option(
"-k",
"--kmer_length",
default=2,
type=int,
help="Length of k-mers to use for entropy calculation",
help="Length of k-mers to use for entropy calculation (default=2).",
)
def main(
fastq,
outdir,
threads,
no_overwrite,
use_existing,
good_hit_threshold,
insert_thres_low,
insert_thres_high,
Expand All @@ -82,7 +85,7 @@ def main(
fastq,
outdir,
threads,
no_overwrite,
use_existing,
good_hit_threshold,
insert_thres_low,
insert_thres_high,
Expand Down
8 changes: 4 additions & 4 deletions anglerfish/explore/explore.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def run_explore(
fastq,
outdir,
threads,
no_overwrite,
use_existing,
good_hit_threshold,
insert_thres_low,
insert_thres_high,
Expand All @@ -31,9 +31,9 @@ def run_explore(
os.mkdir(outdir)
except FileExistsError:
log.info(f"Output directory {outdir} already exists")
if not no_overwrite:
if not use_existing:
log.error(
f"Output directory {outdir} already exists, please use --no_overwrite to continue"
f"Output directory {outdir} already exists, please use --use_existing to continue"
)
exit(1)
else:
Expand All @@ -52,7 +52,7 @@ def run_explore(
# Align
aln_path = os.path.join(outdir, f"{adaptor_name}.paf")
alignments.append((adaptor, aln_path))
if os.path.exists(aln_path) and no_overwrite:
if os.path.exists(aln_path) and use_existing:
log.info(f"Skipping {adaptor_name} as alignment already exists")
continue
adaptor_path = os.path.join(outdir, f"{adaptor_name}.fasta")
Expand Down

0 comments on commit c9dda46

Please sign in to comment.