Skip to content

Commit

Permalink
add support for pyrodigal v2 and v3
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanMainguy committed Nov 4, 2023
1 parent 7116010 commit 8c08913
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions binette/cds.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ def predict(contigs_iterator: Iterator, outfaa: str, threads: int =1) -> Dict[st
:return: A dictionary mapping contig names to predicted genes.
"""

orf_finder = pyrodigal.GeneFinder(meta="meta")

try:
# for version >=3 of pyrodigal
orf_finder = pyrodigal.GeneFinder(meta="meta")
except AttributeError:
orf_finder = pyrodigal.OrfFinder(meta="meta")

logging.info(f"Predicting cds sequences with Pyrodigal using {threads} threads.")

with multiprocessing.pool.ThreadPool(processes=threads) as pool:
Expand Down

0 comments on commit 8c08913

Please sign in to comment.