diff --git a/README.md b/README.md index 0ff102f4..630f98e2 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,11 @@ Please see our [release notes](./RELEASE_NOTES.md) for the latest updates to Sel ## Installation -We recommend using Selene with Python 3.6 or above. +We recommend using Selene with Python 3.9 or above. Package installation should only take a few minutes (less than 10 minutes, typically ~2-3 minutes) with any of these methods (conda, pip, source). **First, install [PyTorch](https://pytorch.org/get-started/locally/).** If you have an NVIDIA GPU, install a version of PyTorch that supports it--Selene will run much faster with a discrete GPU. -The library is currently compatible with PyTorch versions between 0.4.1 and 1.9. +The library is currently compatible with PyTorch versions between 1.0.0 and 2.3.1. We will continue to update Selene to be compatible with the latest version of PyTorch. ### Installing selene with [Anaconda](https://www.anaconda.com/download/) (for Linux): @@ -73,6 +73,10 @@ Join our [Google group](https://groups.google.com/forum/#!forum/selene-sdk) if y The documentation for Selene is available [here](https://selene.flatironinstitute.org/). If you are interested in running Selene through the command-line interface (CLI), [this document](https://selene.flatironinstitute.org/overview/cli.html) describes how the configuration file format (used by the CLI) works and details all the possible configuration parameters you may need to build your own configuration file. +**Important**: The tutorials and manuscript examples were originally run on Selene version 0.1.3---and later with Selene 0.2.0 (PyTorch version 0.4.1). Selene has since been updated substantially and files such as `selene-gpu.yml` specify PyTorch version 1.0.0. Please note that models created with an older version of PyTorch (such as those downloadable with the manuscript case studies) are NOT compatible with newer versions of PyTorch. If you run into errors loading trained model weights files, it is likely the result of differences in PyTorch or CUDA toolkit versions. + +We recommend referring to the API documentation linked above, along with more current usages of Selene in related papers (e.g. [Sei framework code](https://github.com/FunctionLab/sei-framework)) as the easiest starting point as of right now. + ## Examples We provide 2 sets of examples: Jupyter notebook tutorials and case studies that we've described in our manuscript. @@ -88,8 +92,6 @@ These examples reflect how we most often use Selene in our own projects, whereas We recommend that the examples be run on a machine with a CUDA-enabled GPU. All examples take significantly longer when run on a CPU machine. (See the following sections for time estimates.) -**Important**: The tutorials and manuscript examples were originally run on Selene version 0.1.3---and later with Selene 0.2.0 (PyTorch version 0.4.1). Selene has since been updated and files such as `selene-gpu.yml` specify PyTorch version 1.0.0. Please note that models created with an older version of PyTorch (such as those downloadable with the manuscript case studies) are NOT compatible with newer versions of PyTorch. If you run into errors loading trained model weights files, it is likely the result of differences in PyTorch or CUDA toolkit versions. - ### Tutorials Tutorials for Selene are available [here](https://github.com/FunctionLab/selene/tree/master/tutorials). diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 641ab4cc..7258e29e 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -2,6 +2,12 @@ This is a document describing new functionality, bug fixes, breaking changes, etc. associated with Selene version releases from v0.5.0 onwards. +## Version 0.5.2 +- Fix Cython type error causing build issues with Python 3.9+ + +## Version 0.5.1 +- PyTorch<=1.9 compatibility + ## Version 0.5.0 ### New functionality diff --git a/pyproject.toml b/pyproject.toml index d5970617..d5a66840 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,5 @@ [build-system] -requires = ["setuptools", "wheel", "numpy", "cython"] +requires = ["setuptools", "wheel", "numpy>=1.26.4", "cython>=3.0.10"] + +[tool.poetry.dependencies] +python = ">=3.9" diff --git a/selene_sdk/targets/_genomic_features.pyx b/selene_sdk/targets/_genomic_features.pyx index 764d84fb..85b3acfa 100644 --- a/selene_sdk/targets/_genomic_features.pyx +++ b/selene_sdk/targets/_genomic_features.pyx @@ -4,11 +4,11 @@ import numpy as np cimport cython cimport numpy as np -ctypedef np.int_t DTYPE_t +ctypedef np.int64_t DTYPE_t ctypedef np.float32_t FDTYPE_t @cython.boundscheck(False) -@cython.wraparound(False) +@cython.wraparound(False) def _fast_get_feature_data(int start, int end, np.ndarray[FDTYPE_t, ndim=1] thresholds, @@ -18,14 +18,14 @@ def _fast_get_feature_data(int start, cdef int query_length = end - start cdef int feature_start, feature_end, index_start, index_end, index_feat cdef np.ndarray[DTYPE_t, ndim=2] encoding = np.zeros( - (query_length, n_features), dtype=np.int) + (query_length, n_features), dtype=np.int64) cdef np.ndarray[DTYPE_t, ndim=1] targets = np.zeros( - n_features, dtype=np.int) + n_features, dtype=np.int64) cdef list row if rows is None: return np.zeros((n_features,)) - + for row in rows: feature_start = int(row[1]) feature_end = int(row[2]) @@ -37,6 +37,6 @@ def _fast_get_feature_data(int start, encoding[index_start:index_end, index_feat] = 1 thresholds = (thresholds * query_length - 1).clip(min=0) - targets = (np.sum(encoding, axis=0) > thresholds.astype(int)).astype(int) + targets = (np.sum(encoding, axis=0) > thresholds.astype(np.int64)).astype(np.int64) return targets diff --git a/selene_sdk/version.py b/selene_sdk/version.py index 3d187266..72251527 100644 --- a/selene_sdk/version.py +++ b/selene_sdk/version.py @@ -1 +1 @@ -__version__ = "0.5.0" +__version__ = "0.5.2" diff --git a/setup.py b/setup.py index 96546bd3..a3737824 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ cmdclass = {'build_ext': build_ext} setup(name="selene-sdk", - version="0.5.0", + version="0.5.2", long_description=long_description, long_description_content_type='text/markdown', description=("framework for developing sequence-level " @@ -48,12 +48,13 @@ ], ext_modules=ext_modules, cmdclass=cmdclass, + python_requires='>=3.9', install_requires=[ - "cython>=0.27.3", + "cython>=3.0.10", 'click', "h5py", "matplotlib>=2.2.3", - "numpy", + "numpy>=1.26.4", "pandas", "plotly", "pyfaidx", @@ -63,7 +64,7 @@ "scipy", "seaborn", "statsmodels", - "torch>=0.4.1, <=1.9", + "torch>=1.0.0, <=2.3.1", ], entry_points={ 'console_scripts': [