gReLU 1.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. grelu-1.0.1/.github/workflows/pypi-publish.yml +38 -0
  2. grelu-1.0.1/.github/workflows/pypi-test.yml +40 -0
  3. grelu-1.0.1/.pre-commit-config.yaml +67 -0
  4. grelu-1.0.1/AUTHORS.md +4 -0
  5. grelu-1.0.1/CHANGELOG.md +5 -0
  6. grelu-1.0.1/CONTRIBUTING.md +278 -0
  7. grelu-1.0.1/Dockerfile +57 -0
  8. grelu-1.0.1/LICENSE.txt +21 -0
  9. grelu-1.0.1/MANIFEST.in +1 -0
  10. grelu-1.0.1/PKG-INFO +106 -0
  11. grelu-1.0.1/README.md +60 -0
  12. grelu-1.0.1/docs/Makefile +29 -0
  13. grelu-1.0.1/docs/_static/switcher.json +10 -0
  14. grelu-1.0.1/docs/authors.rst +3 -0
  15. grelu-1.0.1/docs/changelog.rst +3 -0
  16. grelu-1.0.1/docs/conf.py +311 -0
  17. grelu-1.0.1/docs/contributing.rst +2 -0
  18. grelu-1.0.1/docs/index.md +27 -0
  19. grelu-1.0.1/docs/license.rst +8 -0
  20. grelu-1.0.1/docs/media/flowchart.jpg +0 -0
  21. grelu-1.0.1/docs/readme.rst +3 -0
  22. grelu-1.0.1/docs/requirements.txt +11 -0
  23. grelu-1.0.1/docs/tutorials/1_inference.ipynb +2344 -0
  24. grelu-1.0.1/docs/tutorials/2_finetune.ipynb +2635 -0
  25. grelu-1.0.1/docs/tutorials/3_train.ipynb +1480 -0
  26. grelu-1.0.1/docs/tutorials/4_design.ipynb +2410 -0
  27. grelu-1.0.1/docs/tutorials/5_variant.ipynb +1999 -0
  28. grelu-1.0.1/docs/tutorials/6_model_zoo.ipynb +448 -0
  29. grelu-1.0.1/media/flowchart.jpg +0 -0
  30. grelu-1.0.1/pyproject.toml +9 -0
  31. grelu-1.0.1/setup.cfg +101 -0
  32. grelu-1.0.1/setup.py +21 -0
  33. grelu-1.0.1/src/gReLU.egg-info/PKG-INFO +106 -0
  34. grelu-1.0.1/src/gReLU.egg-info/SOURCES.txt +118 -0
  35. grelu-1.0.1/src/gReLU.egg-info/dependency_links.txt +1 -0
  36. grelu-1.0.1/src/gReLU.egg-info/not-zip-safe +1 -0
  37. grelu-1.0.1/src/gReLU.egg-info/requires.txt +30 -0
  38. grelu-1.0.1/src/gReLU.egg-info/top_level.txt +1 -0
  39. grelu-1.0.1/src/grelu/__init__.py +16 -0
  40. grelu-1.0.1/src/grelu/data/__init__.py +0 -0
  41. grelu-1.0.1/src/grelu/data/augment.py +227 -0
  42. grelu-1.0.1/src/grelu/data/dataset.py +1013 -0
  43. grelu-1.0.1/src/grelu/data/preprocess.py +710 -0
  44. grelu-1.0.1/src/grelu/data/utils.py +63 -0
  45. grelu-1.0.1/src/grelu/design.py +287 -0
  46. grelu-1.0.1/src/grelu/interpret/__init__.py +0 -0
  47. grelu-1.0.1/src/grelu/interpret/motifs.py +319 -0
  48. grelu-1.0.1/src/grelu/interpret/score.py +390 -0
  49. grelu-1.0.1/src/grelu/io/__init__.py +136 -0
  50. grelu-1.0.1/src/grelu/io/bed.py +97 -0
  51. grelu-1.0.1/src/grelu/io/bigwig.py +98 -0
  52. grelu-1.0.1/src/grelu/io/fasta.py +48 -0
  53. grelu-1.0.1/src/grelu/io/genome.py +93 -0
  54. grelu-1.0.1/src/grelu/io/meme.py +115 -0
  55. grelu-1.0.1/src/grelu/lightning/__init__.py +1097 -0
  56. grelu-1.0.1/src/grelu/lightning/losses.py +77 -0
  57. grelu-1.0.1/src/grelu/lightning/metrics.py +146 -0
  58. grelu-1.0.1/src/grelu/model/__init__.py +0 -0
  59. grelu-1.0.1/src/grelu/model/blocks.py +761 -0
  60. grelu-1.0.1/src/grelu/model/heads.py +135 -0
  61. grelu-1.0.1/src/grelu/model/layers.py +399 -0
  62. grelu-1.0.1/src/grelu/model/models.py +692 -0
  63. grelu-1.0.1/src/grelu/model/position.py +80 -0
  64. grelu-1.0.1/src/grelu/model/trunks/__init__.py +338 -0
  65. grelu-1.0.1/src/grelu/model/trunks/borzoi.py +166 -0
  66. grelu-1.0.1/src/grelu/model/trunks/enformer.py +277 -0
  67. grelu-1.0.1/src/grelu/model/trunks/explainn.py +119 -0
  68. grelu-1.0.1/src/grelu/resources/__init__.py +138 -0
  69. grelu-1.0.1/src/grelu/resources/__pycache__/__init__.cpython-310.pyc +0 -0
  70. grelu-1.0.1/src/grelu/resources/blacklists/encode/hg19-blacklist.v2.bed +834 -0
  71. grelu-1.0.1/src/grelu/resources/blacklists/encode/hg38-blacklist.v2.bed +636 -0
  72. grelu-1.0.1/src/grelu/resources/blacklists/encode/mm10-blacklist.v2.bed +3435 -0
  73. grelu-1.0.1/src/grelu/resources/blacklists/mito_combined/hg19.full.blacklist.bed +902 -0
  74. grelu-1.0.1/src/grelu/resources/blacklists/mito_combined/hg19_mm10_c.full.blacklist.bed +1425 -0
  75. grelu-1.0.1/src/grelu/resources/blacklists/mito_combined/hg38.full.blacklist.bed +820 -0
  76. grelu-1.0.1/src/grelu/resources/blacklists/mito_combined/mm10.full.blacklist.bed +523 -0
  77. grelu-1.0.1/src/grelu/resources/blacklists/mito_combined/mm9.full.blacklist.bed +3415 -0
  78. grelu-1.0.1/src/grelu/resources/meme/JASPAR2022_CORE_non-redundant_pfms_meme.txt +32224 -0
  79. grelu-1.0.1/src/grelu/resources/meme/jvierstra_consensus_pwms.meme +10405 -0
  80. grelu-1.0.1/src/grelu/sequence/__init__.py +0 -0
  81. grelu-1.0.1/src/grelu/sequence/format.py +428 -0
  82. grelu-1.0.1/src/grelu/sequence/metrics.py +105 -0
  83. grelu-1.0.1/src/grelu/sequence/mutate.py +252 -0
  84. grelu-1.0.1/src/grelu/sequence/utils.py +452 -0
  85. grelu-1.0.1/src/grelu/transforms/__init__.py +0 -0
  86. grelu-1.0.1/src/grelu/transforms/label_transforms.py +50 -0
  87. grelu-1.0.1/src/grelu/transforms/prediction_transforms.py +248 -0
  88. grelu-1.0.1/src/grelu/transforms/seq_transforms.py +132 -0
  89. grelu-1.0.1/src/grelu/utils.py +153 -0
  90. grelu-1.0.1/src/grelu/variant.py +389 -0
  91. grelu-1.0.1/src/grelu/visualize.py +740 -0
  92. grelu-1.0.1/tests/__init__.py +0 -0
  93. grelu-1.0.1/tests/conftest.py +10 -0
  94. grelu-1.0.1/tests/files/test.bed +3 -0
  95. grelu-1.0.1/tests/files/test.bw +0 -0
  96. grelu-1.0.1/tests/files/test.fa.gz +0 -0
  97. grelu-1.0.1/tests/files/test.meme +28 -0
  98. grelu-1.0.1/tests/files/test_variants.txt +32 -0
  99. grelu-1.0.1/tests/files/tomtom/neg_patterns.pattern_0.tomtom.tsv +7 -0
  100. grelu-1.0.1/tests/files/tomtom/neg_patterns.pattern_1.tomtom.tsv +7 -0
  101. grelu-1.0.1/tests/test_augment.py +297 -0
  102. grelu-1.0.1/tests/test_blocks.py +243 -0
  103. grelu-1.0.1/tests/test_data_utils.py +56 -0
  104. grelu-1.0.1/tests/test_dataset.py +870 -0
  105. grelu-1.0.1/tests/test_design.py +202 -0
  106. grelu-1.0.1/tests/test_heads.py +41 -0
  107. grelu-1.0.1/tests/test_interpret.py +136 -0
  108. grelu-1.0.1/tests/test_io.py +81 -0
  109. grelu-1.0.1/tests/test_layers.py +205 -0
  110. grelu-1.0.1/tests/test_lightning.py +421 -0
  111. grelu-1.0.1/tests/test_models.py +269 -0
  112. grelu-1.0.1/tests/test_positional.py +28 -0
  113. grelu-1.0.1/tests/test_preprocess.py +131 -0
  114. grelu-1.0.1/tests/test_resources.py +31 -0
  115. grelu-1.0.1/tests/test_sequence.py +363 -0
  116. grelu-1.0.1/tests/test_transforms.py +137 -0
  117. grelu-1.0.1/tests/test_utils.py +153 -0
  118. grelu-1.0.1/tests/test_variant.py +69 -0
  119. grelu-1.0.1/tox.ini +93 -0
@@ -0,0 +1,38 @@
1
+ # This workflow will install Python dependencies, run tests and lint with a single version of Python
2
+ # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3
+
4
+ name: Publish to PyPI
5
+
6
+ on:
7
+ push:
8
+ tags:
9
+ - "*"
10
+
11
+ jobs:
12
+ docs:
13
+ name: Push Sphinx Pages
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v3
17
+ - uses: actions/setup-python@v3
18
+ with:
19
+ python-version: '3.10'
20
+ - name: Install dependencies
21
+ run: >-
22
+ pip install --upgrade pip
23
+ pip install -r docs/requirements.txt
24
+ - name: Sphinx build
25
+ run: |
26
+ sphinx-build docs _build
27
+ - name: Deploy to GitHub Pages
28
+ uses: peaceiris/actions-gh-pages@v3
29
+ with:
30
+ publish_branch: gh-pages
31
+ github_token: ${{ secrets.GITHUB_TOKEN }}
32
+ publish_dir: _build/
33
+ force_orphan: true
34
+ - name: Publish package
35
+ uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
36
+ with:
37
+ user: __token__
38
+ password: ${{ secrets.PYPI_PASSWORD }}
@@ -0,0 +1,40 @@
1
+ # This workflow will install Python dependencies, run tests and lint with a single version of Python
2
+ # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3
+
4
+ name: Test the library
5
+
6
+ on:
7
+ push:
8
+ branches: [ main ]
9
+ pull_request:
10
+ branches: [ main ]
11
+
12
+ jobs:
13
+ build:
14
+
15
+ runs-on: ubuntu-latest
16
+ strategy:
17
+ matrix:
18
+ python-version: [ '3.10' ]
19
+
20
+ name: Python ${{ matrix.python-version }}
21
+ steps:
22
+ - uses: actions/checkout@v3
23
+ - name: Setup Python
24
+ uses: actions/setup-python@v4
25
+ with:
26
+ python-version: ${{ matrix.python-version }}
27
+ cache: 'pip'
28
+ - name: Install dependencies
29
+ run: |
30
+ python -m pip install --upgrade pip
31
+ pip install flake8 pytest tox
32
+ # - name: Lint with flake8
33
+ # run: |
34
+ # # stop the build if there are Python syntax errors or undefined names
35
+ # flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
36
+ # # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
37
+ # # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
38
+ - name: Test with tox
39
+ run: |
40
+ tox
@@ -0,0 +1,67 @@
1
+ exclude: '^docs/conf.py|src/grelu/resources'
2
+
3
+ repos:
4
+ - repo: https://github.com/pre-commit/pre-commit-hooks
5
+ rev: v4.4.0
6
+ hooks:
7
+ - id: trailing-whitespace
8
+ - id: check-added-large-files
9
+ - id: check-ast
10
+ - id: check-json
11
+ - id: check-merge-conflict
12
+ - id: check-xml
13
+ - id: check-yaml
14
+ - id: debug-statements
15
+ - id: end-of-file-fixer
16
+ - id: requirements-txt-fixer
17
+ - id: mixed-line-ending
18
+ args: ['--fix=auto'] # replace 'auto' with 'lf' to enforce Linux/Mac line endings or 'crlf' for Windows
19
+
20
+ ## If you want to automatically "modernize" your Python code:
21
+ # - repo: https://github.com/asottile/pyupgrade
22
+ # rev: v3.3.1
23
+ # hooks:
24
+ # - id: pyupgrade
25
+ # args: ['--py37-plus']
26
+
27
+ ## If you want to avoid flake8 errors due to unused vars or imports:
28
+ # - repo: https://github.com/PyCQA/autoflake
29
+ # rev: v2.0.2
30
+ # hooks:
31
+ # - id: autoflake
32
+ # args: [
33
+ # --in-place,
34
+ # --remove-all-unused-imports,
35
+ # --remove-unused-variables,
36
+ # ]
37
+
38
+ - repo: https://github.com/PyCQA/isort
39
+ rev: 5.12.0
40
+ hooks:
41
+ - id: isort
42
+
43
+ - repo: https://github.com/psf/black
44
+ rev: 23.3.0
45
+ hooks:
46
+ - id: black
47
+ language_version: python3
48
+
49
+ ## If like to embrace black styles even in the docs:
50
+ # - repo: https://github.com/asottile/blacken-docs
51
+ # rev: v1.13.0
52
+ # hooks:
53
+ # - id: blacken-docs
54
+ # additional_dependencies: [black]
55
+
56
+ - repo: https://github.com/PyCQA/flake8
57
+ rev: 6.0.0
58
+ hooks:
59
+ - id: flake8
60
+ ## You can add flake8 plugins via `additional_dependencies`:
61
+ # additional_dependencies: [flake8-bugbear]
62
+
63
+ ## Check for misspells in documentation files:
64
+ # - repo: https://github.com/codespell-project/codespell
65
+ # rev: v2.2.4
66
+ # hooks:
67
+ # - id: codespell
grelu-1.0.1/AUTHORS.md ADDED
@@ -0,0 +1,4 @@
1
+ # Contributors
2
+
3
+ * Avantika Lal <lal.avantika@gene.com>
4
+ * Gokcen Eraslan <eraslan.gokcen@gene.com>
@@ -0,0 +1,5 @@
1
+ # Changelog
2
+
3
+ ## Version 1.0
4
+
5
+ - Initial release.
@@ -0,0 +1,278 @@
1
+ # Contributing
2
+
3
+ Welcome to ``gReLU`` contributor's guide.
4
+
5
+ This document focuses on getting any potential contributor familiarized
6
+ with the development processes, but [other kinds of contributions](https://opensource.guide/how-to-contribute) are also
7
+ appreciated.
8
+
9
+ If you are new to using git_ or have never collaborated in a project previously,
10
+ please have a look at [contribution-guide.org](https://www.contribution-guide.org/). Other resources are also
11
+ listed in the excellent [guide created by FreeCodeCamp](https://github.com/FreeCodeCamp/how-to-contribute) [#contrib1]_.
12
+
13
+ Please notice, all users and contributors are expected to be **open,
14
+ considerate, reasonable, and respectful**. When in doubt, [Python Software
15
+ Foundation's Code of Conduct](https://www.python.org/psf/conduct/) is a good reference in terms of behavior
16
+ guidelines.
17
+
18
+ ## Issue Reports
19
+
20
+ If you experience bugs or general issues with ``grelu``, please have a look
21
+ on the [issue tracker](https://github.com/Genentech/gReLU/issues). If you don't see anything useful there, please feel
22
+ free to fire an issue report.
23
+
24
+ **Tip:** Please don't forget to include the closed issues in your search.
25
+ Sometimes a solution was already reported, and the problem is considered
26
+ **solved**.
27
+
28
+ New issue reports should include information about your programming environment
29
+ (e.g., operating system, Python version) and steps to reproduce the problem.
30
+ Please try also to simplify the reproduction steps to a very minimal example
31
+ that still illustrates the problem you are facing. By removing other factors,
32
+ you help us to identify the root cause of the issue.
33
+
34
+ ## Documentation Improvements
35
+
36
+ You can help improve ``grelu`` docs by making them more readable and coherent, or
37
+ by adding missing information and correcting mistakes.
38
+
39
+ ``grelu`` documentation uses [Sphinx](https://www.sphinx-doc.org/en/master/) as its main documentation compiler.
40
+ This means that the docs are kept in the same repository as the project code, and
41
+ that any documentation update is done in the same way was a code contribution.
42
+
43
+ **TODO:** Don't forget to mention which markup language you are using.
44
+
45
+ e.g., reStructuredText_ or CommonMark_ with MyST_ extensions.
46
+
47
+ **TODO:** If your project is hosted on GitHub, you can also mention the following tip:
48
+
49
+ **Tip:** Please notice that the [GitHub web interface](https://docs.github.com/en/repositories/working-with-files/managing-files/editing-files) provides a quick way of
50
+ propose changes in ``grelu``'s files. While this mechanism can
51
+ be tricky for normal code contributions, it works perfectly fine for
52
+ contributing to the docs, and can be quite handy.
53
+
54
+ If you are interested in trying this method out, please navigate to
55
+ the ``docs`` folder in the source repository_, find which file you
56
+ would like to propose changes and click in the little pencil icon at the
57
+ top, to open [GitHub's code editor](https://docs.github.com/en/repositories/working-with-files/managing-files/editing-files). Once you finish editing the file,
58
+ please write a message in the form at the bottom of the page describing
59
+ which changes have you made and what are the motivations behind them and
60
+ submit your proposal.
61
+
62
+ When working on documentation changes in your local machine, you can
63
+ compile them using `tox`::
64
+
65
+ tox -e docs
66
+
67
+ and use Python's built-in web server for a preview in your web browser
68
+ (``http://localhost:8000``)::
69
+
70
+ python3 -m http.server --directory 'docs/_build/html'
71
+
72
+ ## Code Contributions
73
+
74
+ **TODO:** Please include a reference or explanation about the internals of the project.
75
+
76
+ An architecture description, design principles or at least a summary of the
77
+ main concepts will make it easy for potential contributors to get started
78
+ quickly.
79
+
80
+ Submit an issue
81
+ ---------------
82
+
83
+ Before you work on any non-trivial code contribution it's best to first create
84
+ a report in the [issue tracker](https://github.com/Genentech/gReLU/issues) to start a discussion on the subject.
85
+ This often provides additional considerations and avoids unnecessary work.
86
+
87
+ Create an environment
88
+ ---------------------
89
+
90
+ Before you start coding, we recommend creating an isolated [virtual
91
+ environment](https://realpython.com/python-virtual-environments-a-primer/) to avoid any problems with your installed Python packages.
92
+ This can easily be done via either [virtualenv](https://virtualenv.pypa.io/en/stable/)::
93
+
94
+ virtualenv <PATH TO VENV>
95
+ source <PATH TO VENV>/bin/activate
96
+
97
+ or [Miniconda](https://docs.conda.io/en/latest/miniconda.html)::
98
+
99
+ conda create -n grelu python=3 six virtualenv pytest pytest-cov
100
+ conda activate grelu
101
+
102
+ Clone the repository
103
+ --------------------
104
+
105
+ 1. Create an user account on [the repository service](https://github.com). if you do not already have one.
106
+ 2. Fork the project repository_: click on the *Clone* button near the top of the
107
+ page. This creates a copy of the code under your account on [the repository service](https://github.com/).
108
+ 3. Clone this copy to your local disk::
109
+
110
+ git clone git@github.com:YourLogin/grelu.git
111
+ cd grelu
112
+
113
+ 4. You should run::
114
+
115
+ pip install -U pip setuptools -e .
116
+
117
+ to be able to import the package under development in the Python REPL.
118
+
119
+ **TODO:** if you are not using pre-commit, please remove the following item:
120
+
121
+ 5. Install [pre-commit](https://pre-commit.com/)::
122
+
123
+ pip install pre-commit
124
+ pre-commit install
125
+
126
+ ``grelu`` comes with a lot of hooks configured to automatically help the
127
+ developer to check the code being written.
128
+
129
+ Implement your changes
130
+ ----------------------
131
+
132
+ 1. Create a branch to hold your changes::
133
+
134
+ git checkout -b my-feature
135
+
136
+ and start making changes. Never work on the main branch!
137
+
138
+ 2. Start your work on this branch. Don't forget to add docstrings_ to new
139
+ functions, modules and classes, especially if they are part of public APIs.
140
+
141
+ 3. Add yourself to the list of contributors in ``AUTHORS.rst``.
142
+
143
+ 4. When you’re done editing, do::
144
+
145
+ git add <MODIFIED FILES>
146
+ git commit
147
+
148
+ to record your changes in git_.
149
+
150
+ **TODO:** if you are not using pre-commit, please remove the following item:
151
+
152
+ Please make sure to see the validation messages from [pre-commit](https://pre-commit.com/) and fix
153
+ any eventual issues.
154
+ This should automatically use [flake8](https://flake8.pycqa.org/en/stable/)/[black](https://pypi.org/project/black/) to check/fix the code style
155
+ in a way that is compatible with the project.
156
+
157
+ **Important:** Don't forget to add unit tests and documentation in case your
158
+ contribution adds an additional feature and is not just a bugfix.
159
+
160
+ Moreover, writing a [descriptive commit message](https://chris.beams.io/posts/git-commit) is highly recommended.
161
+ In case of doubt, you can check the commit history with::
162
+
163
+ git log --graph --decorate --pretty=oneline --abbrev-commit --all
164
+
165
+ to look for recurring communication patterns.
166
+
167
+ 5. Please check that your changes don't break any unit tests with::
168
+
169
+ tox
170
+
171
+ (after having installed [tox](https://tox.wiki/en/stable/) with ``pip install tox`` or ``pipx``).
172
+
173
+ You can also use [tox](https://tox.wiki/en/stable/) to run several other pre-configured tasks in the
174
+ repository. Try ``tox -av`` to see a list of the available checks.
175
+
176
+ Submit your contribution
177
+ ------------------------
178
+
179
+ 1. If everything works fine, push your local branch to [the repository service](https://github.com/) with::
180
+
181
+ git push -u origin my-feature
182
+
183
+ 2. Go to the web page of your fork and click "Create pull request"
184
+ to send your changes for review.
185
+
186
+ **TODO:** if you are using GitHub, you can uncomment the following paragraph
187
+
188
+ Find more detailed information in [creating a PR](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request). You might also want to open
189
+ the PR as a draft first and mark it as ready for review after the feedbacks
190
+ from the continuous integration (CI) system or any required fixes.
191
+
192
+ ## Troubleshooting
193
+
194
+ The following tips can be used when facing problems to build or test the
195
+ package:
196
+
197
+ 1. Make sure to fetch all the tags from the upstream repository_.
198
+ The command ``git describe --abbrev=0 --tags`` should return the version you
199
+ are expecting. If you are trying to run CI scripts in a fork repository,
200
+ make sure to push all the tags.
201
+ You can also try to remove all the egg files or the complete egg folder, i.e.,
202
+ ``.eggs``, as well as the ``*.egg-info`` folders in the ``src`` folder or
203
+ potentially in the root of your project.
204
+
205
+ 2. Sometimes [tox](https://tox.wiki/en/stable/) misses out when new dependencies are added, especially to
206
+ ``setup.cfg`` and ``docs/requirements.txt``. If you find any problems with
207
+ missing dependencies when running a command with [tox](https://tox.wiki/en/stable/), try to recreate the
208
+ ``tox`` environment using the ``-r`` flag. For example, instead of::
209
+
210
+ tox -e docs
211
+
212
+ Try running::
213
+
214
+ tox -r -e docs
215
+
216
+ 3. Make sure to have a reliable [tox](https://tox.wiki/en/stable/) installation that uses the correct
217
+ Python version (e.g., 3.7+). When in doubt you can run::
218
+
219
+ ```shell
220
+ tox --version
221
+ # OR
222
+ which tox
223
+ ```
224
+
225
+ If you have trouble and are seeing weird errors upon running [tox](https://tox.wiki/en/stable/), you can
226
+ also try to create a dedicated [virtual environment](https://realpython.com/python-virtual-environments-a-primer/) with a [tox](https://tox.wiki/en/stable/) binary
227
+ freshly installed. For example::
228
+
229
+ virtualenv .venv
230
+ source .venv/bin/activate
231
+ .venv/bin/pip install tox
232
+ .venv/bin/tox -e all
233
+
234
+ 4. [Pytest can drop you](https://docs.pytest.org/en/stable/how-to/failures.html#using-python-library-pdb-with-pytest) in an interactive session in the case an error occurs.
235
+ In order to do that you need to pass a ``--pdb`` option (for example by
236
+ running ``tox -- -k <NAME OF THE FALLING TEST> --pdb``).
237
+ You can also setup breakpoints manually instead of using the ``--pdb`` option.
238
+
239
+ ## Maintainer tasks
240
+
241
+ ### Releases
242
+
243
+ **TODO:** This section assumes you are using PyPI to publicly release your package.
244
+
245
+ If instead you are using a different/private package index, please update
246
+ the instructions accordingly.
247
+
248
+ If you are part of the group of maintainers and have correct user permissions
249
+ on [PyPI](https://pypi.org/), the following steps can be used to release a new version for
250
+ ``grelu``:
251
+
252
+ 1. Make sure all unit tests are successful.
253
+ 2. Tag the current commit on the main branch with a release tag, e.g., ``v1.2.3``.
254
+ 3. Push the new tag to the upstream repository_, e.g., ``git push upstream v1.2.3``
255
+ 4. Clean up the ``dist`` and ``build`` folders with ``tox -e clean``
256
+ (or ``rm -rf dist build``)
257
+ to avoid confusion with old builds and Sphinx docs.
258
+ 5. Run ``tox -e build`` and check that the files in ``dist`` have
259
+ the correct version (no ``.dirty`` or git_ hash) according to the git_ tag.
260
+ Also check the sizes of the distributions, if they are too big (e.g., >
261
+ 500KB), unwanted clutter may have been accidentally included.
262
+ 6. Run ``tox -e publish -- --repository pypi`` and check that everything was
263
+ uploaded to PyPI_ correctly.
264
+
265
+ .. [#contrib1] Even though, these resources focus on open source projects and
266
+ communities, the general ideas behind collaborating with other developers
267
+ to collectively create software are general and can be applied to all sorts
268
+ of environments, including private companies and proprietary code bases.
269
+
270
+ .. <-- start -->
271
+ **TODO:** Please review and change the following definitions:
272
+
273
+ .. |the repository service| replace:: GitLab
274
+ .. |contribute button| replace:: "Create pull request"
275
+
276
+ .. _repository: https://github.com/Genentech/gReLU/
277
+ .. _issue tracker: https://github.com/Genentech/gReLU/issues
278
+ .. <-- end -->
grelu-1.0.1/Dockerfile ADDED
@@ -0,0 +1,57 @@
1
+ FROM pytorchlightning/pytorch_lightning:base-cuda-py3.11-torch2.2-cuda12.1.0
2
+
3
+
4
+ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
5
+ wget vim gcc bzip2 ca-certificates libncurses5-dev \
6
+ libbz2-dev \
7
+ liblzma-dev \
8
+ libcurl4-gnutls-dev \
9
+ zlib1g-dev \
10
+ libssl-dev \
11
+ make \
12
+ g++ \
13
+ git \
14
+ rsync \
15
+ openssh-client
16
+
17
+ # Install bedtools
18
+ RUN wget https://github.com/arq5x/bedtools2/releases/download/v2.30.0/bedtools.static.binary && \
19
+ mv bedtools.static.binary bedtools && \
20
+ chmod a+x bedtools && \
21
+ mv bedtools /usr/bin
22
+
23
+ # Install UCSC utils
24
+ RUN rsync -aP rsync://hgdownload.soe.ucsc.edu/genome/admin/exe/linux.x86_64/bedGraphToBigWig /usr/bin/
25
+ RUN rsync -aP rsync://hgdownload.soe.ucsc.edu/genome/admin/exe/linux.x86_64/bigWigToBedGraph /usr/bin/
26
+ RUN rsync -aP rsync://hgdownload.soe.ucsc.edu/genome/admin/exe/linux.x86_64/genePredToBed /usr/bin/
27
+ RUN rsync -aP rsync://hgdownload.soe.ucsc.edu/genome/admin/exe/linux.x86_64/genePredToGtf /usr/bin/
28
+ RUN rsync -aP rsync://hgdownload.soe.ucsc.edu/genome/admin/exe/linux.x86_64/bedToGenePred /usr/bin/
29
+ RUN rsync -aP rsync://hgdownload.soe.ucsc.edu/genome/admin/exe/linux.x86_64/gtfToGenePred /usr/bin/
30
+ RUN rsync -aP rsync://hgdownload.soe.ucsc.edu/genome/admin/exe/linux.x86_64/gff3ToGenePred /usr/bin/
31
+
32
+
33
+ # Install python packages
34
+ RUN pip install cython setuptools jupyterlab pandas scikit-learn tables lxml html5lib
35
+ RUN pip install pytest pytest-cov pre-commit
36
+ RUN pip install black flake8 isort
37
+ RUN pip install captum==0.5.0 wandb tensorboard plotnine
38
+
39
+ RUN pip install bioframe biopython genomepy scanpy \
40
+ pyjaspar pymemesuite pyBigWig pyfaidx pytabix
41
+ RUN pip install bpnet-lite>=0.5.7 ledidi enformer-pytorch genomepy
42
+ RUN pip install pygenomeviz
43
+
44
+ # Install modiscolite
45
+ RUN pip install modisco-lite@git+https://github.com/jmschrei/tfmodisco-lite.git
46
+
47
+ # Install MEME suite
48
+ RUN wget https://meme-suite.org/meme/meme-software/5.5.1/meme-5.5.1.tar.gz && \
49
+ tar -xvzf meme-5.5.1.tar.gz && \
50
+ cd meme-5.5.1 && \
51
+ ./configure --prefix=/usr --enable-build-libxml2 --enable-build-libxslt && \
52
+ make && \
53
+ make install
54
+
55
+ # Run jupyterlab
56
+ WORKDIR /
57
+ CMD jupyter lab --no-browser --allow-root --port 8891 --ip 0.0.0.0 --NotebookApp.token=''
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 Genentech, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ graft src/grelu/resources
grelu-1.0.1/PKG-INFO ADDED
@@ -0,0 +1,106 @@
1
+ Metadata-Version: 2.1
2
+ Name: gReLU
3
+ Version: 1.0.1
4
+ Summary: gReLU is a python library to train, interpret, and apply deep learning models to DNA sequences
5
+ Home-page: https://code.roche.com/gred-rb-ai-ml-regulatory-genomics/grelu
6
+ Author: lal.avantika,eraslan.gokcen
7
+ Author-email: lal.avantika@gene.com
8
+ License: MIT
9
+ Project-URL: Documentation, https://code.roche.com/gred-rb-ai-ml-regulatory-genomics/grelu
10
+ Project-URL: Source, https://code.roche.com/gred-rb-ai-ml-regulatory-genomics/grelu
11
+ Platform: Linux
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Programming Language :: Python
14
+ Requires-Python: >=3.8
15
+ Description-Content-Type: text/markdown; charset=UTF-8
16
+ License-File: LICENSE.txt
17
+ Requires-Dist: importlib-metadata
18
+ Requires-Dist: importlib-resources
19
+ Requires-Dist: wandb>=0.14
20
+ Requires-Dist: numpy
21
+ Requires-Dist: pandas
22
+ Requires-Dist: seaborn
23
+ Requires-Dist: matplotlib
24
+ Requires-Dist: plotnine>=0.8
25
+ Requires-Dist: anndata>=0.8
26
+ Requires-Dist: scikit-learn
27
+ Requires-Dist: pymemesuite
28
+ Requires-Dist: torch>=2.0
29
+ Requires-Dist: pytorch-lightning>=2.0
30
+ Requires-Dist: modisco-lite>=2.2.1
31
+ Requires-Dist: biopython
32
+ Requires-Dist: enformer-pytorch
33
+ Requires-Dist: genomepy
34
+ Requires-Dist: bioframe>=0.4
35
+ Requires-Dist: captum==0.5.0
36
+ Requires-Dist: bpnet-lite==0.5.7
37
+ Requires-Dist: logomaker>=0.8
38
+ Requires-Dist: pyBigWig
39
+ Requires-Dist: ledidi
40
+ Requires-Dist: tangermeme
41
+ Requires-Dist: pygenomeviz<=0.4.4
42
+ Provides-Extra: testing
43
+ Requires-Dist: setuptools; extra == "testing"
44
+ Requires-Dist: pytest; extra == "testing"
45
+ Requires-Dist: pytest-cov; extra == "testing"
46
+
47
+ # gReLU
48
+
49
+ gReLU is a Python library to train, interpret, and apply deep learning models to DNA sequences. Code documentation is available [here](https://genentech.github.io/gReLU/).
50
+
51
+ ![Flowchart](media/flowchart.jpg)
52
+
53
+ ## Installation
54
+
55
+ To install from source:
56
+
57
+ ```shell
58
+ git clone https://github.com/Genentech/gReLU.git
59
+ cd gReLU
60
+ pip install .
61
+ ```
62
+
63
+ ## Contributing
64
+
65
+ This project uses [pre-commit](https://pre-commit.com/). Please make sure to install it before making any changes:
66
+
67
+ ```shell
68
+ pip install pre-commit
69
+ cd gReLU
70
+ pre-commit install
71
+ ```
72
+
73
+ It is a good idea to update the hooks to the latest version:
74
+
75
+ ```shell
76
+ pre-commit autoupdate
77
+ ```
78
+
79
+ ## Additional requirements
80
+
81
+ If you want to use genome annotation features through the function `grelu.io.genome.read_gtf`, you will need to install the following UCSC utilities: `genePredToBed`, `genePredToGtf`, `bedToGenePred`, `gtfToGenePred`, `gff3ToGenePred`.
82
+
83
+ If you want to create bigWig files through the function `grelu.data.preprocess.make_insertion_bigwig`, you will need to install the following UCSC utilities: `bedGraphToBigWig`.
84
+
85
+ UCSC utilities can be installed from `http://hgdownload.cse.ucsc.edu/admin/exe/`, for example using the following commands:
86
+
87
+ ```shell
88
+ rsync -aP rsync://hgdownload.soe.ucsc.edu/genome/admin/exe/linux.x86_64/bedGraphToBigWig /usr/bin/
89
+ rsync -aP rsync://hgdownload.soe.ucsc.edu/genome/admin/exe/linux.x86_64/genePredToBed /usr/bin/
90
+ rsync -aP rsync://hgdownload.soe.ucsc.edu/genome/admin/exe/linux.x86_64/genePredToGtf /usr/bin/
91
+ rsync -aP rsync://hgdownload.soe.ucsc.edu/genome/admin/exe/linux.x86_64/bedToGenePred /usr/bin/
92
+ rsync -aP rsync://hgdownload.soe.ucsc.edu/genome/admin/exe/linux.x86_64/gtfToGenePred /usr/bin/
93
+ rsync -aP rsync://hgdownload.soe.ucsc.edu/genome/admin/exe/linux.x86_64/gff3ToGenePred /usr/bin/
94
+ ```
95
+
96
+ or via bioconda:
97
+
98
+ ```shell
99
+ conda install -y \
100
+ bioconda::ucsc-bedgraphtobigwig \
101
+ bioconda::ucsc-genepredtobed \
102
+ bioconda::ucsc-genepredtogtf \
103
+ bioconda::ucsc-bedtogenepred \
104
+ bioconda::ucsc-gtftogenepred \
105
+ bioconda::ucsc-gff3togenepred
106
+ ```
grelu-1.0.1/README.md ADDED
@@ -0,0 +1,60 @@
1
+ # gReLU
2
+
3
+ gReLU is a Python library to train, interpret, and apply deep learning models to DNA sequences. Code documentation is available [here](https://genentech.github.io/gReLU/).
4
+
5
+ ![Flowchart](media/flowchart.jpg)
6
+
7
+ ## Installation
8
+
9
+ To install from source:
10
+
11
+ ```shell
12
+ git clone https://github.com/Genentech/gReLU.git
13
+ cd gReLU
14
+ pip install .
15
+ ```
16
+
17
+ ## Contributing
18
+
19
+ This project uses [pre-commit](https://pre-commit.com/). Please make sure to install it before making any changes:
20
+
21
+ ```shell
22
+ pip install pre-commit
23
+ cd gReLU
24
+ pre-commit install
25
+ ```
26
+
27
+ It is a good idea to update the hooks to the latest version:
28
+
29
+ ```shell
30
+ pre-commit autoupdate
31
+ ```
32
+
33
+ ## Additional requirements
34
+
35
+ If you want to use genome annotation features through the function `grelu.io.genome.read_gtf`, you will need to install the following UCSC utilities: `genePredToBed`, `genePredToGtf`, `bedToGenePred`, `gtfToGenePred`, `gff3ToGenePred`.
36
+
37
+ If you want to create bigWig files through the function `grelu.data.preprocess.make_insertion_bigwig`, you will need to install the following UCSC utilities: `bedGraphToBigWig`.
38
+
39
+ UCSC utilities can be installed from `http://hgdownload.cse.ucsc.edu/admin/exe/`, for example using the following commands:
40
+
41
+ ```shell
42
+ rsync -aP rsync://hgdownload.soe.ucsc.edu/genome/admin/exe/linux.x86_64/bedGraphToBigWig /usr/bin/
43
+ rsync -aP rsync://hgdownload.soe.ucsc.edu/genome/admin/exe/linux.x86_64/genePredToBed /usr/bin/
44
+ rsync -aP rsync://hgdownload.soe.ucsc.edu/genome/admin/exe/linux.x86_64/genePredToGtf /usr/bin/
45
+ rsync -aP rsync://hgdownload.soe.ucsc.edu/genome/admin/exe/linux.x86_64/bedToGenePred /usr/bin/
46
+ rsync -aP rsync://hgdownload.soe.ucsc.edu/genome/admin/exe/linux.x86_64/gtfToGenePred /usr/bin/
47
+ rsync -aP rsync://hgdownload.soe.ucsc.edu/genome/admin/exe/linux.x86_64/gff3ToGenePred /usr/bin/
48
+ ```
49
+
50
+ or via bioconda:
51
+
52
+ ```shell
53
+ conda install -y \
54
+ bioconda::ucsc-bedgraphtobigwig \
55
+ bioconda::ucsc-genepredtobed \
56
+ bioconda::ucsc-genepredtogtf \
57
+ bioconda::ucsc-bedtogenepred \
58
+ bioconda::ucsc-gtftogenepred \
59
+ bioconda::ucsc-gff3togenepred
60
+ ```