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
| Parameter | Role |
|---|---|
dataset_dir | The dataset directory under merge/ the file is written into (default MERGING); created when missing. |
KV, CS | Accelerating voltage (kV) and spherical aberration (mm), written into every optics group of the STAR file. |
phacon | The 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_pixel | Shown 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
- Creates
dataset_dir. An existingparticles.starthere is kept asparticles.star.old. - 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 bothspa_particles.mrc(the extracted, centred and normalised boxes) andspa_particles.star(their coordinates) it- links the stack as
Particles/<group>_<image>.mrcsnext 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
pixelsizewith 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.
merge/4d_project.db. - links the stack as
- Writes the file in the RELION 3.1+ format (
data_opticsanddata_particlestables,# 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 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.