{"id":50483277,"url":"https://github.com/elkins/synth-afm","last_synced_at":"2026-06-01T19:30:44.554Z","repository":{"id":360828314,"uuid":"1251887553","full_name":"elkins/synth-afm","owner":"elkins","description":"Differentiable High-Speed AFM (HS-AFM) simulation for protein structures. JAX-powered toolkit for generating synthetic movies with realistic tip-dilation and scanning lag.","archived":false,"fork":false,"pushed_at":"2026-05-28T02:32:02.000Z","size":39,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-28T04:07:56.010Z","etag":null,"topics":["afm-analysis","biophysics","computational-biology","differentiable-physics","high-speed-afm","hs-afm","jax","protein-dynamics","simulation","structural-biology"],"latest_commit_sha":null,"homepage":"https://elkins.github.io/synth-afm/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elkins.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-28T02:05:20.000Z","updated_at":"2026-05-28T02:47:44.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/elkins/synth-afm","commit_stats":null,"previous_names":["elkins/synth-afm"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/elkins/synth-afm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elkins%2Fsynth-afm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elkins%2Fsynth-afm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elkins%2Fsynth-afm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elkins%2Fsynth-afm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elkins","download_url":"https://codeload.github.com/elkins/synth-afm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elkins%2Fsynth-afm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33790661,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-01T02:00:06.963Z","response_time":115,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["afm-analysis","biophysics","computational-biology","differentiable-physics","high-speed-afm","hs-afm","jax","protein-dynamics","simulation","structural-biology"],"created_at":"2026-06-01T19:30:43.938Z","updated_at":"2026-06-01T19:30:44.546Z","avatar_url":"https://github.com/elkins.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧬 synth-afm: Differentiable HS-AFM Simulation\n\n[![PyPI version](https://img.shields.io/badge/pypi-v0.1.1--dev-blue)](https://github.com/elkins/synth-afm)\n[![Supported Python versions](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12-blue)](https://github.com/elkins/synth-afm)\n[![Tests](https://github.com/elkins/synth-afm/actions/workflows/test.yml/badge.svg)](https://github.com/elkins/synth-afm/actions/workflows/test.yml)\n[![Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen)](https://github.com/elkins/synth-afm)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![JAX](https://img.shields.io/badge/Accelerated_by-JAX-blue.svg)](https://github.com/google/jax)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n`synth-afm` is a JAX-powered toolkit for generating synthetic High-Speed Atomic Force Microscopy (HS-AFM) images and movies from atomistic protein structures. \n\nBuilt with the **differentiable biophysics** philosophy, every step—from coordinate rotation to tip-collision height mapping—is end-to-end differentiable. \n\n---\n\n### 🧪 For Structural Biologists\nHS-AFM provides a unique look at \"proteins at work,\" but interpreting noisy movies is challenging. `synth-afm` helps you bridge the resolution gap:\n*   **Realistic Tip Physics:** Uses a spherical-tip dilation model to account for the broadening effect of the AFM probe.\n*   **Atomic Rigor:** Automatically assigns van der Waals radii based on element (Bondi, 1964) for accurate topography.\n*   **Temporal Distortion:** Models **Scanning Lag**, simulating how protein dynamics during a scan cause the \"shear\" artifacts seen in real HS-AFM movies.\n*   **Force Maps:** Go beyond height-maps with experimental support for tip-sample repulsion (deflection) modeling.\n\n### 🤖 For Machine Learning Geeks\n`synth-afm` treats the entire AFM scanning process as a differentiable operator $\\mathcal{H}: \\mathbb{R}^{N \\times 3} \\rightarrow \\mathbb{R}^{H \\times W}$:\n*   **End-to-End Differentiable:** Built entirely in JAX, allowing you to flow gradients from an experimental AFM image $\\mathbf{I}_{exp}$ back to atomic coordinates $\\mathbf{X}$.\n*   **Flexible Fitting:** Enable gradient-based optimization of molecular structures using experimental AFM data as a loss term: $\\mathcal{L} = \\|\\mathcal{H}(\\mathbf{X}) - \\mathbf{I}_{exp}\\|^2$.\n*   **Synthetic Benchmarking:** Generate large-scale, ground-truth datasets of \"corrupted\" AFM movies (with lag, noise, and dilation) to train denoising or state-detection models.\n\n---\n\n## 🚀 Key Features\n\n*   **Differentiable Height Mapping:** Efficient Log-Sum-Exp collision detection for sub-nanometer topography.\n*   **Scanning Lag Simulation:** Models the line-by-line temporal delay inherent in pixel-by-pixel acquisition.\n*   **Flexible Tip Geometries:** Supports spherical and parabolic tip-shape dilation.\n*   **Integration:** Reads PDB/mmCIF files via `biotite` and integrates with `synth-pdb` and `resonance-flow`.\n\n## 📦 Installation\n\n```bash\npip install synth-afm\n```\n\n## 📖 Tutorials\n\nGet started immediately with our interactive Jupyter notebooks:\n\n*   **[Quick Start: Differentiable HS-AFM Simulation](examples/quickstart_afm.ipynb)**: Learn how to generate height maps with tip dilation and scanning lag.  \n    [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/elkins/synth-afm/blob/master/examples/quickstart_afm.ipynb)\n\n## 🛠 Quick Start\n\n```python\nimport jax.numpy as jnp\nfrom synth_afm.simulator import AFMSimulator\nfrom synth_afm.io import load_coords_and_radii\n\n# 1. Load your structure (N, 3) and radii (N,)\ncoords, radii = load_coords_and_radii(\"molecule.pdb\")\n\n# 2. Initialize simulator (1A pixel size, 2nm tip radius)\nsim = AFMSimulator(pixel_size=1.0, tip_radius=20.0)\n\n# 3. Generate height map (Differentiable!)\nheight_map = sim.scan(coords, radii)\n```\n\n## 🧪 Scientific Validation\n\nThe height-mapping kernels are validated against the standard Villarrubia algorithm and verified to preserve atomic heights within 0.01 Å precision. The temporal lag simulation correctly reproduces the stroboscopic shearing effects documented in high-speed biological AFM (Ando et al., 2011).\n\n## 📜 License\n\nDistributed under the MIT License. See `LICENSE` for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felkins%2Fsynth-afm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felkins%2Fsynth-afm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felkins%2Fsynth-afm/lists"}