mimosa-tool 1.0.0__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.
- mimosa_tool-1.0.0/.github/workflows/publish.yml +96 -0
- mimosa_tool-1.0.0/.github/workflows/test.yml +45 -0
- mimosa_tool-1.0.0/.gitignore +165 -0
- mimosa_tool-1.0.0/CMakeLists.txt +25 -0
- mimosa_tool-1.0.0/LICENSE +21 -0
- mimosa_tool-1.0.0/MANIFEST.in +16 -0
- mimosa_tool-1.0.0/PKG-INFO +432 -0
- mimosa_tool-1.0.0/README.md +405 -0
- mimosa_tool-1.0.0/examples/background.fa +502 -0
- mimosa_tool-1.0.0/examples/foreground.fa +200 -0
- mimosa_tool-1.0.0/examples/foxa2.hbcp +5 -0
- mimosa_tool-1.0.0/examples/foxa2.ihbcp +96 -0
- mimosa_tool-1.0.0/examples/foxa2.meme +24 -0
- mimosa_tool-1.0.0/examples/gata2.hbcp +5 -0
- mimosa_tool-1.0.0/examples/gata2.ihbcp +96 -0
- mimosa_tool-1.0.0/examples/gata2.meme +27 -0
- mimosa_tool-1.0.0/examples/gata4.hbcp +5 -0
- mimosa_tool-1.0.0/examples/gata4.ihbcp +96 -0
- mimosa_tool-1.0.0/examples/gata4.meme +25 -0
- mimosa_tool-1.0.0/examples/hist_pass +12 -0
- mimosa_tool-1.0.0/examples/myog.hbcp +5 -0
- mimosa_tool-1.0.0/examples/myog.ihbcp +84 -0
- mimosa_tool-1.0.0/examples/pif4.meme +21 -0
- mimosa_tool-1.0.0/examples/pif4.pfm +13 -0
- mimosa_tool-1.0.0/examples/prc_pass +321294 -0
- mimosa_tool-1.0.0/examples/res.txt +1 -0
- mimosa_tool-1.0.0/examples/run.ps1 +86 -0
- mimosa_tool-1.0.0/examples/run.sh +91 -0
- mimosa_tool-1.0.0/examples/scores_1.fasta +2000 -0
- mimosa_tool-1.0.0/examples/scores_2.fasta +2000 -0
- mimosa_tool-1.0.0/examples/sitega.mat +47 -0
- mimosa_tool-1.0.0/examples/sitega_gata2.mat +35 -0
- mimosa_tool-1.0.0/examples/sitega_stat6.mat +35 -0
- mimosa_tool-1.0.0/pyproject.toml +71 -0
- mimosa_tool-1.0.0/src/mimosa/__init__.py +46 -0
- mimosa_tool-1.0.0/src/mimosa/_core/__init__.py +17 -0
- mimosa_tool-1.0.0/src/mimosa/_core/bindings.cpp +28 -0
- mimosa_tool-1.0.0/src/mimosa/_core/core_functions.h +29 -0
- mimosa_tool-1.0.0/src/mimosa/_core/fasta_to_plain.h +182 -0
- mimosa_tool-1.0.0/src/mimosa/_core/mco_prc.cpp +1476 -0
- mimosa_tool-1.0.0/src/mimosa/_core/pfm_to_pwm.h +130 -0
- mimosa_tool-1.0.0/src/mimosa/cli.py +619 -0
- mimosa_tool-1.0.0/src/mimosa/comparison.py +1066 -0
- mimosa_tool-1.0.0/src/mimosa/execute.py +97 -0
- mimosa_tool-1.0.0/src/mimosa/functions.py +787 -0
- mimosa_tool-1.0.0/src/mimosa/io.py +522 -0
- mimosa_tool-1.0.0/src/mimosa/models.py +1161 -0
- mimosa_tool-1.0.0/src/mimosa/pipeline.py +402 -0
- mimosa_tool-1.0.0/src/mimosa/ragged.py +126 -0
- mimosa_tool-1.0.0/tests/__init__.py +5 -0
- mimosa_tool-1.0.0/tests/conftest.py +34 -0
- mimosa_tool-1.0.0/tests/fixtures/simple_pwm.meme +15 -0
- mimosa_tool-1.0.0/tests/fixtures/simple_pwm.pfm +5 -0
- mimosa_tool-1.0.0/tests/test_c_integration.py +78 -0
- mimosa_tool-1.0.0/tests/test_integration.py +296 -0
- mimosa_tool-1.0.0/tests/test_unit.py +297 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
name: Build & Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- v*
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build_wheels:
|
|
11
|
+
name: Build wheels on ${{ matrix.os }}
|
|
12
|
+
runs-on: ${{ matrix.os }}
|
|
13
|
+
strategy:
|
|
14
|
+
fail-fast: false
|
|
15
|
+
matrix:
|
|
16
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v6
|
|
20
|
+
|
|
21
|
+
- name: Install uv
|
|
22
|
+
uses: astral-sh/setup-uv@v7
|
|
23
|
+
with:
|
|
24
|
+
enable-cache: true
|
|
25
|
+
|
|
26
|
+
- name: Build wheels
|
|
27
|
+
env:
|
|
28
|
+
CIBW_BUILD_FRONTEND: "build[uv]"
|
|
29
|
+
CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-* cp314-*"
|
|
30
|
+
CIBW_SKIP: "*-musllinux_* *-manylinux_i686"
|
|
31
|
+
CIBW_ARCHS_LINUX: auto64
|
|
32
|
+
CIBW_ARCHS_MACOS: auto
|
|
33
|
+
CIBW_ARCHS_WINDOWS: AMD64
|
|
34
|
+
CIBW_TEST_REQUIRES: pytest
|
|
35
|
+
CIBW_TEST_COMMAND: "pytest {project}/tests"
|
|
36
|
+
run: uvx cibuildwheel --output-dir wheelhouse
|
|
37
|
+
|
|
38
|
+
- uses: actions/upload-artifact@v4
|
|
39
|
+
with:
|
|
40
|
+
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
|
|
41
|
+
path: ./wheelhouse/*.whl
|
|
42
|
+
|
|
43
|
+
build_sdist:
|
|
44
|
+
name: Build source distribution
|
|
45
|
+
runs-on: ubuntu-latest
|
|
46
|
+
steps:
|
|
47
|
+
- uses: actions/checkout@v6
|
|
48
|
+
|
|
49
|
+
- name: Install uv
|
|
50
|
+
uses: astral-sh/setup-uv@v7
|
|
51
|
+
with:
|
|
52
|
+
enable-cache: true
|
|
53
|
+
|
|
54
|
+
- name: Build sdist
|
|
55
|
+
run: uv build --sdist
|
|
56
|
+
|
|
57
|
+
- name: Test sdist installation
|
|
58
|
+
run: |
|
|
59
|
+
uv venv test_env
|
|
60
|
+
source test_env/bin/activate
|
|
61
|
+
uv pip install dist/*.tar.gz
|
|
62
|
+
uv pip install pytest numpy numba scipy pandas joblib
|
|
63
|
+
pytest tests
|
|
64
|
+
|
|
65
|
+
- uses: actions/upload-artifact@v4
|
|
66
|
+
with:
|
|
67
|
+
name: cibw-sdist
|
|
68
|
+
path: dist/*.tar.gz
|
|
69
|
+
|
|
70
|
+
publish:
|
|
71
|
+
name: Publish to PyPI
|
|
72
|
+
needs: [build_wheels, build_sdist]
|
|
73
|
+
runs-on: ubuntu-latest
|
|
74
|
+
environment:
|
|
75
|
+
name: pypi
|
|
76
|
+
url: https://pypi.org/p/mimosa-tool
|
|
77
|
+
permissions:
|
|
78
|
+
id-token: write
|
|
79
|
+
contents: read
|
|
80
|
+
steps:
|
|
81
|
+
- name: Download all artifacts
|
|
82
|
+
uses: actions/download-artifact@v4
|
|
83
|
+
with:
|
|
84
|
+
path: dist
|
|
85
|
+
merge-multiple: true
|
|
86
|
+
|
|
87
|
+
- name: Install uv
|
|
88
|
+
uses: astral-sh/setup-uv@v7
|
|
89
|
+
with:
|
|
90
|
+
enable-cache: true
|
|
91
|
+
|
|
92
|
+
- name: Check artifacts
|
|
93
|
+
run: uvx twine check dist/*
|
|
94
|
+
|
|
95
|
+
- name: Publish to PyPI
|
|
96
|
+
run: uv publish
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
name: Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, master]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main, master]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
lint:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v6
|
|
14
|
+
- uses: astral-sh/setup-uv@v7
|
|
15
|
+
- name: Lint with ruff
|
|
16
|
+
run: |
|
|
17
|
+
uv sync --group dev
|
|
18
|
+
uv run ruff check .
|
|
19
|
+
uv run ruff format --check .
|
|
20
|
+
|
|
21
|
+
test:
|
|
22
|
+
name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
|
|
23
|
+
runs-on: ${{ matrix.os }}
|
|
24
|
+
strategy:
|
|
25
|
+
matrix:
|
|
26
|
+
os: [ubuntu-latest]
|
|
27
|
+
python-version: ["3.12"]
|
|
28
|
+
steps:
|
|
29
|
+
- uses: actions/checkout@v6
|
|
30
|
+
- uses: astral-sh/setup-uv@v7
|
|
31
|
+
with:
|
|
32
|
+
python-version: ${{ matrix.python-version }}
|
|
33
|
+
- name: Install dependencies and build
|
|
34
|
+
run: uv sync --group dev
|
|
35
|
+
- name: Run pytest
|
|
36
|
+
run: uv run pytest
|
|
37
|
+
- name: Run examples
|
|
38
|
+
working-directory: examples
|
|
39
|
+
shell: bash
|
|
40
|
+
run: |
|
|
41
|
+
if [[ "$RUNNER_OS" == "Windows" ]]; then
|
|
42
|
+
uv run pwsh ./run.ps1
|
|
43
|
+
else
|
|
44
|
+
uv run bash run.sh
|
|
45
|
+
fi
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
################################################################################
|
|
2
|
+
# Git Ignore File for Modern Development Project
|
|
3
|
+
#
|
|
4
|
+
# This file contains rules to exclude common files and directories that should
|
|
5
|
+
# not be tracked by Git. It includes sections for OS-specific files, IDE files,
|
|
6
|
+
# dependencies, sensitive data, build artifacts, logs, and language-specific
|
|
7
|
+
# temporary files.
|
|
8
|
+
################################################################################
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
################################################################################
|
|
12
|
+
# Operating System Generated Files
|
|
13
|
+
################################################################################
|
|
14
|
+
# macOS
|
|
15
|
+
.DS_Store
|
|
16
|
+
.DS_Store?
|
|
17
|
+
._*
|
|
18
|
+
.Spotlight-V100
|
|
19
|
+
.Trashes
|
|
20
|
+
|
|
21
|
+
# Windows
|
|
22
|
+
Thumbs.db
|
|
23
|
+
ehthumbs.db
|
|
24
|
+
desktop.ini
|
|
25
|
+
|
|
26
|
+
################################################################################
|
|
27
|
+
# IDE Generated Files
|
|
28
|
+
################################################################################
|
|
29
|
+
# PyCharm/IntelliJ IDEA
|
|
30
|
+
.idea/
|
|
31
|
+
|
|
32
|
+
# Visual Studio Code
|
|
33
|
+
.vscode/
|
|
34
|
+
|
|
35
|
+
# Visual Studio
|
|
36
|
+
.vs/
|
|
37
|
+
|
|
38
|
+
# Vim
|
|
39
|
+
*.swp
|
|
40
|
+
*.swo
|
|
41
|
+
*~
|
|
42
|
+
|
|
43
|
+
# Emacs
|
|
44
|
+
*~
|
|
45
|
+
|
|
46
|
+
# Eclipse
|
|
47
|
+
.project
|
|
48
|
+
.settings/
|
|
49
|
+
.metadata
|
|
50
|
+
|
|
51
|
+
# Sublime Text
|
|
52
|
+
.sublime-workspace
|
|
53
|
+
.sublime-project
|
|
54
|
+
|
|
55
|
+
################################################################################
|
|
56
|
+
# Package Manager Folders & Dependencies
|
|
57
|
+
################################################################################
|
|
58
|
+
# Node.js
|
|
59
|
+
node_modules/
|
|
60
|
+
|
|
61
|
+
# PHP
|
|
62
|
+
vendor/
|
|
63
|
+
|
|
64
|
+
# Python
|
|
65
|
+
__pycache__/
|
|
66
|
+
*.py[cod]
|
|
67
|
+
*$py.class
|
|
68
|
+
*.so
|
|
69
|
+
.Python
|
|
70
|
+
env/
|
|
71
|
+
venv/
|
|
72
|
+
.venv/
|
|
73
|
+
ENV/
|
|
74
|
+
.ENV
|
|
75
|
+
.env
|
|
76
|
+
.env.local
|
|
77
|
+
.env.*.local
|
|
78
|
+
*.egg-info/
|
|
79
|
+
dist/
|
|
80
|
+
build/
|
|
81
|
+
*.egg
|
|
82
|
+
pip-log.txt
|
|
83
|
+
pip-delete-this-directory.txt
|
|
84
|
+
.cover
|
|
85
|
+
coverage.xml
|
|
86
|
+
*.cover
|
|
87
|
+
.hypothesis/
|
|
88
|
+
|
|
89
|
+
# Jupyter Notebook
|
|
90
|
+
.ipynb_checkpoints/
|
|
91
|
+
|
|
92
|
+
################################################################################
|
|
93
|
+
# Sensitive Data & Configuration
|
|
94
|
+
################################################################################
|
|
95
|
+
# Environment variables
|
|
96
|
+
.env
|
|
97
|
+
.env.local
|
|
98
|
+
.env.*.local
|
|
99
|
+
./uv.lock
|
|
100
|
+
uv.lock
|
|
101
|
+
.uv.lock
|
|
102
|
+
*.lock
|
|
103
|
+
|
|
104
|
+
# Certificate and security files
|
|
105
|
+
*.key
|
|
106
|
+
*.pem
|
|
107
|
+
*.p12
|
|
108
|
+
*.pfx
|
|
109
|
+
secrets.yml
|
|
110
|
+
credentials.json
|
|
111
|
+
*.secret
|
|
112
|
+
|
|
113
|
+
################################################################################
|
|
114
|
+
# Build Artifacts & Output Directories
|
|
115
|
+
################################################################################
|
|
116
|
+
# General build outputs
|
|
117
|
+
build/
|
|
118
|
+
dist/
|
|
119
|
+
target/
|
|
120
|
+
out/
|
|
121
|
+
bin/
|
|
122
|
+
obj/
|
|
123
|
+
|
|
124
|
+
# Compiled files
|
|
125
|
+
*.o
|
|
126
|
+
*.so
|
|
127
|
+
*.dylib
|
|
128
|
+
*.dll
|
|
129
|
+
*.exe
|
|
130
|
+
|
|
131
|
+
################################################################################
|
|
132
|
+
# Logs & Cache Files
|
|
133
|
+
################################################################################
|
|
134
|
+
# Log files
|
|
135
|
+
*.log
|
|
136
|
+
logs/
|
|
137
|
+
|
|
138
|
+
# Python caches
|
|
139
|
+
.pytest_cache/
|
|
140
|
+
.mypy_cache/
|
|
141
|
+
.tox/
|
|
142
|
+
.cache/
|
|
143
|
+
.ruff_cache
|
|
144
|
+
*.pyc
|
|
145
|
+
*.pyo
|
|
146
|
+
*.pyd
|
|
147
|
+
|
|
148
|
+
# Coverage reports
|
|
149
|
+
.coverage
|
|
150
|
+
htmlcov/
|
|
151
|
+
|
|
152
|
+
################################################################################
|
|
153
|
+
# C/C++ Specific Files
|
|
154
|
+
################################################################################
|
|
155
|
+
CMakeCache.txt
|
|
156
|
+
CMakeFiles/
|
|
157
|
+
cmake_install.cmake
|
|
158
|
+
Makefile
|
|
159
|
+
*.cmake
|
|
160
|
+
# Important: Don't ignore the main CMakeLists.txt file
|
|
161
|
+
!CMakeLists.txt
|
|
162
|
+
|
|
163
|
+
################################################################################
|
|
164
|
+
# End of .gitignore
|
|
165
|
+
################################################################################
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.15)
|
|
2
|
+
project(mimosa_core LANGUAGES CXX)
|
|
3
|
+
|
|
4
|
+
# Find Python components first
|
|
5
|
+
find_package(Python 3.10 COMPONENTS Interpreter Development.Module REQUIRED)
|
|
6
|
+
find_package(nanobind CONFIG REQUIRED)
|
|
7
|
+
|
|
8
|
+
# Define the extension module
|
|
9
|
+
# Note: Paths are relative to the project root where CMakeLists.txt resides
|
|
10
|
+
nanobind_add_module(_core
|
|
11
|
+
src/mimosa/_core/bindings.cpp
|
|
12
|
+
src/mimosa/_core/mco_prc.cpp
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
# Include directories
|
|
16
|
+
target_include_directories(_core PRIVATE src/mimosa/_core)
|
|
17
|
+
|
|
18
|
+
# Set C++ standard
|
|
19
|
+
target_compile_features(_core PUBLIC cxx_std_17)
|
|
20
|
+
|
|
21
|
+
# Enable docstrings in nanobind
|
|
22
|
+
target_compile_definitions(_core PRIVATE NB_DOC_STRINGS)
|
|
23
|
+
|
|
24
|
+
# Install the extension into the package directory
|
|
25
|
+
install(TARGETS _core LIBRARY DESTINATION mimosa/_core)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Anton Tsukanov
|
|
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,16 @@
|
|
|
1
|
+
include README.md
|
|
2
|
+
include LICENSE
|
|
3
|
+
include CHANGELOG.md
|
|
4
|
+
include CONTRIBUTING.md
|
|
5
|
+
include pyproject.toml
|
|
6
|
+
include CMakeLists.txt
|
|
7
|
+
|
|
8
|
+
recursive-include src/mimosa *.py
|
|
9
|
+
recursive-include src/mimosa/_core *.h
|
|
10
|
+
recursive-include src/mimosa/_core *.cpp
|
|
11
|
+
recursive-include examples *
|
|
12
|
+
|
|
13
|
+
global-exclude __pycache__
|
|
14
|
+
global-exclude *.py[cod]
|
|
15
|
+
global-exclude *~
|
|
16
|
+
global-exclude .DS_Store
|