migec 2.0.0a1__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 (135) hide show
  1. migec-2.0.0a1/.github/workflows/ci.yml +66 -0
  2. migec-2.0.0a1/.github/workflows/docs.yml +41 -0
  3. migec-2.0.0a1/.github/workflows/publish.yml +75 -0
  4. migec-2.0.0a1/.github/workflows/testpypi.yml +43 -0
  5. migec-2.0.0a1/.gitignore +36 -0
  6. migec-2.0.0a1/CHANGELOG.md +477 -0
  7. migec-2.0.0a1/CLAUDE.md +291 -0
  8. migec-2.0.0a1/CMakeLists.txt +67 -0
  9. migec-2.0.0a1/LICENSE +674 -0
  10. migec-2.0.0a1/PKG-INFO +419 -0
  11. migec-2.0.0a1/README.md +386 -0
  12. migec-2.0.0a1/ROADMAP.md +252 -0
  13. migec-2.0.0a1/SOURCES.md +177 -0
  14. migec-2.0.0a1/docs/Makefile +16 -0
  15. migec-2.0.0a1/docs/assemble.rst +149 -0
  16. migec-2.0.0a1/docs/barcode_space.rst +185 -0
  17. migec-2.0.0a1/docs/checkout.rst +233 -0
  18. migec-2.0.0a1/docs/conf.py +33 -0
  19. migec-2.0.0a1/docs/examples.rst +96 -0
  20. migec-2.0.0a1/docs/formats.rst +110 -0
  21. migec-2.0.0a1/docs/fragmented.rst +119 -0
  22. migec-2.0.0a1/docs/grouping.rst +91 -0
  23. migec-2.0.0a1/docs/index.rst +63 -0
  24. migec-2.0.0a1/docs/installation.rst +47 -0
  25. migec-2.0.0a1/docs/nulls.rst +337 -0
  26. migec-2.0.0a1/docs/performance.rst +162 -0
  27. migec-2.0.0a1/docs/quality_floor.rst +170 -0
  28. migec-2.0.0a1/docs/refine.rst +250 -0
  29. migec-2.0.0a1/docs/roadmap.rst +45 -0
  30. migec-2.0.0a1/docs/subsample.rst +59 -0
  31. migec-2.0.0a1/docs/suggest.rst +68 -0
  32. migec-2.0.0a1/docs/umi_statistics.rst +165 -0
  33. migec-2.0.0a1/docs/validation.rst +93 -0
  34. migec-2.0.0a1/include/migec/assemble.hpp +92 -0
  35. migec-2.0.0a1/include/migec/checkout.hpp +227 -0
  36. migec-2.0.0a1/include/migec/consensus.hpp +105 -0
  37. migec-2.0.0a1/include/migec/fastq.hpp +60 -0
  38. migec-2.0.0a1/include/migec/mig_record.hpp +152 -0
  39. migec-2.0.0a1/include/migec/pattern.hpp +159 -0
  40. migec-2.0.0a1/include/migec/refine.hpp +107 -0
  41. migec-2.0.0a1/include/migec/resource.hpp +32 -0
  42. migec-2.0.0a1/include/migec/subsample.hpp +65 -0
  43. migec-2.0.0a1/include/migec/suggest.hpp +89 -0
  44. migec-2.0.0a1/include/migec/types.hpp +146 -0
  45. migec-2.0.0a1/include/migec/umi_stats.hpp +326 -0
  46. migec-2.0.0a1/include/migec/version.hpp +9 -0
  47. migec-2.0.0a1/include/migec/whitelist.hpp +93 -0
  48. migec-2.0.0a1/integrations/nextflow/migec/README.md +93 -0
  49. migec-2.0.0a1/integrations/nextflow/migec/environment.yml +10 -0
  50. migec-2.0.0a1/integrations/nextflow/migec/main.nf +102 -0
  51. migec-2.0.0a1/integrations/nextflow/migec/meta.yml +111 -0
  52. migec-2.0.0a1/integrations/nextflow/migec/nextflow.config +79 -0
  53. migec-2.0.0a1/integrations/nextflow/migec/test_on_aldan3.sbatch +111 -0
  54. migec-2.0.0a1/notebooks/barcode_space.py +246 -0
  55. migec-2.0.0a1/notebooks/platforms.py +310 -0
  56. migec-2.0.0a1/notebooks/refine_diagnostics.py +236 -0
  57. migec-2.0.0a1/project/README.md +37 -0
  58. migec-2.0.0a1/project/design-assemble.md +264 -0
  59. migec-2.0.0a1/project/design-benchmarks.md +381 -0
  60. migec-2.0.0a1/project/design-checkout.md +328 -0
  61. migec-2.0.0a1/project/design-io-interop.md +389 -0
  62. migec-2.0.0a1/project/design-refine.md +370 -0
  63. migec-2.0.0a1/project/design-repo.md +719 -0
  64. migec-2.0.0a1/project/review-algorithms.md +246 -0
  65. migec-2.0.0a1/project/review-scope.md +189 -0
  66. migec-2.0.0a1/pyproject.toml +66 -0
  67. migec-2.0.0a1/python/migec/__init__.py +40 -0
  68. migec-2.0.0a1/python/migec/assemble.py +137 -0
  69. migec-2.0.0a1/python/migec/checkout.py +319 -0
  70. migec-2.0.0a1/python/migec/cli.py +331 -0
  71. migec-2.0.0a1/python/migec/refine.py +178 -0
  72. migec-2.0.0a1/python/migec/sheet.py +151 -0
  73. migec-2.0.0a1/python/migec/subsample.py +51 -0
  74. migec-2.0.0a1/python/migec/suggest.py +100 -0
  75. migec-2.0.0a1/scripts/collision_check.py +161 -0
  76. migec-2.0.0a1/scripts/compare_calib.py +178 -0
  77. migec-2.0.0a1/scripts/correction_accuracy.py +151 -0
  78. migec-2.0.0a1/scripts/diagnose.py +405 -0
  79. migec-2.0.0a1/scripts/permutation_nulls.py +537 -0
  80. migec-2.0.0a1/scripts/quality_floor.py +359 -0
  81. migec-2.0.0a1/scripts/read_start_dispersion.py +187 -0
  82. migec-2.0.0a1/scripts/spikein_ratio.py +202 -0
  83. migec-2.0.0a1/setup.sh +31 -0
  84. migec-2.0.0a1/skills/migec/SKILL.md +317 -0
  85. migec-2.0.0a1/src/_bindings.cpp +797 -0
  86. migec-2.0.0a1/src/assemble.cpp +296 -0
  87. migec-2.0.0a1/src/checkout.cpp +667 -0
  88. migec-2.0.0a1/src/consensus.cpp +419 -0
  89. migec-2.0.0a1/src/fastq.cpp +226 -0
  90. migec-2.0.0a1/src/mig_record.cpp +342 -0
  91. migec-2.0.0a1/src/pattern.cpp +331 -0
  92. migec-2.0.0a1/src/refine.cpp +643 -0
  93. migec-2.0.0a1/src/resource.cpp +26 -0
  94. migec-2.0.0a1/src/subsample.cpp +73 -0
  95. migec-2.0.0a1/src/suggest.cpp +194 -0
  96. migec-2.0.0a1/src/types.cpp +56 -0
  97. migec-2.0.0a1/src/umi_stats.cpp +654 -0
  98. migec-2.0.0a1/src/whitelist.cpp +131 -0
  99. migec-2.0.0a1/tests/__init__.py +0 -0
  100. migec-2.0.0a1/tests/benchmark/__init__.py +0 -0
  101. migec-2.0.0a1/tests/benchmark/test_assemble_speed.py +198 -0
  102. migec-2.0.0a1/tests/benchmark/test_checkout_speed.py +144 -0
  103. migec-2.0.0a1/tests/benchmark/test_refine_speed.py +154 -0
  104. migec-2.0.0a1/tests/conftest.py +31 -0
  105. migec-2.0.0a1/tests/cpp/doctest.h +7106 -0
  106. migec-2.0.0a1/tests/cpp/test_checkout.cpp +187 -0
  107. migec-2.0.0a1/tests/cpp/test_checkout_run.cpp +301 -0
  108. migec-2.0.0a1/tests/cpp/test_consensus.cpp +257 -0
  109. migec-2.0.0a1/tests/cpp/test_fastq.cpp +151 -0
  110. migec-2.0.0a1/tests/cpp/test_mig_record.cpp +231 -0
  111. migec-2.0.0a1/tests/cpp/test_pattern.cpp +273 -0
  112. migec-2.0.0a1/tests/cpp/test_types.cpp +78 -0
  113. migec-2.0.0a1/tests/cpp/test_umi_stats.cpp +492 -0
  114. migec-2.0.0a1/tests/cpp/test_whitelist.cpp +130 -0
  115. migec-2.0.0a1/tests/data/migec_spikein_truth.tsv +4 -0
  116. migec-2.0.0a1/tests/realworld/__init__.py +0 -0
  117. migec-2.0.0a1/tests/synthetic/__init__.py +0 -0
  118. migec-2.0.0a1/tests/synthetic/_sim.py +200 -0
  119. migec-2.0.0a1/tests/synthetic/test_assemble.py +312 -0
  120. migec-2.0.0a1/tests/synthetic/test_barcode_space.py +149 -0
  121. migec-2.0.0a1/tests/synthetic/test_checkout_end_to_end.py +260 -0
  122. migec-2.0.0a1/tests/synthetic/test_dual_end.py +129 -0
  123. migec-2.0.0a1/tests/synthetic/test_grouping_accuracy.py +86 -0
  124. migec-2.0.0a1/tests/synthetic/test_nulls.py +234 -0
  125. migec-2.0.0a1/tests/synthetic/test_quality_floor.py +140 -0
  126. migec-2.0.0a1/tests/synthetic/test_refine.py +476 -0
  127. migec-2.0.0a1/tests/synthetic/test_sim.py +91 -0
  128. migec-2.0.0a1/tests/synthetic/test_subsample.py +148 -0
  129. migec-2.0.0a1/tests/synthetic/test_suggest.py +120 -0
  130. migec-2.0.0a1/tests/unit/__init__.py +0 -0
  131. migec-2.0.0a1/tests/unit/test_bindings.py +97 -0
  132. migec-2.0.0a1/tests/unit/test_compare_calib.py +81 -0
  133. migec-2.0.0a1/tests/unit/test_core.py +76 -0
  134. migec-2.0.0a1/tests/unit/test_sheet_and_cli.py +263 -0
  135. migec-2.0.0a1/tests/unit/test_spikein_ratio.py +105 -0
@@ -0,0 +1,66 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+ workflow_dispatch:
8
+
9
+ concurrency:
10
+ group: ci-${{ github.ref }}
11
+ cancel-in-progress: true
12
+
13
+ jobs:
14
+ cpp:
15
+ name: C++ (${{ matrix.os }})
16
+ runs-on: ${{ matrix.os }}
17
+ strategy:
18
+ fail-fast: false
19
+ matrix:
20
+ os: [ubuntu-latest, macos-latest]
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+ - name: Configure
24
+ run: cmake -S . -B build -DMIGEC_TESTS=ON -DCMAKE_BUILD_TYPE=Release
25
+ - name: Build
26
+ run: cmake --build build --parallel
27
+ - name: Test
28
+ run: ctest --test-dir build --output-on-failure
29
+
30
+ python:
31
+ name: Python ${{ matrix.python-version }} (${{ matrix.os }})
32
+ runs-on: ${{ matrix.os }}
33
+ strategy:
34
+ fail-fast: false
35
+ matrix:
36
+ os: [ubuntu-latest, macos-latest]
37
+ python-version: ["3.10", "3.12"]
38
+ steps:
39
+ - uses: actions/checkout@v4
40
+ - uses: actions/setup-python@v5
41
+ with:
42
+ python-version: ${{ matrix.python-version }}
43
+ - uses: astral-sh/setup-uv@v5
44
+ - name: Install
45
+ run: |
46
+ uv pip install --system scikit-build-core "pybind11>=3.0.2,<4" ninja cmake
47
+ uv pip install --system -e ".[test]" --no-build-isolation
48
+ - name: Show environment
49
+ # Prints all three versions, so the "kept in sync by hand" trio is visible on every run
50
+ # rather than at release time.
51
+ run: |
52
+ python -c "import migec, migec._core as c; print(migec.__version__, c.__version__, c.MIG_FORMAT_VERSION)"
53
+ - name: Test
54
+ run: python -m pytest tests/unit tests/synthetic -q
55
+
56
+ lint:
57
+ runs-on: ubuntu-latest
58
+ steps:
59
+ - uses: actions/checkout@v4
60
+ - uses: actions/setup-python@v5
61
+ with:
62
+ python-version: "3.12"
63
+ # Pinned: ruff's default rule set widens between releases, which turns a green local run
64
+ # into a red CI on an unrelated change.
65
+ - run: pip install ruff==0.15.9
66
+ - run: ruff check python/ tests/
@@ -0,0 +1,41 @@
1
+ name: Docs
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+ pages: write
11
+ id-token: write
12
+
13
+ concurrency:
14
+ group: pages
15
+ cancel-in-progress: false
16
+
17
+ jobs:
18
+ build:
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+ - uses: actions/setup-python@v5
23
+ with:
24
+ python-version: "3.12"
25
+ - run: pip install sphinx pydata-sphinx-theme
26
+ # -W: a warning is a broken cross-reference or a malformed table, and both render as
27
+ # silently wrong docs. Zero warnings, no exceptions.
28
+ - run: sphinx-build -W --keep-going -b html docs docs/_build/html
29
+ - uses: actions/upload-pages-artifact@v3
30
+ with:
31
+ path: docs/_build/html
32
+
33
+ deploy:
34
+ needs: build
35
+ runs-on: ubuntu-latest
36
+ environment:
37
+ name: github-pages
38
+ url: ${{ steps.deployment.outputs.page_url }}
39
+ steps:
40
+ - id: deployment
41
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,75 @@
1
+ name: Publish To PyPI
2
+
3
+ # The PyPI trusted publisher for `migec` is configured against THIS filename and the `pypi`
4
+ # environment below. Renaming either breaks publishing with an opaque OIDC error.
5
+ on:
6
+ release:
7
+ types: [published]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ build-sdist:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: actions/setup-python@v5
18
+ with:
19
+ python-version: "3.12"
20
+ - run: pip install build twine
21
+ - run: python -m build --sdist
22
+ - run: twine check dist/*
23
+ - uses: actions/upload-artifact@v4
24
+ with:
25
+ name: python-sdist
26
+ path: dist/*.tar.gz
27
+
28
+ build-wheels:
29
+ name: Wheels on ${{ matrix.os }}
30
+ runs-on: ${{ matrix.os }}
31
+ strategy:
32
+ fail-fast: false
33
+ matrix:
34
+ # No Windows: this is a pipeline tool, and a Windows wheel would need a zlib we do not
35
+ # otherwise depend on. Source builds still configure there.
36
+ os: [ubuntu-latest, macos-latest]
37
+ steps:
38
+ - uses: actions/checkout@v4
39
+ - uses: pypa/cibuildwheel@v2.23.3
40
+ env:
41
+ CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-*"
42
+ CIBW_SKIP: "*-musllinux_* *-manylinux_i686"
43
+ CIBW_TEST_COMMAND: "python -c \"import migec; print(migec.__version__)\""
44
+ - uses: actions/upload-artifact@v4
45
+ with:
46
+ name: python-wheels-${{ matrix.os }}
47
+ path: wheelhouse/*.whl
48
+
49
+ publish:
50
+ name: Publish To PyPI
51
+ needs: [build-sdist, build-wheels]
52
+ runs-on: ubuntu-latest
53
+ environment: pypi
54
+ permissions:
55
+ contents: read
56
+ id-token: write # required for OIDC trusted publishing
57
+ steps:
58
+ - uses: actions/checkout@v4
59
+ - uses: actions/download-artifact@v4
60
+ with:
61
+ path: dist
62
+ merge-multiple: true
63
+ - name: Validate package version matches release tag
64
+ run: |
65
+ python - <<'PY'
66
+ import os, re, sys, tomllib
67
+ with open("pyproject.toml", "rb") as fh:
68
+ version = tomllib.load(fh)["project"]["version"]
69
+ tag = os.environ["GITHUB_REF_NAME"].lstrip("v")
70
+ if version != tag:
71
+ sys.exit(f"pyproject version {version} != release tag {tag}")
72
+ print(f"version {version} matches tag")
73
+ PY
74
+ - run: ls -la dist
75
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,43 @@
1
+ name: Publish To TestPyPI
2
+
3
+ # Manual dry run of publish.yml. Same build, different index.
4
+ on:
5
+ workflow_dispatch:
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ build:
12
+ name: Wheels on ${{ matrix.os }}
13
+ runs-on: ${{ matrix.os }}
14
+ strategy:
15
+ matrix:
16
+ os: [ubuntu-latest, macos-latest]
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - uses: pypa/cibuildwheel@v2.23.3
20
+ env:
21
+ CIBW_BUILD: "cp312-*"
22
+ CIBW_SKIP: "*-musllinux_* *-manylinux_i686"
23
+ CIBW_TEST_COMMAND: "python -c \"import migec\""
24
+ - uses: actions/upload-artifact@v4
25
+ with:
26
+ name: testpypi-wheels-${{ matrix.os }}
27
+ path: wheelhouse/*.whl
28
+
29
+ publish:
30
+ needs: build
31
+ runs-on: ubuntu-latest
32
+ environment: testpypi
33
+ permissions:
34
+ contents: read
35
+ id-token: write
36
+ steps:
37
+ - uses: actions/download-artifact@v4
38
+ with:
39
+ path: dist
40
+ merge-multiple: true
41
+ - uses: pypa/gh-action-pypi-publish@release/v1
42
+ with:
43
+ repository-url: https://test.pypi.org/legacy/
@@ -0,0 +1,36 @@
1
+ # --- migec-specific ---
2
+ # NB: .gitignore has no trailing comments -- the whole line is the pattern, so a comment after a
3
+ # pattern silently makes it match nothing. Comments go on their own line.
4
+
5
+ # cmake out-of-tree build, and scikit-build-core's build/{wheel_tag}
6
+ build/
7
+ # setup.sh creates this
8
+ .venv/
9
+ # intermediate record files; regenerate with `migec checkout`
10
+ *.mig
11
+ *.pumi
12
+ # local experiments, never committed
13
+ scratch/
14
+
15
+ # --- python ---
16
+ __pycache__/
17
+ *.py[cod]
18
+ *.egg-info/
19
+ dist/
20
+ .pytest_cache/
21
+ .ruff_cache/
22
+ .coverage
23
+ htmlcov/
24
+
25
+ # --- docs ---
26
+ docs/_build/
27
+
28
+ # --- os ---
29
+ .DS_Store
30
+
31
+ # Alignment indices pulled down by scripts/read_start_dispersion.py (X1). pysam writes the .bai
32
+ # next to wherever it is pointed, which for an HTTP URL is the working directory -- 4.6 MB of it
33
+ # reached a published sdist before this line existed.
34
+ *.bam
35
+ *.bai
36
+ *.crai