Skip to content


resegment

Reprocess G4X-output with a new segmentation

Replaces or updates the segmentation mask in a G4X run and regenerates all downstream single-cell data and .bin files.


Usage

g4x-helpers resegment --help

Note

Global options --threads/-t & --verbose/-v must be supplied on the main entrypoint before the subcommand:

g4x-helpers --threads 16 -v 2 COMMAND /path/to/g4x_data [OPTIONS]

use g4x-helpers --help for more information

Arguments / Options


G4X-DATA

type : directory
example : path/to/g4x_output

Positional path to a G4X sample output directory.
The folder must follow the expected schema (e.g., contain run_meta.json, segmentation masks, panel files, single-cell outputs).
Provide this argument directly after the specified command, i.e:
g4x-helpers COMMAND G4X-DATA


--cell-labels [required]

type : file path
example : path/to/segmentation.npz

Path to a new segmentation mask file containing cell labels. It will be used to create new single-cell outputs by aggregating transcript and protein data on those labels. The extent of the labels must match the shape of the original data.
Supported formats are: (.npy, .npz, .geojson)


--labels-key

type : string
example : cell_id

Specifies the identifier for segmentation labels when loading mask data:

If using a .npz file:
Provide the name of the array within the archive that corresponds to the segmentation mask (required if multiple arrays are stored).

If using a .geojson file:
By default, cell labels are expected in a column named label.
Use this argument to override and select a different column as the label source.


--in-place

type : flag
default : not set

By default, commands write their outputs to <G4X-DATA>/g4x_helpers/<command>, leaving the original data untouched. Using --in-place instead writes outputs directly into the specified G4X-DATA directory, which may be required when chaining certain commands.

Note: this will override any existing artifacts modified by the command.
Please refer to each feature’s documentation to see which files may be updated.