susan.project.SubtomogramGenerator¶
- class susan.project.Extractor.SubtomogramGenerator[source]¶
Bases:
objectGenerate subtomograms and export them with RELION-compatible metadata.
Warning
This is an experimental class. The interface and output format may change in future versions.
Reconstructs per-particle subtomograms via
SubtomoRecand writes a RELION 3.1 STAR file containing the optics group and particle table. Call one of theconfigure_*methods beforegenerate_subtomos()to set the reconstruction parameters for the target software.Attributes
- list_gpus_ids¶
GPU device IDs to use for reconstruction. Default:
[0].- Type:
list of int
- subtomo_rec¶
Underlying reconstruction module. Advanced parameters can be adjusted directly on this object after calling a
configure_*method.- Type:
Methods
- configure_relion(rec_ctf=True, invert_contrast=True)[source]¶
Configure reconstruction settings for RELION.
Sets normalisation, contrast, and CTF correction parameters on
subtomo_recto match RELION’s conventions.- Parameters:
rec_ctf (bool, optional) – If
True(default), use pre-Wiener CTF correction and write a per-particle CTF image (_rlnCtfImage). IfFalse, use standard Wiener filter and write per-particle defocus columns.invert_contrast (bool, optional) – Invert the contrast of the output subtomograms. Default:
True.
- configure_dynamo(invert_contrast=False)[source]¶
Configure reconstruction settings for DYNAMO.
Sets normalisation, contrast, and CTF correction parameters on
subtomo_recto match DYNAMO’s conventions (Wiener filter, no low-frequency boost).- Parameters:
invert_contrast (bool, optional) – Invert the contrast of the output subtomograms. Default:
False.
- generate_subtomos(metadata_file, subtomos_folder, tomos_file, ptcls_in, box_size)[source]¶
Reconstruct subtomograms and write a RELION STAR metadata file.
The subtomogram MRC files are written to subtomos_folder. A RELION 3.1 STAR file is then written to metadata_file containing an
data_opticsblock (single optics group derived from the first tomogram) and adata_particlesblock with one row per particle. Currently only.staroutput is supported.- Parameters:
metadata_file (str) – Output path for the STAR file (must end in
.star).subtomos_folder (str) – Directory where the per-particle MRC files will be written.
tomos_file (str) – Path to the
.tomostxtfile describing the tomogram stack.ptcls_in (str) – Path to the input
.ptclsrawparticles file.box_size (int) – Side length of the cubic subtomogram box in pixels.