Core functionality for local resolution estimation of cryo-EM half-maps
Project description
torch-local-resolution
Core functionality for local resolution estimation of cryo-EM half-maps.
Overview
torch-local-resolution estimates local resolution by computing the local cosine similarity between two bandpass-filtered half-maps. For each resolution shell, the correlation is measured within a sliding spherical window across the map. Statistical significance is assessed by comparing the observed correlations against a null distribution derived from phase-permuted or voxel-shuffled surrogates.
- Supports 2D (single-slice) and 3D half-maps
- Batched processing of multiple half-map pairs
- Configurable resolution shells, window sizes, and step sizes
- Statistical p-value maps or raw correlation output
Installation
This package is part of the TeamTomo monorepo. See the main repository README for development setup instructions.
Usage
import torch
from torch_local_resolution import estimate_local_resolution
# Load your half-maps as (B, Z, Y, X) tensors
# For 2D maps, set Z=1: (B, 1, Y, X)
half_map1 = torch.randn(1, 64, 64, 64)
half_map2 = torch.randn(1, 64, 64, 64)
# Define resolution shells and matching window radii
apix=1.0
resolutions = [10.0, 8.0, 6.0, 4.0] # in Ångström
windows_radii = [10.5, 9.1, 7.2, 4.5] # in voxels, one per shell
# Compute local resolution p-value map
pvalue_map = estimate_local_resolution(
apix=apix, # voxel size in Å/pixel
windows_radii=windows_radii,
resolutions=resolutions,
batch_half_map1=half_map1,
batch_half_map2=half_map2,
step_size=3, # stride between sampling points
gpu_id=0, # use first CUDA device (None for CPU)
)
# To get raw correlation values instead of p-values
correlation_map = estimate_local_resolution(
apix=1.0,
windows_radii=windows_radii,
resolutions=resolutions,
batch_half_map1=half_map1,
batch_half_map2=half_map2,
step_size=3,
gpu_id=0,
skip_statistics=True,
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file torch_local_resolution-0.5.2.tar.gz.
File metadata
- Download URL: torch_local_resolution-0.5.2.tar.gz
- Upload date:
- Size: 40.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fcf07fde220bcadbbf0f3e89ff9871818544281039b64e3767f8d51325c60acb
|
|
| MD5 |
d391dfcc2478afe0e782dcc8ab42ec1a
|
|
| BLAKE2b-256 |
8072d0fda66db192dd1204d2b899f0493d71bee67cc6e6c1fd2df00e765e4be4
|
Provenance
The following attestation bundles were made for torch_local_resolution-0.5.2.tar.gz:
Publisher:
deploy.yml on teamtomo/teamtomo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
torch_local_resolution-0.5.2.tar.gz -
Subject digest:
fcf07fde220bcadbbf0f3e89ff9871818544281039b64e3767f8d51325c60acb - Sigstore transparency entry: 1758194874
- Sigstore integration time:
-
Permalink:
teamtomo/teamtomo@69ed87ec2671c198543b1b140810c74292d011d5 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/teamtomo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yml@69ed87ec2671c198543b1b140810c74292d011d5 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file torch_local_resolution-0.5.2-py3-none-any.whl.
File metadata
- Download URL: torch_local_resolution-0.5.2-py3-none-any.whl
- Upload date:
- Size: 17.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a6c16e7c064953242d18d5753ff7562318a2ed220cf1ddd0b3f1031f062b467
|
|
| MD5 |
a38540a503db6be56c354f16ea582ed2
|
|
| BLAKE2b-256 |
0009a0a5e5190b9895bc15a1fbbd59ac13d22b66eca311065b93601fbe12251f
|
Provenance
The following attestation bundles were made for torch_local_resolution-0.5.2-py3-none-any.whl:
Publisher:
deploy.yml on teamtomo/teamtomo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
torch_local_resolution-0.5.2-py3-none-any.whl -
Subject digest:
7a6c16e7c064953242d18d5753ff7562318a2ed220cf1ddd0b3f1031f062b467 - Sigstore transparency entry: 1758194967
- Sigstore integration time:
-
Permalink:
teamtomo/teamtomo@69ed87ec2671c198543b1b140810c74292d011d5 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/teamtomo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yml@69ed87ec2671c198543b1b140810c74292d011d5 -
Trigger Event:
workflow_dispatch
-
Statement type: