seqwin 0.3.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 (41) hide show
  1. seqwin-0.3.1/.github/workflows/main.yml +57 -0
  2. seqwin-0.3.1/.github/workflows/publish.yml +171 -0
  3. seqwin-0.3.1/.gitignore +216 -0
  4. seqwin-0.3.1/LICENSE +674 -0
  5. seqwin-0.3.1/PKG-INFO +114 -0
  6. seqwin-0.3.1/README.md +99 -0
  7. seqwin-0.3.1/cpp/CMakeLists.txt +47 -0
  8. seqwin-0.3.1/cpp/LICENSE +677 -0
  9. seqwin-0.3.1/cpp/include/fasta_reader.hpp +21 -0
  10. seqwin-0.3.1/cpp/include/hashing_internals.hpp +3177 -0
  11. seqwin-0.3.1/cpp/include/minimizer.hpp +21 -0
  12. seqwin-0.3.1/cpp/include/nthash.hpp +26 -0
  13. seqwin-0.3.1/cpp/include/nthash_kmer.hpp +658 -0
  14. seqwin-0.3.1/cpp/include/nthash_seed.hpp +1101 -0
  15. seqwin-0.3.1/cpp/include/status.hpp +103 -0
  16. seqwin-0.3.1/cpp/src/fasta_reader.cpp +239 -0
  17. seqwin-0.3.1/cpp/src/minimizer.cpp +92 -0
  18. seqwin-0.3.1/cpp/src/python_bindings.cpp +169 -0
  19. seqwin-0.3.1/cpp/src/status.cpp +135 -0
  20. seqwin-0.3.1/pyproject.toml +47 -0
  21. seqwin-0.3.1/src/seqwin/__init__.py +56 -0
  22. seqwin-0.3.1/src/seqwin/_version.py +1 -0
  23. seqwin-0.3.1/src/seqwin/assemblies.py +540 -0
  24. seqwin-0.3.1/src/seqwin/btllib/__init__.py +98 -0
  25. seqwin-0.3.1/src/seqwin/cli.py +229 -0
  26. seqwin-0.3.1/src/seqwin/config.py +332 -0
  27. seqwin-0.3.1/src/seqwin/core.py +176 -0
  28. seqwin-0.3.1/src/seqwin/graph.py +311 -0
  29. seqwin-0.3.1/src/seqwin/helpers.py +638 -0
  30. seqwin-0.3.1/src/seqwin/kmers.py +672 -0
  31. seqwin-0.3.1/src/seqwin/markers.py +899 -0
  32. seqwin-0.3.1/src/seqwin/mash.py +183 -0
  33. seqwin-0.3.1/src/seqwin/ncbi.py +452 -0
  34. seqwin-0.3.1/src/seqwin/utils.py +578 -0
  35. seqwin-0.3.1/test/expected-output/assemblies.csv +172 -0
  36. seqwin-0.3.1/test/expected-output/config.json +34 -0
  37. seqwin-0.3.1/test/expected-output/signatures.csv +156 -0
  38. seqwin-0.3.1/test/expected-output/signatures.fasta +310 -0
  39. seqwin-0.3.1/test/non-targets.txt +99 -0
  40. seqwin-0.3.1/test/run_test.py +200 -0
  41. seqwin-0.3.1/test/targets.txt +72 -0
@@ -0,0 +1,57 @@
1
+ name: Build and Test
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [main]
6
+ push:
7
+ branches: [main]
8
+ workflow_dispatch:
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ smoke:
15
+ name: ${{ matrix.runner }} / py${{ matrix.python-version }}
16
+ runs-on: ${{ matrix.runner }}
17
+ timeout-minutes: 45
18
+
19
+ strategy:
20
+ fail-fast: false
21
+ matrix:
22
+ runner: [ubuntu-24.04, macos-15, windows-2025]
23
+ python-version: ["3.10", "3.13"]
24
+ include:
25
+ - runner: ubuntu-24.04
26
+ arch: x64
27
+ - runner: macos-15
28
+ arch: arm64
29
+ - runner: windows-2025
30
+ arch: x64
31
+
32
+ steps:
33
+ - uses: actions/checkout@v5
34
+
35
+ - name: Set up Python
36
+ uses: actions/setup-python@v6
37
+ with:
38
+ python-version: ${{ matrix.python-version }}
39
+ architecture: ${{ matrix.arch }}
40
+ cache: pip
41
+
42
+ - name: Build and install package
43
+ run: |
44
+ python -m pip install --upgrade pip
45
+ python -m pip install --prefer-binary . -v
46
+
47
+ - name: Smoke tests
48
+ run: |
49
+ seqwin --help
50
+ python -c "import seqwin; print(seqwin.__version__)"
51
+ python -c "from seqwin.btllib import indexlr; print(indexlr.__name__)"
52
+ python -m pip check
53
+
54
+ - name: Run integration test
55
+ if: matrix.python-version == '3.10'
56
+ run: |
57
+ python test/run_test.py
@@ -0,0 +1,171 @@
1
+ name: Build and publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ check_version:
14
+ name: Check version matches tag
15
+ runs-on: ubuntu-24.04
16
+ steps:
17
+ - uses: actions/checkout@v5
18
+
19
+ - name: Verify version
20
+ # skip unless this run is on a v* tag ref
21
+ if: startsWith(github.ref, 'refs/tags/v')
22
+ shell: bash
23
+ run: |
24
+ # Extract tag name and strip the 'v' prefix
25
+ TAG_VERSION=${GITHUB_REF#refs/tags/v}
26
+ echo "Triggered by tag: v$TAG_VERSION"
27
+
28
+ # Safely extract the __version__ string from _version.py without executing it
29
+ FILE_VERSION=$(python3 -c "
30
+ import re
31
+ with open('src/seqwin/_version.py', 'r') as f:
32
+ match = re.search(r'__version__\s*=\s*[\'\"]([^\'\"]+)[\'\"]', f.read())
33
+ if match:
34
+ print(match.group(1))
35
+ else:
36
+ print('NOT_FOUND')
37
+ ")
38
+
39
+ echo "Version in src/seqwin/_version.py: $FILE_VERSION"
40
+
41
+ if [ "$FILE_VERSION" = "NOT_FOUND" ]; then
42
+ echo "::error::Could not find __version__ in src/seqwin/_version.py"
43
+ exit 1
44
+ fi
45
+
46
+ if [ "$TAG_VERSION" != "$FILE_VERSION" ]; then
47
+ echo "::error::Tag version ($TAG_VERSION) does not match file version ($FILE_VERSION)"
48
+ exit 1
49
+ fi
50
+
51
+ echo "Success: Versions match!"
52
+
53
+ build_sdist:
54
+ name: Build sdist
55
+ needs: [check_version]
56
+ runs-on: ubuntu-24.04
57
+ timeout-minutes: 30
58
+
59
+ steps:
60
+ - uses: actions/checkout@v5
61
+
62
+ - name: Set up Python
63
+ uses: actions/setup-python@v6
64
+ with:
65
+ python-version: '3.13'
66
+ cache: pip
67
+
68
+ - name: Build source distribution
69
+ run: |
70
+ python -m pip install --upgrade pip build twine
71
+ python -m build --sdist --outdir dist
72
+ twine check dist/*
73
+
74
+ - name: Upload sdist
75
+ uses: actions/upload-artifact@v4
76
+ with:
77
+ name: sdist
78
+ path: dist/*.tar.gz
79
+ if-no-files-found: error
80
+
81
+ build_wheels:
82
+ name: Build wheels / ${{ matrix.name }}
83
+ needs: [check_version]
84
+ runs-on: ${{ matrix.runner }}
85
+ timeout-minutes: 90
86
+
87
+ strategy:
88
+ fail-fast: false
89
+ matrix:
90
+ include:
91
+ - name: linux-x64
92
+ runner: ubuntu-24.04
93
+ - name: linux-arm64
94
+ runner: ubuntu-24.04-arm
95
+ - name: macos-x64
96
+ runner: macos-15-intel
97
+ - name: macos-arm64
98
+ runner: macos-15
99
+ - name: windows-x64
100
+ runner: windows-2025
101
+
102
+ steps:
103
+ - uses: actions/checkout@v5
104
+
105
+ - name: Set up Python
106
+ uses: actions/setup-python@v6
107
+ with:
108
+ python-version: '3.13'
109
+ cache: pip
110
+
111
+ - name: Build wheels
112
+ uses: pypa/cibuildwheel@v3.4.1
113
+ env:
114
+ CIBW_BUILD: 'cp310-* cp311-* cp312-* cp313-*'
115
+ CIBW_SKIP: 'pp* cp3??t-* *-musllinux_*'
116
+ CIBW_ARCHS_WINDOWS: AMD64
117
+ CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=10.15
118
+ CIBW_TEST_ENVIRONMENT_MACOS: PIP_PREFER_BINARY=1
119
+ CIBW_TEST_COMMAND: >
120
+ seqwin --help &&
121
+ python -c "import seqwin; print(seqwin.__version__)" &&
122
+ python -c "from seqwin.btllib import indexlr; print(indexlr.__name__)" &&
123
+ python {project}/test/run_test.py &&
124
+ python -m pip check
125
+
126
+ - name: Upload wheels
127
+ uses: actions/upload-artifact@v4
128
+ with:
129
+ name: wheels-${{ matrix.name }}
130
+ path: wheelhouse/*.whl
131
+ if-no-files-found: error
132
+
133
+ publish:
134
+ name: Publish to PyPI
135
+ needs: [build_sdist, build_wheels]
136
+ if: startsWith(github.ref, 'refs/tags/v')
137
+ runs-on: ubuntu-24.04
138
+ environment:
139
+ name: pypi
140
+ url: https://pypi.org/p/seqwin
141
+ permissions:
142
+ contents: read
143
+ id-token: write
144
+
145
+ steps:
146
+ - name: Download wheels
147
+ uses: actions/download-artifact@v4
148
+ with:
149
+ pattern: wheels-*
150
+ path: dist
151
+ merge-multiple: true
152
+
153
+ - name: Download sdist
154
+ uses: actions/download-artifact@v4
155
+ with:
156
+ name: sdist
157
+ path: dist
158
+
159
+ - name: Set up Python
160
+ uses: actions/setup-python@v6
161
+ with:
162
+ python-version: '3.13'
163
+
164
+ - name: Verify distributions
165
+ run: |
166
+ python -m pip install --upgrade pip twine
167
+ twine check dist/*
168
+ ls -lh dist
169
+
170
+ - name: Publish package distributions to PyPI
171
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,216 @@
1
+ # For test data
2
+ test/assemblies.tar
3
+ test/assemblies/
4
+ test/seqwin-out/
5
+ *.tmp
6
+
7
+ # For macOS
8
+ .DS_Store
9
+
10
+ # Byte-compiled / optimized / DLL files
11
+ __pycache__/
12
+ *.py[codz]
13
+ *$py.class
14
+
15
+ # C extensions
16
+ *.so
17
+
18
+ # Distribution / packaging
19
+ .Python
20
+ build/
21
+ develop-eggs/
22
+ dist/
23
+ downloads/
24
+ eggs/
25
+ .eggs/
26
+ lib/
27
+ lib64/
28
+ parts/
29
+ sdist/
30
+ var/
31
+ wheels/
32
+ share/python-wheels/
33
+ *.egg-info/
34
+ .installed.cfg
35
+ *.egg
36
+ MANIFEST
37
+
38
+ # PyInstaller
39
+ # Usually these files are written by a python script from a template
40
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
41
+ *.manifest
42
+ *.spec
43
+
44
+ # Installer logs
45
+ pip-log.txt
46
+ pip-delete-this-directory.txt
47
+
48
+ # Unit test / coverage reports
49
+ htmlcov/
50
+ .tox/
51
+ .nox/
52
+ .coverage
53
+ .coverage.*
54
+ .cache
55
+ nosetests.xml
56
+ coverage.xml
57
+ *.cover
58
+ *.py.cover
59
+ .hypothesis/
60
+ .pytest_cache/
61
+ cover/
62
+
63
+ # Translations
64
+ *.mo
65
+ *.pot
66
+
67
+ # Django stuff:
68
+ *.log
69
+ local_settings.py
70
+ db.sqlite3
71
+ db.sqlite3-journal
72
+
73
+ # Flask stuff:
74
+ instance/
75
+ .webassets-cache
76
+
77
+ # Scrapy stuff:
78
+ .scrapy
79
+
80
+ # Sphinx documentation
81
+ docs/_build/
82
+
83
+ # PyBuilder
84
+ .pybuilder/
85
+ target/
86
+
87
+ # Jupyter Notebook
88
+ .ipynb_checkpoints
89
+
90
+ # IPython
91
+ profile_default/
92
+ ipython_config.py
93
+
94
+ # pyenv
95
+ # For a library or package, you might want to ignore these files since the code is
96
+ # intended to run in multiple environments; otherwise, check them in:
97
+ # .python-version
98
+
99
+ # pipenv
100
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
101
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
102
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
103
+ # install all needed dependencies.
104
+ # Pipfile.lock
105
+
106
+ # UV
107
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
108
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
109
+ # commonly ignored for libraries.
110
+ # uv.lock
111
+
112
+ # poetry
113
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
114
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
115
+ # commonly ignored for libraries.
116
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
117
+ # poetry.lock
118
+ # poetry.toml
119
+
120
+ # pdm
121
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
122
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
123
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
124
+ # pdm.lock
125
+ # pdm.toml
126
+ .pdm-python
127
+ .pdm-build/
128
+
129
+ # pixi
130
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
131
+ # pixi.lock
132
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
133
+ # in the .venv directory. It is recommended not to include this directory in version control.
134
+ .pixi
135
+
136
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
137
+ __pypackages__/
138
+
139
+ # Celery stuff
140
+ celerybeat-schedule
141
+ celerybeat.pid
142
+
143
+ # SageMath parsed files
144
+ *.sage.py
145
+
146
+ # Environments
147
+ .env
148
+ .envrc
149
+ .venv
150
+ env/
151
+ venv/
152
+ ENV/
153
+ env.bak/
154
+ venv.bak/
155
+
156
+ # Spyder project settings
157
+ .spyderproject
158
+ .spyproject
159
+
160
+ # Rope project settings
161
+ .ropeproject
162
+
163
+ # mkdocs documentation
164
+ /site
165
+
166
+ # mypy
167
+ .mypy_cache/
168
+ .dmypy.json
169
+ dmypy.json
170
+
171
+ # Pyre type checker
172
+ .pyre/
173
+
174
+ # pytype static type analyzer
175
+ .pytype/
176
+
177
+ # Cython debug symbols
178
+ cython_debug/
179
+
180
+ # PyCharm
181
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
182
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
183
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
184
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
185
+ # .idea/
186
+
187
+ # Abstra
188
+ # Abstra is an AI-powered process automation framework.
189
+ # Ignore directories containing user credentials, local state, and settings.
190
+ # Learn more at https://abstra.io/docs
191
+ .abstra/
192
+
193
+ # Visual Studio Code
194
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
195
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
196
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
197
+ # you could uncomment the following to ignore the entire vscode folder
198
+ .vscode/
199
+
200
+ # Ruff stuff:
201
+ .ruff_cache/
202
+
203
+ # PyPI configuration file
204
+ .pypirc
205
+
206
+ # Cursor
207
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
208
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
209
+ # refer to https://docs.cursor.com/context/ignore-files
210
+ .cursorignore
211
+ .cursorindexingignore
212
+
213
+ # Marimo
214
+ marimo/_static/
215
+ marimo/_lsp/
216
+ __marimo__/