Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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 Angstroms/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,
)

Metadata

Release files for torch-local-resolution 0.6.0rc2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for torch-local-resolution 0.6.0rc2
File Size Uploaded
torch_local_resolution-0.6.0rc2.tar.gz 40.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for torch-local-resolution 0.6.0rc2
File Interpreter ABI Platform
torch_local_resolution-0.6.0rc2-py3-none-any.whl Python 3 none any Details

Total release size: 58.4 kB

Release files / torch_local_resolution-0.6.0rc2.tar.gz

Download URL torch_local_resolution-0.6.0rc2.tar.gz
Size 40.8 kB
Tags Source
SHA-256 checksum
How to use checksums
201846a39ed8c4f0a657b909b26d1243e641409c0b99bf8af02a4badfa805740
BLAKE2b-256 checksum
How to use checksums
5a792444ddeb367c9a62ad626d7814488caa3b022d14d384a7849f671ea18248
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log

Release files / torch_local_resolution-0.6.0rc2-py3-none-any.whl

Download URL torch_local_resolution-0.6.0rc2-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8ab55dd03fc2799130642838ee2b6afb1807cf3c6767d56cb483d370d9b18aa2
BLAKE2b-256 checksum
How to use checksums
e52d243ab3b7d23107fee68d51d9a5b1a87f1bef04b7b71c08ee2d6cf1383d16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log

Release history Release notifications | RSS feed

0.6.0

2 release files

This release

0.6.0rc2 This release

2 release files

0.5.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page