4d — Generate dataset STAR file

Datasets scripts · 4d User Manual

← Back to the Datasets tab

Generate dataset STAR file

This script (dataset/tasks/10_GenerateStarFile.script, a Bash script) gathers the particles that the single-particle step extracted from every image of the project into one RELION STAR file, <dataset_dir>/particles.star, with the particle stacks linked next to it. It is the hand-off of the whole session's particles to RELION or cryoSPARC. The two RELION steps of the Datasets tab do not need it — they make their own STAR files of the most recent images — so it is usually run at the end of a collection.

Parameters

ParameterRole
dataset_dirThe dataset directory under merge/ the file is written into (default MERGING); created when missing.
KV, CSAccelerating voltage (kV) and spherical aberration (mm), written into every optics group of the STAR file.
phaconThe phase-contrast portion; the STAR file carries the corresponding amplitude contrast, sqrt(1 − phacon²) (0.9975 → 0.071). RELION uses it only when a CTF correction is on.
sample_pixelShown for information. The pixel size written into the STAR file is read from the header of each particle stack, which the single-particle step sets.

Algorithm

  1. Creates dataset_dir. An existing particles.star there is kept as particles.star.old.
  2. Runs the STAR-file generator (proc/StarFileGenerator.sh) over the project's list of image directories, 4d_merge_dirfile.dat. For every image that has both spa_particles.mrc (the extracted, centred and normalised boxes) and spa_particles.star (their coordinates) it
    • links the stack as Particles/<group>_<image>.mrcs next to the STAR file — RELION reads stacks only from files ending in .mrcs;
    • reads box size, number of boxes and pixel size from the stack's MRC header (falling back to the image's pixelsize with a warning);
    • opens one optics group per image, with amplitude contrast, Cs, voltage, pixel size, box size and dimensionality 2;
    • writes one particle row per box: the image NNNNNN@…/Particles/….mrcs, the micrograph name <group>/<image>/<original file name>, the coordinates, the defocus of the image (from its drift-correction CTF fit, converted to Ångström; 0 when none) as defocus U and V with angle 0, and the optics group.
    An image without particles is listed in the log and skipped. The per-image metadata comes from the project database, merge/4d_project.db.
  3. Writes the file in the RELION 3.1+ format (data_optics and data_particles tables, # version 30001) and reports how many particles from how many images it holds.

Results

<dataset_dir>/particles.star, listed as an important result, so it shows in the File Preview. The particles themselves stay in the image directories: Particles/ holds symbolic links, not copies. A STAR file to be used elsewhere therefore travels together with the project, or is copied with the links resolved (cp -RL).

The STAR file names the stacks by absolute path, as they lie in this project. A STAR file taken to another computer needs those paths adjusted.

The Utility version

The Utility category of the Datasets tab holds dataset/utilities/40_GenerateStarFile.script, the older C-shell version of this step, kept from Focus. It serves the same purpose through the C-shell generator StarFileGenerator.com, but names its output particles_from_selected.star while listing particles.star as its result. Prefer the Bash task above; the utility is retained for comparison.