Skip to content

Commit

Permalink
ENH Update pyrodigal version (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
cocodyq authored Jan 7, 2024
1 parent 92f19e4 commit 8c23bb3
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions gmsc_mapper/predict.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
def create_pyrodigal_orffinder():
def create_pyrodigal_orffinders():
import pyrodigal

# generating orf_finder
gorf = pyrodigal.OrfFinder(closed=True,
min_gene=33,
max_overlap=0)

morf_finder = pyrodigal.OrfFinder(meta=True,
closed=True,
min_gene=33,
max_overlap=0)
# Prior to version 3.0, pyrodigal called the GeneFinder class
# OrfFinder. This little bit of code allows us to use either
if hasattr(pyrodigal, 'OrfFinder'):
GeneFinder = pyrodigal.OrfFinder
else:
GeneFinder = pyrodigal.GeneFinder
gorf = GeneFinder(closed=True,
min_gene=33,
max_overlap=0)
morf_finder = GeneFinder(meta=True,
closed=True,
min_gene=33,
max_overlap=0)
return gorf, morf_finder


Expand All @@ -34,7 +38,7 @@ def predict_genes(infile, ofile):
from .fasta import fasta_iter
from atomicwrites import atomic_write

gorf, morf_finder = create_pyrodigal_orffinder()
gorf, morf_finder = create_pyrodigal_orffinders()

# predict genes
with atomic_write(ofile, overwrite=True) as odb:
Expand Down

0 comments on commit 8c23bb3

Please sign in to comment.