Skip to content
Skillpedia
Analysis & spreadsheets51k · #1962

relion

Lets your agent validate and run analyses on microscopy images. It checks data quality and helps refine results. It's useful for scientists using this technique to study very small structures.

What it does

This program helps refine and process single-particle cryo-electron microscopy (cryo-EM) data. It checks if the data is correct and runs the analysis steps to obtain a high-resolution 3D image of your sample.

When to use it

  • ✓When you have extracted particles and want to refine a 3D structure.
  • ✓To check the quality of your data before and after refinement.
  • ✓To generate final resolution maps and assess image quality.

Example of what to ask your AI

“Validate my particle data and start the 3D refinement for my protein X sample, using a diameter of 150 Angstroms and C1 symmetry.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/relion/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/relion/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

The program checks data files (like acquisition and particle data) to ensure they are in the correct format. It then uses this data to run the refinement and post-processing steps, generating high-quality results.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add K-Dense-AI/scientific-agent-skills --skill relion

Or download just the file:

curl -L https://raw.githubusercontent.com/K-Dense-AI/scientific-agent-skills/main/skills/relion/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

RELION single-particle refinement

Use for a RELION single-particle project, especially extracted particles → homogeneous selected particle subset → gold-standard refinement → half-map validation and postprocessing. The bundled runner starts from CTF-annotated extracted particles and an initial 3D reference. It does not replace motion correction, picking, 2D/3D selection, or a biological interpretation of map quality. For tomography, helical reconstruction, Blush, or heterogeneous-state modeling, use the appropriate upstream workflow rather than forcing those data into this bounded SPA runner.

Preserve acquisition and coordinate conventions

Read references/acquisition-and-restarts.md when starting from movies or resuming jobs. Confirm pixel size in Å/pixel, voltage in kV, spherical aberration in mm, defocus in Å, amplitude contrast as a fraction, and the symmetry justified by the specimen. Do not “correct” a suspicious value by guessing its units.

data_optics describes acquisition/image groups; data_particles references them through _rlnOpticsGroup. Particle filenames use one-based index@stack.mrcs; leading zeros such as 00000001@stack.mrcs are valid. Relative paths resolve from the RELION project directory, not the STAR file's directory. Keep optics groups when merging or subsetting STAR files. _rlnOriginXAngst/_rlnOriginYAngst are Å translations, not pixels.

Run from this skill directory with paths to the real project:

python scripts/spa_workflow.py validate-star project/particles.star --project project

This opens referenced stacks and checks optics membership, finite acquisition/CTF values, indices, box sizes, duplicate particle references and existing half-set assignments. Use --metadata-only only when stacks are genuinely unavailable; the JSON records stack_checks_performed: false. It does not scan every particle pixel for corruption or establish correct image normalization. Physical-range warnings are review prompts, not proof that unusual microscope settings are wrong.

Refine a selected particle population

Before running, inspect representative particles and class averages, defocus distributions, CTF fits, particle orientation distribution, and the initial reference. Ensure the map and particle boxes/pixel sizes agree after any downsampling. The runner deliberately supports one effective box/pixel size across optics groups; handle heterogeneous sampling with an explicit upstream resampling workflow. Use conventionally extracted, normalized particles that have not already been phase-flipped or Wiener-filtered; this runner does not configure those special input cases.

python scripts/spa_workflow.py refine \
  --star project/particles.star --reference project/initial.mrc \
  --project project --diameter 180 --symmetry C1 \
  --initial-lowpass 40 --mpi-ranks 3 --threads 2 --output project/RefinePilot

The diameter and low-pass filter above are illustrative Å values. Use specimen-appropriate values. Refinement executes mpirun -np 3 relion_refine_mpi with --auto_refine, --split_random_halves, --ctf, and a low-pass starting reference. Gold-standard splitting requires MPI; the plain sequential relion_refine executable cannot perform this split. Use odd ranks ≥3 (master plus balanced half-set workers), with a matching MPI installation. The CPU command is useful for a bounded pilot; choose a documented GPU/MPI launch for full data.

The runner keeps the command, native version and log in a new output directory, records an explicit random seed (default 1), surfaces runtime warnings, stops on process failure, and requires converged unfiltered half maps before reporting success. It does not automatically retry expensive jobs or silently discard failed-job artifacts. Keep _optimiser.star, model/sampling STAR files, and referenced particle paths for restart. Use the original job's optimiser rather than starting a new random split from a partially processed table.

Inspect independent half maps

Use the two independently refined unfiltered half maps, never two copies of the combined, sharpened map. Matching headers cannot establish statistical independence; the independent particle assignments and refinement history provide that evidence. Inspect directional anisotropy, preferred orientation and local resolution as well as a global FSC curve.


…
FAQ

What is cryo-EM?

Cryo-EM (Cryo-electron microscopy) is a technique used to determine the three-dimensional structure of biological molecules at high resolution by rapidly freezing them in ice.

What does 'refinement' mean?

Refinement is the process of improving the quality and resolution of an initial 3D model using data from individual particles.

What are 'half maps'?

These are two 3D maps generated independently from different halves of the particle dataset. They are used to verify the reliability of the final result.

Details

Original description by the author

Validates and executes RELION single-particle cryo-EM refinement and half-map postprocessing. Supports STAR optics/acquisition checks, particle-stack consistency, gold-standard half sets, soft-mask validation, diagnostic Fourier shell correlation, and restart guidance.

repo: K-Dense-AI/scientific-agent-skills

Popularity

GitHub stars
51k
Ranking position
#1962
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills