From e37d332a1aa12aedaa2b6973129bb8ae4d6903ea Mon Sep 17 00:00:00 2001 From: Oliver Schwengers Date: Tue, 6 Dec 2022 10:02:14 +0100 Subject: [PATCH] fix pyrodigal training mode on provided training files #175 Reset the pyrodigal meta mode to False even for sequences shorter than the required min if a training files is provided. --- bakta/features/cds.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bakta/features/cds.py b/bakta/features/cds.py index b5077f12..a230f74d 100644 --- a/bakta/features/cds.py +++ b/bakta/features/cds.py @@ -32,6 +32,7 @@ def predict(genome: dict, sequences_path: Path): prodigal_tf_path = cfg.prodigal_tf trainings_info = None prodigal_metamode = genome['size'] < pyrodigal.MIN_SINGLE_GENOME # 20_000 bp + log.debug('prodigal mode: meta=%s', prodigal_metamode) if(prodigal_tf_path is None): closed = not genome['complete'] if(not prodigal_metamode): @@ -45,7 +46,8 @@ def predict(genome: dict, sequences_path: Path): try: with prodigal_tf_path.open('rb') as fh_tf: trainings_info = pyrodigal.TrainingInfo.load(fh_tf) - log.info('use provided prodigal training file: file=%s', prodigal_tf_path) + prodigal_metamode = False + log.info('use provided prodigal training info: file=%s, meta mode=%s', prodigal_tf_path, prodigal_metamode) except: log.error('Cannot use provided prodigal training file: file=%s', prodigal_tf_path) sys.exit(f'Error! Cannot use provided prodigal training file: file={prodigal_tf_path}')