leopard-em 0.0.2a0__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 (67) hide show
  1. leopard_em-0.0.2a0/.copier-answers.yml +11 -0
  2. leopard_em-0.0.2a0/.github/ISSUE_TEMPLATE.md +15 -0
  3. leopard_em-0.0.2a0/.github/TEST_FAIL_TEMPLATE.md +12 -0
  4. leopard_em-0.0.2a0/.github/dependabot.yml +10 -0
  5. leopard_em-0.0.2a0/.github/workflows/ci.yml +108 -0
  6. leopard_em-0.0.2a0/.github/workflows/python-publish.yml +108 -0
  7. leopard_em-0.0.2a0/.gitignore +120 -0
  8. leopard_em-0.0.2a0/.pre-commit-config.yaml +39 -0
  9. leopard_em-0.0.2a0/LICENSE +28 -0
  10. leopard_em-0.0.2a0/PKG-INFO +135 -0
  11. leopard_em-0.0.2a0/README.md +87 -0
  12. leopard_em-0.0.2a0/_typos.toml +2 -0
  13. leopard_em-0.0.2a0/docs/LICENSE +28 -0
  14. leopard_em-0.0.2a0/docs/data_formats.md +108 -0
  15. leopard_em-0.0.2a0/docs/examples/basic_configuration.ipynb +838 -0
  16. leopard_em-0.0.2a0/docs/examples/dummy_micrograph.mrc +0 -0
  17. leopard_em-0.0.2a0/docs/examples/dummy_template_volume.mrc +0 -0
  18. leopard_em-0.0.2a0/docs/examples/match_template_manager_example.yaml +71 -0
  19. leopard_em-0.0.2a0/docs/examples/optics_group_example.yaml +18 -0
  20. leopard_em-0.0.2a0/docs/index.md +168 -0
  21. leopard_em-0.0.2a0/docs/static/correlation_modes.svg +1 -0
  22. leopard_em-0.0.2a0/examples/02-extract_peak_info.ipynb +761 -0
  23. leopard_em-0.0.2a0/examples/README.md +4 -0
  24. leopard_em-0.0.2a0/examples/dummy_micrograph.mrc +0 -0
  25. leopard_em-0.0.2a0/examples/dummy_volume.mrc +0 -0
  26. leopard_em-0.0.2a0/examples/match_template_manager_example.yaml +76 -0
  27. leopard_em-0.0.2a0/examples/optics_group_example.yaml +18 -0
  28. leopard_em-0.0.2a0/match_template_example_config.yaml +52 -0
  29. leopard_em-0.0.2a0/mkdocs.yml +20 -0
  30. leopard_em-0.0.2a0/pyproject.toml +168 -0
  31. leopard_em-0.0.2a0/refine_template_example_config.yaml +34 -0
  32. leopard_em-0.0.2a0/src/leopard_em/__init__.py +11 -0
  33. leopard_em-0.0.2a0/src/leopard_em/analysis/__init__.py +1 -0
  34. leopard_em-0.0.2a0/src/leopard_em/analysis/pick_match_template_peaks.py +214 -0
  35. leopard_em-0.0.2a0/src/leopard_em/backend/__init__.py +10 -0
  36. leopard_em-0.0.2a0/src/leopard_em/backend/core_match_template.py +553 -0
  37. leopard_em-0.0.2a0/src/leopard_em/backend/core_refine_template.py +429 -0
  38. leopard_em-0.0.2a0/src/leopard_em/backend/process_results.py +179 -0
  39. leopard_em-0.0.2a0/src/leopard_em/backend/utils.py +163 -0
  40. leopard_em-0.0.2a0/src/leopard_em/pydantic_models/__init__.py +36 -0
  41. leopard_em-0.0.2a0/src/leopard_em/pydantic_models/computational_config.py +60 -0
  42. leopard_em-0.0.2a0/src/leopard_em/pydantic_models/correlation_filters.py +412 -0
  43. leopard_em-0.0.2a0/src/leopard_em/pydantic_models/defocus_search.py +72 -0
  44. leopard_em-0.0.2a0/src/leopard_em/pydantic_models/formats.py +88 -0
  45. leopard_em-0.0.2a0/src/leopard_em/pydantic_models/match_template_manager.py +411 -0
  46. leopard_em-0.0.2a0/src/leopard_em/pydantic_models/match_template_result.py +339 -0
  47. leopard_em-0.0.2a0/src/leopard_em/pydantic_models/optics_group.py +91 -0
  48. leopard_em-0.0.2a0/src/leopard_em/pydantic_models/orientation_search.py +163 -0
  49. leopard_em-0.0.2a0/src/leopard_em/pydantic_models/particle_stack.py +305 -0
  50. leopard_em-0.0.2a0/src/leopard_em/pydantic_models/refine_template_manager.py +288 -0
  51. leopard_em-0.0.2a0/src/leopard_em/pydantic_models/types.py +116 -0
  52. leopard_em-0.0.2a0/src/leopard_em/utils/cross_correlation.py +331 -0
  53. leopard_em-0.0.2a0/src/leopard_em/utils/data_io.py +154 -0
  54. leopard_em-0.0.2a0/src/leopard_em/utils/fourier_slice.py +135 -0
  55. leopard_em-0.0.2a0/src/leopard_em/utils/particle_stack.py +160 -0
  56. leopard_em-0.0.2a0/src/leopard_em/utils/pre_processing.py +134 -0
  57. leopard_em-0.0.2a0/src/programs/match_template.py +5 -0
  58. leopard_em-0.0.2a0/src/programs/refine_template.py +5 -0
  59. leopard_em-0.0.2a0/tests/data/test_image.mrc +0 -0
  60. leopard_em-0.0.2a0/tests/data/test_volume.mrc +0 -0
  61. leopard_em-0.0.2a0/tests/pydantic_models/test_computational_config.py +70 -0
  62. leopard_em-0.0.2a0/tests/pydantic_models/test_correlation_filters.py +86 -0
  63. leopard_em-0.0.2a0/tests/pydantic_models/test_defocus_search.py +67 -0
  64. leopard_em-0.0.2a0/tests/pydantic_models/test_optics_group.py +114 -0
  65. leopard_em-0.0.2a0/tests/pydantic_models/test_orientation_search.py +92 -0
  66. leopard_em-0.0.2a0/tests/utils/test_data_io.py +98 -0
  67. leopard_em-0.0.2a0/todo.md +53 -0
@@ -0,0 +1,11 @@
1
+ # Do not edit - changes here will be overwritten by Copier
2
+ _commit: v1
3
+ _src_path: gh:pydev-guide/pyrepo-copier
4
+ author_email: jdickerson@berkeley.edu
5
+ author_name: Josh Dickerson
6
+ github_username: jdickerson95
7
+ mode: tooling
8
+ module_name: tt2dtm
9
+ project_name: tt2DTM
10
+ project_short_description: 2DTM in pyTorch
11
+
@@ -0,0 +1,15 @@
1
+ * Leopard-EM version:
2
+ * Python version:
3
+ * Operating System:
4
+
5
+ ### Description
6
+
7
+ Describe what you were trying to get done.
8
+ Tell us what happened, what went wrong, and what you expected to happen.
9
+
10
+ ### What I Did
11
+
12
+ ```
13
+ Paste the command(s) you ran and the output.
14
+ If there was a crash, please include the traceback here.
15
+ ```
@@ -0,0 +1,12 @@
1
+ ---
2
+ title: "{{ env.TITLE }}"
3
+ labels: [bug]
4
+ ---
5
+ The {{ workflow }} workflow failed on {{ date | date("YYYY-MM-DD HH:mm") }} UTC
6
+
7
+ The most recent failing test was on {{ env.PLATFORM }} py{{ env.PYTHON }}
8
+ with commit: {{ sha }}
9
+
10
+ Full run: https://github.com/{{ repo }}/actions/runs/{{ env.RUN_ID }}
11
+
12
+ (This post will be updated if another test fails, as long as this issue remains open.)
@@ -0,0 +1,10 @@
1
+ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
2
+
3
+ version: 2
4
+ updates:
5
+ - package-ecosystem: "github-actions"
6
+ directory: "/"
7
+ schedule:
8
+ interval: "weekly"
9
+ commit-message:
10
+ prefix: "ci(dependabot):"
@@ -0,0 +1,108 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ tags:
8
+ - "v*"
9
+ pull_request:
10
+ workflow_dispatch:
11
+ schedule:
12
+ # run every week (for --pre release tests)
13
+ - cron: "0 0 * * 0"
14
+
15
+ # cancel in-progress runs that use the same workflow and branch
16
+ concurrency:
17
+ group: ${{ github.workflow }}-${{ github.ref }}
18
+ cancel-in-progress: true
19
+
20
+ jobs:
21
+ check-manifest:
22
+ # check-manifest is a tool that checks that all files in version control are
23
+ # included in the sdist (unless explicitly excluded)
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - uses: actions/checkout@v4
27
+ - run: pipx run check-manifest
28
+
29
+ test:
30
+ name: ${{ matrix.platform }} (${{ matrix.python-version }})
31
+ runs-on: ${{ matrix.platform }}
32
+ strategy:
33
+ fail-fast: false
34
+ matrix:
35
+ python-version: ["3.9", "3.10", "3.11", "3.12""]
36
+ platform: [ubuntu-latest, macos-latest, windows-latest]
37
+
38
+ steps:
39
+ - uses: actions/checkout@v4
40
+
41
+ - name: 🐍 Set up Python ${{ matrix.python-version }}
42
+ uses: actions/setup-python@v5
43
+ with:
44
+ python-version: ${{ matrix.python-version }}
45
+ cache-dependency-path: "pyproject.toml"
46
+ cache: "pip"
47
+
48
+ - name: Install Dependencies
49
+ run: |
50
+ python -m pip install -U pip
51
+ # if running a cron job, we add the --pre flag to test against pre-releases
52
+ python -m pip install .[test] ${{ github.event_name == 'schedule' && '--pre' || '' }}
53
+
54
+ - name: 🧪 Run Tests
55
+ run: pytest --color=yes --cov --cov-report=xml --cov-report=term-missing
56
+
57
+ # If something goes wrong with --pre tests, we can open an issue in the repo
58
+ - name: 📝 Report --pre Failures
59
+ if: failure() && github.event_name == 'schedule'
60
+ uses: JasonEtco/create-an-issue@v2
61
+ env:
62
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63
+ PLATFORM: ${{ matrix.platform }}
64
+ PYTHON: ${{ matrix.python-version }}
65
+ RUN_ID: ${{ github.run_id }}
66
+ TITLE: "[test-bot] pip install --pre is failing"
67
+ with:
68
+ filename: .github/TEST_FAIL_TEMPLATE.md
69
+ update_existing: true
70
+
71
+ - name: Coverage
72
+ uses: codecov/codecov-action@v3
73
+
74
+ deploy:
75
+ name: Deploy
76
+ needs: test
77
+ if: success() && startsWith(github.ref, 'refs/tags/') && github.event_name != 'schedule'
78
+ runs-on: ubuntu-latest
79
+
80
+ permissions:
81
+ # IMPORTANT: this permission is mandatory for trusted publishing on PyPi
82
+ # see https://docs.pypi.org/trusted-publishers/
83
+ id-token: write
84
+ # This permission allows writing releases
85
+ contents: write
86
+
87
+ steps:
88
+ - uses: actions/checkout@v4
89
+ with:
90
+ fetch-depth: 0
91
+
92
+ - name: 🐍 Set up Python
93
+ uses: actions/setup-python@v5
94
+ with:
95
+ python-version: "3.x"
96
+
97
+ - name: 👷 Build
98
+ run: |
99
+ python -m pip install build
100
+ python -m build
101
+
102
+ - name: 🚢 Publish to PyPI
103
+ uses: pypa/gh-action-pypi-publish@release/v1
104
+
105
+ - uses: softprops/action-gh-release@v2
106
+ with:
107
+ generate_release_notes: true
108
+ files: './dist/*'
@@ -0,0 +1,108 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ tags:
8
+ - "v*"
9
+ pull_request:
10
+ workflow_dispatch:
11
+ schedule:
12
+ # run every week (for --pre release tests)
13
+ - cron: "0 0 * * 0"
14
+
15
+ # cancel in-progress runs that use the same workflow and branch
16
+ concurrency:
17
+ group: ${{ github.workflow }}-${{ github.ref }}
18
+ cancel-in-progress: true
19
+
20
+ jobs:
21
+ check-manifest:
22
+ # check-manifest is a tool that checks that all files in version control are
23
+ # included in the sdist (unless explicitly excluded)
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - uses: actions/checkout@v4
27
+ - run: pipx run check-manifest
28
+
29
+ test:
30
+ name: ${{ matrix.platform }} (${{ matrix.python-version }})
31
+ runs-on: ${{ matrix.platform }}
32
+ strategy:
33
+ fail-fast: false
34
+ matrix:
35
+ python-version: ["3.10", "3.11", "3.12"]
36
+ platform: [ubuntu-latest, macos-latest]
37
+
38
+ steps:
39
+ - uses: actions/checkout@v4
40
+
41
+ - name: 🐍 Set up Python ${{ matrix.python-version }}
42
+ uses: actions/setup-python@v5
43
+ with:
44
+ python-version: ${{ matrix.python-version }}
45
+ cache-dependency-path: "pyproject.toml"
46
+ cache: "pip"
47
+
48
+ - name: Install Dependencies
49
+ run: |
50
+ python -m pip install -U pip
51
+ # if running a cron job, we add the --pre flag to test against pre-releases
52
+ python -m pip install .[test] ${{ github.event_name == 'schedule' && '--pre' || '' }}
53
+
54
+ - name: 🧪 Run Tests
55
+ run: pytest --color=yes --cov --cov-report=xml --cov-report=term-missing
56
+
57
+ # If something goes wrong with --pre tests, we can open an issue in the repo
58
+ - name: 📝 Report --pre Failures
59
+ if: failure() && github.event_name == 'schedule'
60
+ uses: JasonEtco/create-an-issue@v2
61
+ env:
62
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63
+ PLATFORM: ${{ matrix.platform }}
64
+ PYTHON: ${{ matrix.python-version }}
65
+ RUN_ID: ${{ github.run_id }}
66
+ TITLE: "[test-bot] pip install --pre is failing"
67
+ with:
68
+ filename: .github/TEST_FAIL_TEMPLATE.md
69
+ update_existing: true
70
+
71
+ - name: Coverage
72
+ uses: codecov/codecov-action@v5
73
+
74
+ deploy:
75
+ name: Deploy
76
+ needs: test
77
+ if: success() && startsWith(github.ref, 'refs/tags/') && github.event_name != 'schedule'
78
+ runs-on: ubuntu-latest
79
+
80
+ permissions:
81
+ # IMPORTANT: this permission is mandatory for trusted publishing on PyPi
82
+ # see https://docs.pypi.org/trusted-publishers/
83
+ id-token: write
84
+ # This permission allows writing releases
85
+ contents: write
86
+
87
+ steps:
88
+ - uses: actions/checkout@v4
89
+ with:
90
+ fetch-depth: 0
91
+
92
+ - name: 🐍 Set up Python
93
+ uses: actions/setup-python@v5
94
+ with:
95
+ python-version: "3.x"
96
+
97
+ - name: 👷 Build
98
+ run: |
99
+ python -m pip install build
100
+ python -m build
101
+
102
+ - name: 🚢 Publish to PyPI
103
+ uses: pypa/gh-action-pypi-publish@release/v1
104
+
105
+ - uses: softprops/action-gh-release@v2
106
+ with:
107
+ generate_release_notes: true
108
+ files: './dist/*'
@@ -0,0 +1,120 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ env/
12
+ build/
13
+ develop-eggs/
14
+ dist/
15
+ downloads/
16
+ eggs/
17
+ .eggs/
18
+ lib/
19
+ lib64/
20
+ parts/
21
+ sdist/
22
+ var/
23
+ wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+
28
+ .DS_Store
29
+
30
+ # PyInstaller
31
+ # Usually these files are written by a python script from a template
32
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
33
+ *.manifest
34
+ *.spec
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+
40
+ # Unit test / coverage reports
41
+ htmlcov/
42
+ .tox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ .hypothesis/
50
+ .pytest_cache/
51
+
52
+ # Translations
53
+ *.mo
54
+ *.pot
55
+
56
+ # Django stuff:
57
+ *.log
58
+ local_settings.py
59
+
60
+ # Flask stuff:
61
+ instance/
62
+ .webassets-cache
63
+
64
+ # Scrapy stuff:
65
+ .scrapy
66
+
67
+ # Sphinx documentation
68
+ docs/_build/
69
+
70
+ # PyBuilder
71
+ target/
72
+
73
+ # Jupyter Notebook
74
+ .ipynb_checkpoints
75
+
76
+ # pyenv
77
+ .python-version
78
+
79
+ # celery beat schedule file
80
+ celerybeat-schedule
81
+
82
+ # SageMath parsed files
83
+ *.sage.py
84
+
85
+ # dotenv
86
+ .env
87
+
88
+ # virtualenv
89
+ .venv
90
+ venv/
91
+ ENV/
92
+
93
+ # Spyder project settings
94
+ .spyderproject
95
+ .spyproject
96
+
97
+ # Rope project settings
98
+ .ropeproject
99
+
100
+ # mkdocs documentation
101
+ /site
102
+
103
+ # mypy
104
+ .mypy_cache/
105
+
106
+ # ruff
107
+ .ruff_cache/
108
+
109
+ # IDE settings
110
+ .vscode/
111
+ .idea/
112
+
113
+ # Temporary files
114
+ *.tmp
115
+
116
+
117
+ small_image_test_data/
118
+ medium_image_test_data/
119
+ large_image_test_data/
120
+ scratch_files/
@@ -0,0 +1,39 @@
1
+ # enable pre-commit.ci at https://pre-commit.ci/
2
+ # it adds:
3
+ # 1. auto fixing pull requests
4
+ # 2. auto updating the pre-commit configuration
5
+ ci:
6
+ autoupdate_schedule: monthly
7
+ autofix_commit_msg: "style(pre-commit.ci): auto fixes [...]"
8
+ autoupdate_commit_msg: "ci(pre-commit.ci): autoupdate"
9
+
10
+ repos:
11
+ - repo: https://github.com/abravalheri/validate-pyproject
12
+ rev: v0.22
13
+ hooks:
14
+ - id: validate-pyproject
15
+
16
+ - repo: https://github.com/crate-ci/typos
17
+ rev: v1.24.6
18
+ hooks:
19
+ - id: typos
20
+ args: # omitting --write-changes
21
+ - "--force-exclude"
22
+ # - "--config=_typos.toml"
23
+
24
+ - repo: https://github.com/astral-sh/ruff-pre-commit
25
+ rev: v0.7.2
26
+ hooks:
27
+ - id: ruff
28
+ args: [--fix] # may also add '--unsafe-fixes'
29
+ - id: ruff-format
30
+
31
+ - repo: https://github.com/pre-commit/mirrors-mypy
32
+ rev: v1.13.0
33
+ hooks:
34
+ - id: mypy
35
+ files: "^src/"
36
+ # # you have to add the things you want to type check against here
37
+ # additional_dependencies:
38
+ # - numpy
39
+
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2024-2025, Josh Dickerson and Matthew Giammar
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,135 @@
1
+ Metadata-Version: 2.4
2
+ Name: leopard_em
3
+ Version: 0.0.2a0
4
+ Summary: Location & Orientation of Particles using Two-Dimensional Template Matching
5
+ Project-URL: homepage, https://github.com/Lucaslab-Berkeley/Leopard-EM
6
+ Project-URL: repository, https://github.com/Lucaslab-Berkeley/Leopard-EM
7
+ Author-email: Josh Dickerson <jdickerson@berkeley.edu>, Matthew Giammar <matthew_giammar@berkeley.edu>
8
+ License: BSD-3-Clause
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: License :: OSI Approved :: BSD License
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Typing :: Typed
17
+ Requires-Python: >=3.9
18
+ Requires-Dist: mrcfile
19
+ Requires-Dist: numpy
20
+ Requires-Dist: pandas
21
+ Requires-Dist: pydantic
22
+ Requires-Dist: pyyaml
23
+ Requires-Dist: roma
24
+ Requires-Dist: torch
25
+ Requires-Dist: torch-fourier-filter==v0.2.2
26
+ Requires-Dist: torch-fourier-slice==v0.0.5
27
+ Requires-Dist: torch-image-lerp==v0.0.5
28
+ Requires-Dist: torch-so3>=v0.1.3
29
+ Requires-Dist: tqdm
30
+ Requires-Dist: types-pyyaml
31
+ Provides-Extra: dev
32
+ Requires-Dist: ipython; extra == 'dev'
33
+ Requires-Dist: mypy; extra == 'dev'
34
+ Requires-Dist: pdbpp; extra == 'dev'
35
+ Requires-Dist: pre-commit; extra == 'dev'
36
+ Requires-Dist: rich; extra == 'dev'
37
+ Requires-Dist: ruff; extra == 'dev'
38
+ Provides-Extra: docs
39
+ Requires-Dist: mkdocs; extra == 'docs'
40
+ Requires-Dist: mkdocs-inline-select-svg-plugin; extra == 'docs'
41
+ Requires-Dist: mkdocs-jupyter; extra == 'docs'
42
+ Requires-Dist: mkdocs-material; extra == 'docs'
43
+ Requires-Dist: python-markdown-math; extra == 'docs'
44
+ Provides-Extra: test
45
+ Requires-Dist: pytest; extra == 'test'
46
+ Requires-Dist: pytest-cov; extra == 'test'
47
+ Description-Content-Type: text/markdown
48
+
49
+ # Leopard-EM: Python based template matching
50
+
51
+ [![License](https://img.shields.io/pypi/l/Leopard-EM.svg?color=green)](https://github.com/Lucaslab-Berkeley/Leopard-EM/raw/main/LICENSE)
52
+ [![PyPI](https://img.shields.io/pypi/v/Leopard-EM.svg?color=green)](https://pypi.org/project/Leopard-EM)
53
+ [![Python Version](https://img.shields.io/pypi/pyversions/Leopard-EM.svg?color=green)](https://python.org)
54
+ [![CI](https://github.com/Lucaslab-Berkeley/Leopard-EM/actions/workflows/ci.yml/badge.svg)](https://github.com/Lucaslab-Berkeley/Leopard-EM/actions/workflows/ci.yml)
55
+ [![codecov](https://codecov.io/gh/Lucaslab-Berkeley/Leopard-EM/branch/main/graph/badge.svg)](https://github.com/Lucaslab-Berkeley/Leopard-EM)
56
+
57
+ Leopard-EM (**L**ocation & ori**E**ntati**O**n of **PAR**ticles found using two-**D**imensional t**E**mplate **M**atching) is a python package for running two-dimensional template matching (2DTM) on cryo-EM images.
58
+
59
+ <!-- ## Documentation and Examples
60
+
61
+ See the `/examples` directory for a set of Jupyter notebooks demonstrating some basic usage of the package.
62
+ More extensive documentation can be found at (TODO: Add link to documentation site). -->
63
+
64
+ ## Basic Installation
65
+
66
+ The newest released version of the package can be installed from PyPI using pip:
67
+
68
+ ```bash
69
+ pip install leopard-em
70
+ ```
71
+
72
+ ## Usage
73
+
74
+ ### Template Matching
75
+
76
+ Inputs to the template matching programs can be configured with Pydantic models (see online documentation for examples and use cases).
77
+ Alternatively, configurations can be set in YAML files and loaded into the `MatchTemplateManager` object.
78
+ The [example YAML configuration file](match_template_example_config.yaml) acts as a template for configuring your own runs.
79
+ Once configured with the proper paths, parameters, etc., the program can run as follows:
80
+
81
+ ```python
82
+ from leopard_em.pydantic_models import MatchTemplateManager
83
+
84
+ YAML_CONFIG_PATH = "path/to/mt_config.yaml"
85
+ ORIENTATION_BATCH_SIZE = 8
86
+
87
+ def main():
88
+ mt_manager = MatchTemplateManager.from_yaml(YAML_CONFIG_PATH)
89
+ mt_manager.run_match_template(ORIENTATION_BATCH_SIZE)
90
+ df.results_to_dataframe()
91
+ df.to_csv("/path/to/results.csv")
92
+
93
+ # NOTE: invoking from `if __name__ == "__main__"` is necessary
94
+ # for proper multiprocessing/GPU-distribution behavior
95
+ if __name__ == "__main__":
96
+ main()
97
+ ```
98
+
99
+ ### Template Refinement
100
+
101
+ Particle orientations and locations can be refined using the `RefineTemplateManager` objects after a template matching run.
102
+ The `RefineTemplateManager` is similarly a set of Pydantic models capable of configuration via YAML files.
103
+ The [example YAML configuration file](refine_template_example_config.yaml) acts as a template for configuring your own runs.
104
+ Once configured with the proper paths, parameters, etc., the program can run as follows:
105
+
106
+ ```python
107
+ from leopard_em.pydantic_models import RefineTemplateManager
108
+
109
+ YAML_PATH = "/path/to/rt_config.yaml"
110
+ ORIENTATION_BATCH_SIZE = 80
111
+
112
+ def main():
113
+ rt_manager = RefineTemplateManager.from_yaml(YAML_PATH)
114
+ rt_manager.run_refine_template(
115
+ output_dataframe_path="/path/to/refined_results.csv",
116
+ orientation_batch_size=ORIENTATION_BATCH_SIZE,
117
+ )
118
+
119
+
120
+ if __name__ == "__main__":
121
+ main()
122
+
123
+ ```
124
+
125
+ ## Installation for Development
126
+
127
+ The package can be installed from source in editable mode with the optional development libraries via pip.
128
+
129
+ ```bash
130
+ git clone https://github.com/Lucaslab-Berkeley/Leopard-EM.git
131
+ cd Leopard-EM
132
+ pip install -e '.[dev,test, docs]'
133
+ ```
134
+
135
+ Further information on development and contributing to the repo can be found in our online documentation.
@@ -0,0 +1,87 @@
1
+ # Leopard-EM: Python based template matching
2
+
3
+ [![License](https://img.shields.io/pypi/l/Leopard-EM.svg?color=green)](https://github.com/Lucaslab-Berkeley/Leopard-EM/raw/main/LICENSE)
4
+ [![PyPI](https://img.shields.io/pypi/v/Leopard-EM.svg?color=green)](https://pypi.org/project/Leopard-EM)
5
+ [![Python Version](https://img.shields.io/pypi/pyversions/Leopard-EM.svg?color=green)](https://python.org)
6
+ [![CI](https://github.com/Lucaslab-Berkeley/Leopard-EM/actions/workflows/ci.yml/badge.svg)](https://github.com/Lucaslab-Berkeley/Leopard-EM/actions/workflows/ci.yml)
7
+ [![codecov](https://codecov.io/gh/Lucaslab-Berkeley/Leopard-EM/branch/main/graph/badge.svg)](https://github.com/Lucaslab-Berkeley/Leopard-EM)
8
+
9
+ Leopard-EM (**L**ocation & ori**E**ntati**O**n of **PAR**ticles found using two-**D**imensional t**E**mplate **M**atching) is a python package for running two-dimensional template matching (2DTM) on cryo-EM images.
10
+
11
+ <!-- ## Documentation and Examples
12
+
13
+ See the `/examples` directory for a set of Jupyter notebooks demonstrating some basic usage of the package.
14
+ More extensive documentation can be found at (TODO: Add link to documentation site). -->
15
+
16
+ ## Basic Installation
17
+
18
+ The newest released version of the package can be installed from PyPI using pip:
19
+
20
+ ```bash
21
+ pip install leopard-em
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ ### Template Matching
27
+
28
+ Inputs to the template matching programs can be configured with Pydantic models (see online documentation for examples and use cases).
29
+ Alternatively, configurations can be set in YAML files and loaded into the `MatchTemplateManager` object.
30
+ The [example YAML configuration file](match_template_example_config.yaml) acts as a template for configuring your own runs.
31
+ Once configured with the proper paths, parameters, etc., the program can run as follows:
32
+
33
+ ```python
34
+ from leopard_em.pydantic_models import MatchTemplateManager
35
+
36
+ YAML_CONFIG_PATH = "path/to/mt_config.yaml"
37
+ ORIENTATION_BATCH_SIZE = 8
38
+
39
+ def main():
40
+ mt_manager = MatchTemplateManager.from_yaml(YAML_CONFIG_PATH)
41
+ mt_manager.run_match_template(ORIENTATION_BATCH_SIZE)
42
+ df.results_to_dataframe()
43
+ df.to_csv("/path/to/results.csv")
44
+
45
+ # NOTE: invoking from `if __name__ == "__main__"` is necessary
46
+ # for proper multiprocessing/GPU-distribution behavior
47
+ if __name__ == "__main__":
48
+ main()
49
+ ```
50
+
51
+ ### Template Refinement
52
+
53
+ Particle orientations and locations can be refined using the `RefineTemplateManager` objects after a template matching run.
54
+ The `RefineTemplateManager` is similarly a set of Pydantic models capable of configuration via YAML files.
55
+ The [example YAML configuration file](refine_template_example_config.yaml) acts as a template for configuring your own runs.
56
+ Once configured with the proper paths, parameters, etc., the program can run as follows:
57
+
58
+ ```python
59
+ from leopard_em.pydantic_models import RefineTemplateManager
60
+
61
+ YAML_PATH = "/path/to/rt_config.yaml"
62
+ ORIENTATION_BATCH_SIZE = 80
63
+
64
+ def main():
65
+ rt_manager = RefineTemplateManager.from_yaml(YAML_PATH)
66
+ rt_manager.run_refine_template(
67
+ output_dataframe_path="/path/to/refined_results.csv",
68
+ orientation_batch_size=ORIENTATION_BATCH_SIZE,
69
+ )
70
+
71
+
72
+ if __name__ == "__main__":
73
+ main()
74
+
75
+ ```
76
+
77
+ ## Installation for Development
78
+
79
+ The package can be installed from source in editable mode with the optional development libraries via pip.
80
+
81
+ ```bash
82
+ git clone https://github.com/Lucaslab-Berkeley/Leopard-EM.git
83
+ cd Leopard-EM
84
+ pip install -e '.[dev,test, docs]'
85
+ ```
86
+
87
+ Further information on development and contributing to the repo can be found in our online documentation.
@@ -0,0 +1,2 @@
1
+ [default.extend-words]
2
+ BA = "BA"