Skip to content

Commit

Permalink
DEV: Add VOG count threshold fix #5
Browse files Browse the repository at this point in the history
  • Loading branch information
Vini2 committed Jun 13, 2024
1 parent aa5411e commit 6a7a2b1
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
10 changes: 9 additions & 1 deletion reneo/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def run_options(func):
"--evalue",
default=1e-10,
required=False,
help="maximum e-value for phrog annotations",
help="maximum e-value for vog annotations",
type=float,
show_default=True,
),
Expand All @@ -173,6 +173,14 @@ def run_options(func):
type=float,
show_default=True,
),
click.option(
"--nvogs",
default=10,
required=False,
help="minimum number of vogs to consider a component",
type=int,
show_default=True,
),
click.option(
"--covtol",
default=100,
Expand Down
1 change: 1 addition & 0 deletions reneo/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ reneo:
mgfrac: 0.2
evalue: 1E-10
hmmscore: 50
nvogs: 10
covtol: 100
alpha: 1.2
koverage_args:
Expand Down
1 change: 1 addition & 0 deletions reneo/workflow/rules/reneo.smk
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ rule run_reneo:
mgfrac = config['mgfrac'],
evalue = config['evalue'],
hmmscore = config['hmmscore'],
nvogs = config['nvogs'],
covtol = config['covtol'],
alpha = config['alpha'],
output = RESDIR,
Expand Down
4 changes: 4 additions & 0 deletions reneo/workflow/scripts/reneo.py
Original file line number Diff line number Diff line change
Expand Up @@ -1360,6 +1360,9 @@ def main(**kwargs):
kwargs["logger"].info(
f"Minimum hmm score for vog annotations: {kwargs['hmmscore']}"
)
kwargs["logger"].info(
f"Minimum number of vogs to consider a component: {kwargs['nvogs']}"
)
kwargs["logger"].info(
f"Coverage tolerance for extending subpaths: {kwargs['covtol']}"
)
Expand Down Expand Up @@ -1622,6 +1625,7 @@ def main(**kwargs):
mgfrac=float(snakemake.params.mgfrac),
evalue=float(snakemake.params.evalue),
hmmscore=float(snakemake.params.hmmscore),
nvogs = int(snakemake.params.nvogs),
covtol=float(snakemake.params.covtol),
alpha=float(snakemake.params.alpha),
output=snakemake.params.output,
Expand Down
2 changes: 1 addition & 1 deletion reneo/workflow/scripts/reneo_utils/component_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def get_components(**kwargs):

if (
vogs_present
# and unitig_names[unitig] in circular
and len(vogs_found) >= kwargs['nvogs']
and kwargs["edges_lengths"][kwargs["unitig_names"][unitig]] > kwargs["minlength"]
):
pruned_vs[i] = component
Expand Down

0 comments on commit 6a7a2b1

Please sign in to comment.