Skip to main content

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.0

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.0
File Size Uploaded
torch_local_resolution-0.6.0.tar.gz 40.8 kB Details

Built distribution (wheel)

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

Total release size: 58.3 kB

Release files / torch_local_resolution-0.6.0.tar.gz

Download URL torch_local_resolution-0.6.0.tar.gz
Size 40.8 kB
Tags Source
SHA-256 checksum
How to use checksums
10764a0b57f25da49f52f7761fac1b1cb6cf85c0d45579aa696bcc13355797a3
BLAKE2b-256 checksum
How to use checksums
246d5faea069bb7b40ea4bf39ade83dd27ce12dce10fc368365b81203106e3f1
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.0-py3-none-any.whl

Download URL torch_local_resolution-0.6.0-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cd97d807ae63d08bd5936f78d925472074f426be12158e3d65f51eb92c35b392
BLAKE2b-256 checksum
How to use checksums
0f012d1933f066fd9ab97ca7628deef9d47f8463e2c6a18e001823b149a6053b
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

This release

0.6.0 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