Skip to content

Plots

CellEngine API: Plots

A Plot is an image representing of cytometry data.

Properties

The Python SDK Plot only has display, get, and save methods. In the case of Plot, properties refers to an optional dictionary of configuration arguments to pass to the get method. Options are detailed above.

Methods

cellengine.resources.plot.Plot dataclass

A class representing a CellEngine plot.

compensation: Union[str, FILE_INTERNAL, UNCOMPENSATED] instance-attribute

data: bytes instance-attribute

experiment_id: str instance-attribute

fcs_file_id: str instance-attribute

plot_type: str instance-attribute

population_id: Optional[str] instance-attribute

x_channel: str instance-attribute

y_channel: str instance-attribute

z_channel: Optional[str] instance-attribute

display()

get(experiment_id, fcs_file_id, plot_type, x_channel, y_channel, z_channel=None, population_id=None, compensation=0, **kwargs) classmethod

Parameters:

Name Type Description Default
experiment_id str

ID of the experiment to which the file belongs.

required
fcs_file_id str

ID of file for which to build a plot.

required
plot_type str

"contour", "dot", "density" or "histogram" (case-insensitive)

required
x_channel str

X channel name.

required
y_channel str

(for 2D plots) Y channel name.

required
z_channel Optional[str]

(for dot plots colored by a 3rd channel) Color channel name.

None
population_id Optional[str]

Defaults to ungated.

None
compensation string ID, 0 or -1

Compensation to use for gating and display. Defaults to uncompensated (0).

0
**kwargs Dict
  • axesQ (bool): Display axes lines. Defaults to true.
  • axisLabelsQ (bool): Display axis labels. Defaults to true.
  • color (str): Case-insensitive string in the format #rgb, #rgba, #rrggbb or #rrggbbaa. The foreground color, i.e. color of curve in "histogram" plots and dots in "dot" plots.
  • gateLabel (str): One of "eventcount", "mean", "median", "percent", "mad", "cv", "stddev", "geometricmean", "name", "none".
  • gateLabelFontSize (float): Font size for gate labels.
  • height (int): Image height. Defaults to 228.
  • percentileStart (float): For contour plots, the percentile of the first contour.
  • percentileStep (float): For contour plots, the percentile step between each contour.
  • postSubsampleN (int): Randomly subsample the file to contain this many events after gating.
  • postSubsampleP (float): Randomly subsample the file to contain this percent of events (0 to 1) after gating.
  • preSubsampleN (int): Randomly subsample the file to contain this many events before gating.
  • preSubsampleP (float): Randomly subsample the file to contain this percent of events (0 to 1) before gating.
  • renderGates (bool): Render gates into the image.
  • seed (int): Seed for random number generator used for subsampling. Use for deterministic (reproducible) subsampling. If omitted, a pseudo-random value is used.
  • smoothing (float): For density and contour plots, adjusts the amount of smoothing. Defaults to 0 (no smoothing). Set to 1 for typical smoothing. Higher values (up to 10) increase smoothing.
  • strokeThickness (float): The thickness of histogram and contour plot lines. Defaults to 1.
  • tickLabelsQ (bool): Display tick labels. Defaults to false.
  • ticksQ (bool): Display ticks. Defaults to true.
  • width (int): Image width. Defaults to 228.
  • xAxisLabelQ (bool): Display x axis label. Overrides axisLabelsQ.
  • xAxisQ (bool): Display x axis line. Overrides axesQ.
  • xTickLabelsQ (bool): Display x tick labels. overrides tickLabelsQ.
  • xTicksQ (bool): Display x ticks. Overrides ticksQ.
  • yAxisLabelQ (bool): Display y axis label. Overrides axisLabelsQ.
  • yAxisQ (bool): Display y axis line. Overrides axesQ.
  • yTickLabelsQ (bool): Display y tick labels. Overrides tickLabelsQ.
  • yTicksQ (bool): Display y ticks. Overrides ticksQ.
{}

save(filepath)