Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRG] make sourmash compatible with khmer 3 #508

Merged
merged 1 commit into from
Jun 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
language="c++",
extra_compile_args=EXTRA_COMPILE_ARGS,
extra_link_args=EXTRA_LINK_ARGS)],
"install_requires": ["screed>=0.9", "ijson", "khmer>=2.1<3.0"],
"install_requires": ["screed>=0.9", "ijson", "khmer>=2.1"],
"setup_requires": ['Cython>=0.25.2', "setuptools>=38.6.0"],
"extras_require": {
'test' : ['pytest', 'pytest-cov', 'numpy', 'matplotlib', 'scipy','recommonmark'],
Expand Down
9 changes: 7 additions & 2 deletions sourmash/sbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ def search_transcript(node, seq, threshold):

import khmer

try:
load_nodegraph = khmer.load_nodegraph
except AttributeError:
load_nodegraph = khmer.Nodegraph.load

from .sbt_storage import FSStorage, TarStorage, IPFSStorage, RedisStorage
from .logging import error, notify, debug

Expand Down Expand Up @@ -785,7 +790,7 @@ def data(self):
with NamedTemporaryFile(suffix=".gz") as f:
f.write(data)
f.file.flush()
self._data = khmer.load_nodegraph(f.name)
self._data = load_nodegraph(f.name)
return self._data

@data.setter
Expand Down Expand Up @@ -838,7 +843,7 @@ def data(self):
with NamedTemporaryFile(suffix=".gz") as f:
f.write(data)
f.file.flush()
self._data = khmer.load_nodegraph(f.name)
self._data = load_nodegraph(f.name)
return self._data

@data.setter
Expand Down