Import/export functionality¶
nextPYP can import raw data from disk, merge data from existing nextPYP sessions or projects,
import Relion STAR metadata, and export refinement metadata back to STAR files.
Open a project, then click Import Data on the project toolbar. The dialog has two tabs — Single Particle and Tomography — each listing import cards. Legacy import paths are collapsed under Legacy import options at the bottom of the tab.
Import Data dialog¶
Primary cards (current path)¶
Dialog card |
Block created |
|---|---|
Raw Data |
Single Particle (from Raw Data) or Tomography (from Raw Data) |
From nextPYP |
Single Particle (from nextPYP) or Tomography (from nextPYP) |
From nextPYP (particles) |
Single Particle (particles from nextPYP) or Tomography (particles from nextPYP) |
From Relion |
Single Particle (from Star) or Tomography (from Star) |
Legacy cards (under Legacy import options)¶
Dialog card |
Block created |
|---|---|
From Project (legacy) |
Single Particle (from Project) or Tomography (from Project) |
From Session (legacy) |
Single Particle (from Session) or Tomography (from Session) |
Legacy Project (tomography only) |
Tomography (from legacy Project) |
Prefer From nextPYP for new work that pulls from sessions or other projects. Use the legacy cards only when you need the older single-source CLI-project or single-session importers.
Raw Data¶
Use this when movies or tilt-series live on a shared filesystem.
Import raw data from disk
Open a project and click Import Data
Choose the Single Particle or Tomography tab
Click Raw Data. The block Single Particle (from Raw Data) or Tomography (from Raw Data) appears on the Graph
Open the block’s Parameters tab
On the Sources tab:
Click Add path and pick a file pattern with the file browser (Choose File Pattern), for example
/data/project/*.eeror/data/project/**/*.tifFor each selected path you can:
Enable
Search subdirectories recursively(same effect as using**in the pattern)Set a per-path
Gain referenceFor tomography, optionally set
Location of mdoc files
Add more paths if the dataset is split across directories (each path can have its own gain / mdoc)
For Tomography imports, open the Grouping tab (this is where movie-frame and tilt-series naming are configured; they are no longer set on pre-processing):
If each tilt is already a single image (no movie frames), enable
No movie framesOtherwise leave
No movie framesoff and describe how files group into tilt-series:When Sources include mdoc paths,
Movie metadataappears: chooseinfer based on filenamesorread from *.mdoc filesWith filename mode (default when there are no mdocs, or when you choose filenames), use Annotate a filename to mark tilt-series / order / angle segments, optionally set Order and angles when the pattern omits
SCANORDorANGLE, then check Totals and Preview. Signed tilt angles wrapped in brackets or parentheses (for examplePosition_1_002[-7.00]_EER.eer) annotate as[ANGLE]/(ANGLE)in the pattern.With mdoc mode, use Combine with mdoc name if movie filenames need the mdoc basename as a prefix, then check Totals and Preview
Fill Microscope parameters (and other tabs as needed). When Sources list mdoc paths, a From mdoc files banner appears above the microscope fields with parsed values (or
missing/conflict); use per-field Apply to copy them into the form. Import blocks also have a Resources tab for SLURM settings on the import job itselfClick Run. After the run finishes, match the gain reference on the View tab. See Gain reference orientation below.
Tip
Duplicate file names across multi-source or recursive imports get unique suffixes automatically
Symlinks are treated as regular files during recursive search
The form requires at least one data path before Run will succeed
Note
Pre-processing and Grouping. Tomography Pre-processing and Pre-processing (legacy) inherit movie-frame / grouping settings from the connected import block. (Pre-processing (warp) would inherit the same settings when that block is re-enabled.)
If import has
No movie framesenabled, the Frame alignment tab is omitted on pre-processingIf the dataset has frames, Frame alignment shows alignment options only (for example
Alignment method); it no longer asks forNo movie frames,Movie metadata, orFrame pattern
Opening an older import that never stored grouping may offer to load No movie frames from a connected pre-processing block—save the import once to keep import as the source of truth.
Gain reference orientation¶
After a raw-data import finishes with a gain reference set, open the block’s View tab. Two panels there, filled in by pypgain, show whether the gain reference lines up with the movies.
Gain Reference Orientation puts an uncorrected frame average next to the gain reference:
Side by side shows the two images apart. Overlay stacks them; its layers are
Average,Blend,Difference, andGain ref.Differencegoes dark where the two images agree.Turn the gain reference with rotate counter-clockwise, rotate clockwise, flip horizontally, and flip vertically. Reset clears every transform.
Along x and Along y add each column and each row. The frame-average and gain-reference traces should follow each other once the orientation is right.
The line under the plots reads
rotation N, flip H yes/no, flip V yes/no.Nis a number of quarter turns, from 0 to 3.Apply to parameters writes that line into the Gain reference tab:
Clockwise rotation (multiple of 90 degrees),Flip horizontally, andFlip vertically.
Gain Correction shows the correction that orientation would produce beside the corrected image from the last run. Use the same Side by side and Overlay controls. Exaggerate stretches the gain’s variation about its average so the detector pattern is easier to see. The prediction is a binned preview: the geometry is exact, and the fine structure is approximate. If it does not match the last run, run the import again so the written orientation is the one that gets applied.
From nextPYP¶
Use this to pull micrographs or tilt-series (and associated preprocessing results) from sessions or from pre-processing blocks in this or other projects. This replaces the older separate “from Session” / “from Project” primary flows. The block outputs micrographs or tilt-series; to import particles instead, use From nextPYP (particles) below.
Merge sources from sessions or projects
Open a project and click Import Data
Choose Single Particle or Tomography, then click From nextPYP. The corresponding Single Particle (from nextPYP) or Tomography (from nextPYP) block appears on the Graph
Open the block’s Parameters tab
On the Sources tab:
Under Search in, pick one scope:
This project— pre-processing blocks in the current projectMy projects— pre-processing blocks in projects you ownProjects shared with me— pre-processing blocks in shared projectsSessions— streaming sessions of the matching type
Type at least two characters in the search box (
Search pre-processing blocks...orSearch sessions...)Click results to add them under Selected sources (you can select multiple)
Adjust any other form tabs as needed
Click Run
Note
The form requires at least one selected source. Session sources are labeled like Session: …; block sources use block numbers/names and may include the project name in brackets when they come from another project.
From nextPYP (particles)¶
Use this to pull particles from blocks in this or other projects, and feed refinement directly. Sources are particle-picking blocks (including MiLoPYP and Fulltilt evaluation), legacy pre-processing blocks that carry particles, and other particles-import blocks. Sessions are not available here, since particles come from blocks.
Import particles from existing blocks
Open a project and click Import Data
Choose Single Particle or Tomography, then click From nextPYP (particles). The corresponding Single Particle (particles from nextPYP) or Tomography (particles from nextPYP) block appears on the Graph
Open the block’s Parameters tab
On the Sources tab:
Under Search in, pick one scope:
This project,My projects, orProjects shared with meType at least two characters in the search box (
Search particle blocks...)Click results to add them under Selected sources (you can select multiple)
Adjust any other form tabs as needed
Click Run
Note
The form requires at least one selected source. Sources are labeled by block number and name, for example B3-Particle Picking, with the project name in brackets when they come from another project.
The block’s output port is Particles, so it connects to refinement, classification, and picking-training blocks.
From Relion¶
Use this to import Relion 4/5 STAR metadata into a nextPYP project.
The dialog card is labeled From Relion; the created block is still named Single Particle (from Star) or Tomography (from Star).
Single-particle¶
Import SPA Relion STAR files
Import Data → Single Particle → From Relion. The block Single Particle (from Star) appears on the Graph
Open the block’s Parameters tab
On Import parameters:
Set
Relion project pathSet
3D refinement file (*.star)Optionally set
Motion file (*.star)
On Sources / raw-data controls (when shown), set movie locations as needed for your dataset
Set Microscope parameters (
Pixel size (A),Acceleration voltage (kV), …)Click Run
Open Single Particle (from Star) to inspect results
Tomography¶
Import tomography Relion STAR files
Import Data → Tomography → From Relion. The block Tomography (from Star) appears on the Graph
Open the block’s Parameters tab
On Import parameters:
Set
Relion project pathSet
Tomograms file (*.star)Set
3D refinement file (*.star)Set
Relion versionto4or5For Relion 5, additional fields appear when applicable, such as
Motion file (*.star)andAligned tilt-series file (*.star)
Provide raw tilt-series / movie locations and Microscope parameters (including
Tilt-axis angle (degrees)) as neededClick Run
Open Tomography (from Star) to inspect results
Legacy import options¶
Expand Legacy import options in the Import Data dialog only if you need the older importers:
From Project (legacy) — browse to a
Path to existing CLI projectFrom Session (legacy) — pick a single session by name
Legacy Project (tomography) — older tomography project layout
These create the legacy-named blocks listed in the table above. New projects should use From nextPYP instead.
Export (to *.star)¶
Export particle stacks and Relion STAR
After picking or a refinement block, add Particle Extraction (SPA) or Particle Stack Extraction (tomography)
For tomography, optionally set
Particle export methodtonativeorWarpClick Run
The extraction block writes particle stacks and Relion STAR metadata (including refined poses when the parent is a refinement). Use that folder as the handoff to Relion.
Tip
native writes one stack per particle from nextPYP’s own crops. Warp re-crops the particles from the raw tilt series with Warp’s ts_export_particles (CTF-premultiplied, exposure-weighted particle series) using the refined CSP geometry, and writes a Relion 5 tomography project. Both carry the same poses; Warp is the path to follow when you plan to continue into Relion 5 or M-core refinement. The Warp export ends with a consistency report in the block log (per tilt-series position, orientation, defocus-hand and crop-frame agreement with the refined parameters); a note: line there means the export should not be trusted.
Note
Older projects could enable Export metadata (*.star) on a refinement block. That option is no longer shown; add an extraction block instead. The CLI flag csp -export_enable still works in a refinement directory.