Skip to content

Commit 9aecaae

Browse files
committed
Allow disabling cluster trimming with a CLI flag
1 parent fab97d4 commit 9aecaae

File tree

4 files changed

+30
-1
lines changed

4 files changed

+30
-1
lines changed

gecco/cli/commands/_common.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,12 +589,17 @@ def extract_clusters(
589589
postproc: str,
590590
cds: int,
591591
edge_distance: int,
592+
trim: bool,
592593
) -> List["Cluster"]:
593594
from ...refine import ClusterRefiner
594595

595596
logger.info("Extracting", "predicted clusters", level=1)
596597
refiner = ClusterRefiner(
597-
threshold=threshold, criterion=postproc, n_cds=cds, edge_distance=edge_distance
598+
threshold=threshold,
599+
criterion=postproc,
600+
n_cds=cds,
601+
edge_distance=edge_distance,
602+
trim=trim,
598603
)
599604

600605
with logger.progress() as progress:

gecco/cli/commands/_parser.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,28 @@ def configure_group_cluster_detection(
306306
"of false positives on small contigs."
307307
),
308308
)
309+
310+
if defaults.get("--trim", True):
311+
group.add_argument(
312+
"--no-trim",
313+
action="store_false",
314+
dest="trim",
315+
help=(
316+
"Disable trimming genes lacking domain annotations from gene "
317+
"clusters predicted by the internal CRF model."
318+
),
319+
)
320+
else:
321+
group.add_argument(
322+
"--trim",
323+
action="store_true",
324+
dest="trim",
325+
help=(
326+
"Enable trimming genes lacking domain annotations from gene "
327+
"clusters predicted by the internal CRF model."
328+
),
329+
)
330+
309331
return group
310332

311333

gecco/cli/commands/predict.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ def run(
106106
postproc=args.postproc,
107107
cds=args.cds,
108108
edge_distance=args.edge_distance,
109+
trim=args.trim,
109110
)
110111
if clusters:
111112
logger.success("Found", len(clusters), "potential gene clusters", level=1)

gecco/cli/commands/run.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ def run(
160160
postproc=args.postproc,
161161
cds=args.cds,
162162
edge_distance=args.edge_distance,
163+
trim=args.trim,
163164
)
164165
if clusters:
165166
logger.success("Found", len(clusters), "potential gene clusters", level=1)

0 commit comments

Comments
 (0)