Skip to content

ScaleSets

CellEngine API: ScaleSets

A scale set is a set of scales (one scale per channel name for all channels in the experiment). Each experiment has exactly one scale set. Uploading a file updates the experiment's scale set to ensure that the new file's channels are included. If a new channel must be added to a ScaleSet, the default scale from the FCS file will be used.

It is possible to add or update scales to the scale set. Scales are a dict of dicts, and may be manipulated as expected:

scaleset.scales["Channel-1"].update({"maximum": 10})
# or
scaleset.scales["Channel-2"]["maximum"] = 10

scaleset.scales["Channel-3"]["type"] = "ArcSinhScale"

Properties

Properties are getter methods and setter methods representing the underlying CellEngine object. Properties are the snake_case equivalent of those documented on the CellEngine API unless otherwise noted.

Methods

cellengine.resources.scaleset.ScaleSet

experiment_id: str property

id: str property

Alias for _id.

name: str property

scales: Dict[str, ScaleDict] property

apply(file, clamp_q=False, in_place=True)

Apply the scaleset to a file.

Parameters:

Name Type Description Default
file FcsFile

The file to which this scaleset will be applied. See FcsFile.events: the scaleset will be applied to the last result from FcsFile.get_events will be used if the file's events have already been retrieved.

required
clamp_q bool

Clamp the output to the scale's minimum and maximum values.

False
in_place bool

If True, updates FcsFile.events in-place; if False, returns a DataFrame.

True

get(experiment_id) classmethod

scale_fn_for_channel(channel)

Get the scale function for a channel.

Parameters:

Name Type Description Default
channel str

The channel name.

required

Returns:

Type Description
Callable[[float], float]

The scale function for the channel.

scale_for_channel(channel)

Get the scale for a channel.

Parameters:

Name Type Description Default
channel str

The channel name.

required

Returns:

Type Description
Optional[ScaleDict]

The scale for the channel, or None if the channel is not in the

Optional[ScaleDict]

scaleset.

update()

Save changes to this ScaleSet to CellEngine.

Warning: This API endpoint can change gates if their coordinates are affected by the scale parameters. You may need to re-query gates to synchronize your local state with CellEngine.