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 Å/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.5.2

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.5.2
File Size Uploaded Provenance Actions
torch_local_resolution-0.5.2.tar.gz 40.6 kB With provenance Details for torch_local_resolution-0.5.2.tar.gz

Built distribution (wheel)

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

Total release size: 58.0 kB

Release files / torch_local_resolution-0.5.2.tar.gz

Download URL torch_local_resolution-0.5.2.tar.gz
Size 40.6 kB
Tags Source
SHA-256 checksum
How to use checksums
fcf07fde220bcadbbf0f3e89ff9871818544281039b64e3767f8d51325c60acb
BLAKE2b-256 checksum
How to use checksums
8072d0fda66db192dd1204d2b899f0493d71bee67cc6e6c1fd2df00e765e4be4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 8, 2026.

Transparency log

Release files / torch_local_resolution-0.5.2-py3-none-any.whl

Download URL torch_local_resolution-0.5.2-py3-none-any.whl
Size 17.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7a6c16e7c064953242d18d5753ff7562318a2ed220cf1ddd0b3f1031f062b467
BLAKE2b-256 checksum
How to use checksums
0009a0a5e5190b9895bc15a1fbbd59ac13d22b66eca311065b93601fbe12251f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 8, 2026.

Transparency log

Security for torch-local-resolution 0.5.2

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for torch_local_resolution-0.5.2.tar.gz

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 Jun 8, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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