Skip to content

API

CellEngine provides a first-class HTTP API that enables you to securely, reproducibly and easily perform any action from your language of choice.


General

Authentication

We use signed tokens for authorization. Every request must be accompanied by a token, either as a cookie:

token=<token>

or in the header:

Authorization: Bearer <token>

or in the URL query:

/api/v1/experiments?token=<token>

We recommend using cookies, as they can be automatically refreshed after every request by any language or HTTP package that supports cookies.

To retrieve a token, POST to /api/v1/signin with the body {username: username, password: password}, then store the returned accessToken.

Tokens expire periodically (every several hours). The server will respond with an error clearly indicating that the token has expired. The API consumer is responsible for refreshing the token if it is expired. Our API toolkits will automatically handle token refreshes.

If you need to revoke a token:

POST https://cellengine.com/api/v1/signout

with your token in one of the locations specified above.

Versioning

The current stable API is version 1. All endpoints are nested under /v1/ (e.g. https://cellengine.com/api/v1/experiments/...).

Request volumes

CellEngine was built for speed and throughput. Use the bulk endpoints whenever possible (e.g. bulk statistics and download gated populations from multiple files).

If you have a requirement for large-volume requests that are not satisfied by our bulk endpoints, please contact us. Avoid making more than 100 requests per second. Your requests may be throttled.

API Toolkits

We provide API toolkits for R and Python. Contact us about toolkits for Wolfram Mathematica and JavaScript (Node.js), and about OpenAPI (Swagger) specifications.

Standard query parameters for list routes

All list routes (e.g. GET /experiments/) support the following parameters:

Parameter Value Description
fields String Fields to return (exclusively) or omit (from default set), in the format -fieldName (omit) or +fieldName (include).
limit Number Maximum number of results to return.
query String Complex query comprised of query operators (see below).
skip Number Number of results to skip (e.g. an offset).
sort String Field to sort by, in the format +fieldName (ascending) or -fieldName (descending).

Allowed query operators are as follows:

Operator Description Example
eq equal to eq(eventCount, 5000) for FCS files with exactly 5000 events.
gt greater than gt(eventCount, 5000) for FCS files with more than 5000 events.
lt less than lt(eventCount, 5000) for FCS files with less than 5000 events.
gte greater than or equal to gte(eventCount, 5000) for FCS files with at least 5000 events.
lte less than or equal to lte(eventCount, 5000) for FCS files with up to 5000 events.
ne not equal to ne(name, "myfile.fcs") for FCS files not named "myfile.fcs".
size length of an array field size(annotations, 2) for FCS files with two annotations.
in member of an array field in(primaryResearcher._id, [<yourId>, <yourCoworkersId>]) for experiments where you or your coworker are primary researchers. (Note that these results would be limited to experiments to which you have access.)
nin not a member of an array field
all match all criteria all(tags, ["apoptosis", "cell cycle"]) for experiments with those tags.
and combine operators with and
or combine operators with or
elemMatch specifies that the same record must have multiple matching properties

If you are performing many queries or complex queries, we suggest that you contact us to ensure that your queries are efficient.

Standard HTTP verbs and headers

  • Concurrency control is offered via the If-Unmodified-Since header for any resource that has an updated property. Setting If-Unmodified-Since to the value of updated that appears in the version of the resource that you currently have allows you to avoid overwriting changes made by other users or applications. For more information, see the Mozilla Developer Network documentation page for that header.

  • The X-Experiment-Updated header contains the UTC timestamp at which the experiment or any of its descendant resources (such as gates and scales) were last modified. It is the same as the experiment.deepUpdated property returned by GET /experiments/:experimentId. This header is only guaranteed to be set when the experiment.deepUpdated property is changed.


Attachments

Attachments are non-data files that are stored in an experiment.

Resource Representation

Property Value Description
crc32c String, read-only The CRC32c sum for the file, hex-encoded, per RFC 4960 Appendix B.
experimentId ID, read-only ID of the experiment to which the file belongs.
filename String Name of the file.
md5 String, read-only The MD5 sum for the file, hex-encoded.
size Integer, read-only The number of bytes in the file.

Methods

upload

Uploads a file. The maximum file size is 5 TB.

Required Permissions

This API requires the following permissions:

  • "attachment.upload"
Request
POST https://cellengine.com/api/v1/experiments/:experimentId/attachments
Content-Type: multipart/form-data
---
<multipart form data including file>
Parameter Value Description
Path Parameters
experimentId String ID of the experiment to which the file belongs.
Body Parameters
* File The file contents. The name of the field does not matter.
Response
201 Created
Location: https://cellengine.com/api/v1/experiments/:experimentId/attachments/:attachmentId
---
{
    crc32c,
    experimentId,
    filename,
    md5,
    size
}

list

Lists attachments in the experiment.

Required Permissions

This API requires the following permissions:

  • "experiment.read"
Request
GET https://cellengine.com/api/v1/experiments/:experimentId/attachments
Parameter Value Description
Path Parameters
experimentId String ID of the experiment.
Optional Query Parameters
Standard query parameters for list routes

Do not supply a request body with this method.

Response
200 OK
Content-Type: application/json
---
[
    {<attachment>}
]

delete

Deletes an attachment.

Required Permissions

This API requires the following permissions:

  • "attachment.delete"
Request
DELETE https://cellengine.com/api/v1/experiments/:experimentId/attachments/:attachmentId
Parameter Value Description
Path Parameters
experimentId String ID of the experiment to which the file belongs.
attachmentId String ID of the attachment.

Do not supply a request body with this method.

Response
204 No Content

update

Updates a file. The only writable property is the filename; thus this method is only suitable for renaming an attachment.

Required Permissions

This API requires the following permissions:

  • "attachment.update"
Request
PATCH https://cellengine.com/api/v1/experiments/:experimentId/attachments
Content-Type: application/json
---
{
    "filename": "new filename.ext"
}
Parameter Value Description
Path Parameters
experimentId String ID of the experiment to which the file belongs.
attachmentId String ID of the attachment.
Body Parameters
filename String The name of the file.
Response
200 OK
---
{
    crc32c,
    experimentId,
    filename,
    md5,
    size
}

download

Downloads the file.

Required Permissions

This API requires the following permissions:

  • "experiment.read"
  • "attachment.download"
Request
GET https://cellengine.com/api/v1/experiments/:experimentId/attachments/:attachmentId
Parameter Value Description
Path Parameters
experimentId String ID of the experiment to which the file belongs.
attachmentId String ID of the attachment.

Do not supply a request body with this method.

Response
200 OK
Content-Disposition: attachment; filename="<filename>"
Content-Type: <mime-type>
---
<octet-stream>

Compensations

A compensation is a list of channel names and a corresponding square matrix. The matrix is technically a "spill"/"spillover" matrix, which is inverted to yield the compensation matrix; most applications refer to the spill matrix as a compensation matrix, however.

Resource Representation

Property Value Description
channels String[] The names of the channels to which this compensation matrix applies.
experimentId String, read-only The ID of the experiment to which this compensation belongs.
name String The name of the compensation.
spillMatrix Number[] The row-wise, square spillover matrix. The length of the array must be the number of channels squared.

Special Values

Wherever a compensation value can be supplied to the API, three special constants may be used:

Value Description
0 Uncompensated Do not apply a compensation.
-1 File-Internal Compensation Uses the file's internal compensation matrix, if available. If not available, an error will be returned.
-2 Per-File Compensation Use the compensation assigned to each individual FCS file. Not a valid value for FcsFile.compensation.

Methods

list

Lists compensations in the experiment.

Required Permissions

This API requires the following permissions:

  • "experiment.read"
Request
GET https://cellengine.com/api/v1/experiments/:experimentId/compensations
Parameter Value Description
Path Parameters
experimentId String ID of the experiment.
Optional Query Parameters
Standard query parameters for list routes

Do not supply a request body with this method.

Response
200 OK
Content-Type: application/json
---
[
    {<compensation>}
]

create

Creates a compensation matrix.

Required Permissions

This API requires the following permissions:

  • "compensation.create"
Request
POST https://cellengine.com/api/v1/experiments/:experimentId/compensations/
Content-Type: application/json
---
{
    "name": string,
    "channels": string[],
    "spillMatrix": number[]
}
Parameter Value Description
Path Parameters
experimentId String ID of the experiment to which the compensation belongs.
Body Parameters
channels String[] The names of the channels to which this compensation matrix applies.
name String The name of the compensation.
spillMatrix Number[] The row-wise, square spillover matrix. The length of the array must be the number of channels squared.
Response
201 Created
---
{
    channels,
    experimentId,
    name,
    spillMatrix
}

update

Updates a compensation matrix.

Required Permissions

This API requires the following permissions:

  • "compensation.update"
Request
PATCH https://cellengine.com/api/v1/experiments/:experimentId/compensations/:compensationId
Content-Type: application/json
---
{
    "name": string,
    "channels": string[],
    "spillMatrix": number[]
}
Parameter Value Description
Path Parameters
experimentId String ID of the experiment to which the compensation belongs.
compensationId String ID of the compensation matrix.
Optional Body Parameters
channels String[] The names of the channels to which this compensation matrix applies.
name String The name of the compensation.
spillMatrix Number[] The row-wise, square spillover matrix. The length of the array must be the number of channels squared.
Response
200 OK
---
{
    channels,
    experimentId,
    name,
    spillMatrix
}

delete

Deletes a compensation.

Required Permissions

This API requires the following permissions:

  • "compensation.delete"
Request
DELETE https://cellengine.com/api/v1/experiments/:experimentId/compensations/:compensationId
Parameter Value Description
Path Parameters
experimentId String ID of the experiment to which the file belongs.
compensationId String ID of the compensation.

Do not supply a request body with this method.

Response
204 No Content

Experiments

Resource Representation

Property Value Description
activeCompensation Compensation The most recently used compensation. Used to select the compensation in various parts of the Web interface.
annotationNameOrder String[] Order in which annotations appear in all tables in the Web interface.
annotationSources Object Sources of FCS file annotations, used to automatically annotate files on upload.
annotationSources.$ String (The annotation name, provided as the property name in the annotationSources object.)
annotationSources.$.source "filename"|"header" The source type: either part of the filename or a header keyword value.
annotationSources.$.key String For "header" sources the keyword name.
annotationSources.$.tokens String For "filename" sources the tokens (characters) used to split the filename.
annotationSources.$.index Number For "filename" sources the index of the value to extract from the split filename.
annotationTableSortColumns String|Number[] The current sorting state for the annotation table.
annotationValidators Object Validators that apply to FCS file annotations.
annotationValidators.$ String (The annotation name, provided as the property name in the annotationValidators object.)
annotationValidators.$.enum String[], optional String values allowed for the annotation.
annotationValidators.$.min Number, optional Minimum allowed value, when interpreted as a number.
annotationValidators.$.max Number, optional Maximum allowed value, when interpreted as a number.
annotationValidators.$.required Boolean, optional Whether or not a value is required for the annotation.
cloneSourceExperiment ID, optional, read-only Indicates the experiment from which this experiment was cloned, if applicable.
analysisSourceExperiment ID, optional, read-only If this is a derived analysis, its source experiment.
comments TextOp[] Comments about the experiment. This property is an array of TextOps, each of which is in the form {insert: "some text", attributes: {bold: false, italic: false, underline: false}}.
created Datetime, read-only The creation time of the experiment.
deleted Datetime The time when the experiment was moved to the trash. Experiments are permanently deleted approximately seven days after this time. Only modifiable by the primaryResearcher. Cannot be set on revision experiments, experiments that are locked or experiments with an active retention policy.
data Object May contain auxiliary information about the experiment, such as where it was imported from.
deepUpdated Datetime, read-only The last time that the experiment or any of its descendant resources (e.g. gates, scales) were modified. This property is eventually consistent; its value may not be updated instantaneously after a descendant resource is modified.
locked Boolean, read-only Whether or not the experiment is locked and cannot be modified. Locking an experiment locks all descendant resources as well, including gates and populations. Currently only true for revision experiments.
name String, max length 1024 The name of the experiment.
perFileCompensationsEnabled Boolean If per-file compensations are enabled for the experiment.
permissions[] Permission[], read-only List of permissions for the experiment. Only modifiable via the sharing API routes.
permissions[].grantDate Datetime When the permission was granted.
permissions[].grantor User User who granted the permission.
permissions[].grantee User User to whom the permission was granted.
permissions[].writeAccess Boolean Whether or not the permission provides write-access.
primaryResearcher User (partial representation) The user who is the primary researcher assigned to the experiment. Only modifiable by the primaryResearcher.
retentionPolicy.retainUntil Datetime A date until when this experiment cannot be deleted. (This date may be in the past if the retention policy has expired.) Note: retention policies may only be extended.
retentionPolicy.history[] RetentionPolicy[], read-only History of all changes to the experiment's retention policy.
retentionPolicy.history[].user ID, read-only ID of user who set the retention policy.
retentionPolicy.history[].retainUntil Datetime, read-only Date that the retention policy was set to.
retentionPolicy.history[].timestamp Datetime, read-only When Date when the retention policy was changed.
revisions[] Revision[], read-only List of revisions of the experiment.
revisions[]._id Experiment, read-only ID of the revision experiment.
revisions[].creator User, read-only User who created the revision.
revisions[].timestamp Datetime, read-only Timestamp when the revision was created.
revisions[].comments String, max length 1024 Comments about the revision, such as why it was saved.
revisionSourceExperiment ID, optional, read-only Indicates the experiment of which this experiment is a revision, if applicable.
sortingSpec Object Describes the way annotations, populations and channels are sorted.
tags String[] List of tags for the experiment.
updated Datetime, read-only The last time that the experiment was modified. This value is a shallow timestamp; it is not updated when descendant resources such as gates are modified. (See deepUpdated.)
uploader User (partial representation), read-only The user who created the experiment.

Methods

list

List experiments accessible to the requesting user (i.e. ones for which the user has the "experiment.read"permission).

Request
GET https://cellengine.com/api/v1/experiments
Parameter Value Description
Optional Query Parameters
Standard query parameters for list routes

Do not supply a request body with this method.

Response
200 OK
Content-Type: application/json
----
[
    {<experiment>}
]

create

Create an experiment. Creating an experiment also creates a blank ScaleSet for the experiment.

Required Permissions

This API requires the following permissions:

  • If the new experiment would be in a folder, "folder.createExperiment" on a parent folder.
Request
POST https://cellengine.com/api/v1/experiments
Content-Type: application/json
Parameter Value Description
Path Parameters
None
Body Parameters
name String Defaults to "Untitled Experiment".
comments String Defaults to none.
uploader User ID Defaults to user making request.
path String[] of ID Array of folder IDs comprising the path.
primaryResearcher User ID Defaults to user making request.
tags String[] Defaults to an empty array.
Response
201 Created
Location: <URI>
----
{<experiment>}

read

Gets an experiment.

Required Permissions

This API requires the following permissions:

  • "experiment.read"
Request
GET https://cellengine.com/api/v1/experiments/:experimentId
Parameter Value Description
Path Parameters
experimentId String ID of the experiment.

Do not supply a request body with this method.

Response
200 OK
----
{<experiment>}

update

Updates an experiment.

Required Permissions

This API requires the following permissions:

  • "experiment.read"
  • "experiment.update"
  • If setting deleted, "experiment.delete", as well as "folder.removeExperiment" if the experiment is in a folder
  • If moving the experiment (changing path), "experiment.move", as well as "folder.removeExperiment" on the current parent folder and "folder.createExperiment" on the new parent folder, if any
  • If changing primaryResearcher, "experiment.changePrimaryResearcher"
Request
PATCH https://cellengine.com/api/v1/experiments/:experimentId
Content-Type: application/json
Parameter Value Description
Path Parameters
experimentId String
Body Parameters
activeCompensation Compensation
annotationNameOrder String[]
annotationTableSortColumns String|Number[]
annotationTableColumnWidths Number[]
annotationSources Object
annotationValidators Object
comments TextOp[]
deleted Datetime
name String
perFileCompensationEnabled Boolean
primaryResearcher User ID
retentionPolicy.retainUntil Datetime
savedStatisticsExports Object[]
sortingSpec Object
tags String[]

See Experiment Resource Representation for a description of the parameters.

Response
200 OK
----
{<experiment>}

delete

Deletes the experiment immediately. To move the experiment to the trash, set its deleted property to the datetime at which it was deleted (generally the current datetime). It will be deleted permanently after approximately seven days.

Revision experiments, locked experiments and experiments with an active retentionPolicy cannot be deleted.

Required Permissions

This API requires the following permissions:

  • "experiment.delete"
  • "folder.removeExperiment" on an ancestor folder if the experiment is in a folder
Request
DELETE https://cellengine.com/api/v1/experiments/:experimentId
Parameter Value Description
Path Parameters
experimentId String ID of the experiment to which the file belongs.

Do not supply a request body with this method.

Response
204 No Content

clone

Cloning an experiment saves a deep copy of the experiment and all of its resources, including attachments, FCS files, gates and populations.

Cloned experiments do not count toward your account's resource usage.

Required Permissions

This API requires the following permissions:

  • "experiment.read"
  • "experiment.clone"
  • "folder.createExperiment" if the experiment would be created in a folder
Request
POST https://cellengine.com/api/v1/experiments/:experimentId/clone
Content-Type: application/json
Parameter Value Description
Path Parameters
experimentId String ID of the experiment to which the file belongs.
Body Parameters
name String
path String[] Array of folder IDs comprising the path.

See Experiment Resource Representation for a description of the parameters.

Response
201 Created
Location: <URI>
----
{<experiment>}

save revision

Required Permissions

This API requires the following permissions:

  • "experiment.read"
  • "experiment.saveRevision"

change permissions

import from BD FACSDiva

Required Permissions

This API requires the following permissions:

  • "gate.create"
  • "population.create"
  • "scaleset.update"
  • "illustration.create"

import gates, populations, compensations and/or illustrations from another experiment

Required Permissions

This API requires the following permissions:

  • "experiment.read" on the source experiment
  • "population.create" if importing gates and populations
  • "gate.create" if importing gates and populations
  • "illustration.create" if importing illustrations
  • "compensation.create" if importing compensations

export populations to new experiment

Required Permissions

This API requires the following permissions:

  • "experiment.read"
  • "experiment.clone"

export Gating-ML

Generates a Gating-ML 2.0 XML file containing the experiment's compensation matrices, gates, populations and scales.

Please see the documentation for exporting Gating-ML for a list of limitations of the Gating-ML specification and workarounds.

Required Permissions

This API requires the following permissions:

  • "experiment.read"
Request
GET https://cellengine.com/api/v1/experiments/:experimentId.gatingml
Parameter Value Description
Path Parameters
experimentId String ID of the experiment.
Optional Query Parameters
fcsFileId String If provided, the Gating-ML file will contain this FCS file's tailored gates (in addition to any non-tailored gates). If omitted, the file will contain the global gates.
Response
200 OK
Content-Disposition: attachment; filename="<filename>"
Content-Type: application/vnd.isac.gating-ml+xml
----
<xml>

export JSON

Generates a JSON file containing all of the resources in the experiment.

Required Permissions

This API requires the following permissions:

  • "experiment.read"
Request
GET https://cellengine.com/api/v1/experiments/:experimentId.json
Parameter Value Description
Path Parameters
experimentId String ID of the experiment.
Response
200 OK
Content-Type: application/json
----
{
    experiment: <experiment>,
    attachments: [<attachment>],
    compensations: [<compensations],
    fcsFiles: [<fcsFiles>],
    scaleSets: [<scaleSets>],
    gates: [<gates>],
    populations: [<populations>],
    illustrations: [<illustrations>]
}

FCS Files

FCS files are the standard data representation for flow cytometry.

In CellEngine, an fcsfile resource represents the file itself, along with metadata such as the panel and annotations.

Each FCS file has its own panel. A channel is an array of objects containing the channel name ("channel"), channel reagent ("reagent") and index of the channel in the file. The Web UI will display all files with the same "panelName" in the same panel. Note that channels for different files may be in any order within the same panel (e.g. PacBlu can be channel 1 in file 1, and channel 3 in file 2). Consumers of the API are expected to keep the channel names and reagent names for all files with the same panelName consistent. Failure to do so is benign when making requests pertaining to single files, but may cause an error, warning message or undefined behavior when making requests pertaining to multiple files or when working from the Web UI.

Resource Representation

Property Value Description
annotations[] Annotation[] Metadata about the file.
annotations[].name String Name of the annotation (i.e. the key).
annotations[].value String Value of the annotation.
compensation Compensation, optional Used with per-file compensation to indicate the compensation to apply to this file.
crc32c String, read-only The CRC32c sum for the file, hex-encoded, per RFC 4960 Appendix B.
deleted Datetime If true, the file has been soft-deleted and may be permanently deleted later.
eventCount Integer, read-only The number of events (rows) in the file.
experimentId String, read-only ID of the experiment that this file belongs to.
filename String The filename.
gatesLocked Boolean If true, no gates that apply to this file can be changed.
hasFileInternalComp Boolean, read-only Whether or not this file has a valid file-internal compensation matrix.
header JSON String, read-only The file header stored as a JSON string.
isControl Boolean Whether or not this is a control file. Control files are hidden from most of the Web UI, and can be used to exclude compensation or calibration beads from analysis, for example.
md5 String, read-only The MD5 sum for the file, hex-encoded.
panel[] Channel[] The file's panel.
panel[].channel String The channel name.
panel[].reagent String, optional The reagent for the channel.
panel[].index Integer The 1-based index of the channel in the file.
panelName String The name of the file's panel. Files with the same panelName are grouped into a panel.
sampleName String, read-only The sample name extracted from the file header.
size Integer, read-only The number of bytes in the file.
spillString String, read-only, optional The file-internal compensation, if present.

Methods

list

Required Permissions

This API requires the following permissions:

  • "experiment.read"
Request

Gets the list of all FCS files for the experiment.

Control files are excluded by default; use ?includeControls=true in the query to include them.

Soft-deleted FCS files are included by default; use ?eq(deleted,null) in the query to exclude them.

The header field is not returned by default due to its size. To include it, specify fields=+header in the query.

GET https://cellengine.com/api/v1/experiments/:experimentId/fcsfiles
Parameter Value Description
Path Parameters
experimentId String ID of the experiment to which the file belongs.
Optional Query Parameters
Standard query parameters for list routes
includeControls Boolean Include control FCS files. Defaults to false.

Do not supply a request body with this method.

Response
200 OK
Content-Type: application/json
---
[
    {<fcsfile>}
]
Example: query FCS files by annotation

If you have annotated your files, you can perform lookups by those annotations. For example, to find files with "plate column" equal to "A":

GET https://cellengine.com/api/v1/experiments/:experimentId/fcsfiles?query=elemMatch(annotations, eq(name, "plate column"), eq(value, "A"))

(Shown before URL encoding, which would convert spaces to %20 and quotation marks to %22.)

To find files that match on multiple criteria, combine multiple elemMatch operators with and. For more information on query operators, see standard query parameters for list routes.

upload

Uploads a file. The maximum file size is approximately 2.3 GB. Contact us if you need to work with larger files.

Automatically parses panels and annotations and updates ScaleSets to include all channels in the file.

Required Permissions

This API requires the following permissions:

  • "fcsfile.upload"
Request
POST https://cellengine.com/api/v1/experiments/:experimentId/fcsfiles
Content-Type: multipart/form-data
---
<multipart form data including file>
Parameter Value Description
Path Parameters
experimentId String ID of the experiment to which the file belongs.
Body Parameters
* File The file contents. The name of the field does not matter.
Response
201 Created
Location: https://cellengine.com/api/v1/experiments/:experimentId/fcsfiles/:fcsFileId
---
{<fcsfile>}

create

Creates an FCS file by copying, concatenating and/or subsampling existing file(s) from this or other experiments, or by importing from an S3-compatible service. This endpoint can be used to import files from other experiments.

When concatenating and subsampling at the same time, subsampling is applied to each file before concatenating.

If addFileNumber is true, a file number column (channel) will be added to the output file indicating which file each event (cell) came from. The values in this column have a uniform random spread (±0.25 of the integer value) to ease visualization. While this column can be useful for analysis, it will cause the experiment to have FCS files with different panels unless all FCS files that have not been concatenated are deleted.

During concatenation, any FCS header parameters that do not match between files will be removed, with some exceptions:

  • $BTIM (clock time at beginning of acquisition) and $DATE will be set to the earliest value among the input files.
  • $ETIM (clock time at end of acquisition) will be set to the latest value among the input files.
  • $PnR (range for parameter n) will be set to the highest value among the input files.

All channels present in the first FCS file in the fcsFiles parameter must also be present in the other FCS files.

When importing from an S3-compatible service, be aware of the following:

  • Only a single file can be imported at a time.
  • The host property must include the bucket and region as applicable. For example, for AWS, this would look like mybucket.s3.us-east-2.amazonaws.com.
  • The path property must specify the full path to the object, e.g. /Study001/Specimen01.fcs.
  • Importing private S3 objects requires an accessKey and a secretKey for a user with appropriate permissions. For AWS, GetObject is required.
  • Importing objects may incur fees from the S3 service provider.
Required Permissions

This API requires the following permissions:

  • "fcsfile.upload"
  • If importing files from another experiment, "experiment.read" and "experiment.clone" on the source experiment(s).
Request
POST https://cellengine.com/api/v1/experiments/:experimentId/fcsfiles
Content-Type: application/json
Parameter Value Description
Path Parameters
experimentId String ID of the experiment to which the file belongs.
Required Body Parameters
fcsFiles String[]|{_id: String, experimentId: String}[]|{host: String, path: String, accessKey?: String, secretKey?: String}[] List of file IDs or objects to process. If more than one file is provided, they will be concatenated in order. To import files from other experiments, provide an array of objects with _id and experimentId properties. To import a file from an S3-compatible service, provide a length-1 array of objects with host and path; if the S3 object is private, additionally provide accessKey and secretKey.
Optional Body Parameters
addFileNumber Boolean If concatenating files, adds a file number channel to the resulting file.
addEventNumber Boolean Add an event number column to the exported file. This number corresponds to the index of the event in the original file; when concatenating files, the same event number will appear more than once.
filename String Filename to use for the created file. Required if concatenating or subsampling.
preSubsampleN Integer Randomly subsample the file to contain this many events.
preSubsampleP Number Randomly subsample the file to contain this percent of events (0 to 1).
seed Number Seed for random number generator used for subsampling. Use for deterministic (reproducible) subsampling. If omitted, a pseudo-random value is used.
Response
201 Created
Location: https://cellengine.com/api/v1/experiments/:experimentId/fcsfiles/:fcsFileId
---
{<fcsfile>}

download file or population or send to S3 (FCS or TSV)

Retrieves the FCS file in either FCS or TSV format. Optionally gates a specified population and/or subsamples. The file can either be downloaded or sent to an S3-compatible service.

Set the original query parameter to true to retrieve the original FCS file verbatim. When exporting as FCS format with the original parameter set to false or left unspecified, the following apply:

  • The current value of the file's panel property will be used to set the $PnS (reagent) header keywords.
  • The compensatedQ and compensationId parameters will be used to set the $SPILLOVER header keyword.
  • Other synonymous changes may be present. For example, the DATA segment will always be little-endian.

When exporting as TSV format, the file's panel property will be used to set the column headers.

When sending the file to an S3-compatible service, use the POST HTTP method and supply a dest object in the body, as documented below.

Required Permissions

This API requires the following permissions:

  • "experiment.read"
  • "fcsfile.download"
Request

The request may be either GET or POST. Use GET when downloading the file; use POST when sending the file to an S3-compatible service.

GET https://cellengine.com/api/v1/experiments/:experimentId/fcsfiles/:fcsFileId.fcs
POST https://cellengine.com/api/v1/experiments/:experimentId/fcsfiles/:fcsFileId.fcs
GET https://cellengine.com/api/v1/experiments/:experimentId/fcsfiles/:fcsFileId.tsv
POST https://cellengine.com/api/v1/experiments/:experimentId/fcsfiles/:fcsFileId.tsv
Parameter Value Description
Path Parameters
experimentId String ID of the experiment.
fcsFileId String ID of the file.
Optional Query Parameters
compensatedQ Boolean If true, applies the compensation specified in compensationId to the exported events. For TSV format, the numerical values will be the compensated values. For FCS format, the numerical values will be unchanged, but the file header will contain the compensation as the spill string (file-internal compensation).
compensationId Compensation Required if populationId is specified. Compensation to use for gating.
headers Boolean For TSV format only. If true, a header row containing the channel names will be included.
original Boolean If true, the returned file will be byte-for-byte identical to the originally uploaded file. If false or unspecified (and compensatedQ is false, populationId is unspecified and all subsampling parameters are unspecified), the returned file will contain essentially the same data as the originally uploaded file, but may not be byte-for-byte identical. For example, the byte ordering of the DATA segment will always be little-endian and any extraneous information appended to the end of the original file will be stripped. This parameter takes precedence over compensatedQ, populationId and the subsampling parameters.
populationId String If provided, only events from this population will be included in the output file.
postSubsampleN Integer Randomly subsample the file to contain this many events after gating.
postSubsampleP Number Randomly subsample the file to contain this percent of events (0 to 1) after gating.
preSubsampleN Integer Randomly subsample the file to contain this many events before gating.
preSubsampleP Number Randomly subsample the file to contain this percent of events (0 to 1) before gating.
seed Number Seed for random number generator used for subsampling. Use for deterministic (reproducible) subsampling. If omitted, a pseudo-random value is used.
addEventNumber Boolean Add an event number column to the exported file. When a populationId is specified (when gating), this number corresponds to the index of the event in the original file.
Optional Body Parameters
dest Object If copying to an S3-compatible service, information about that service.
dest.host String Required for S3 transfers. The full S3 host, including the bucket and region as applicable. For example, for AWS, this would look like mybucket.s3.us-east-2.amazonaws.com.
dest.path String The path prefix for the object. This is concatenated directly with the file name. Use a trailing "/" to specify a "directory" in S3. For example, if the path is /Study001/ and the file is called Specimen01.fcs, the object key will be /Study001/Specimen01.fcs. Use no trailing slash to specify a file prefix. For example, if the path is /transfer1_, the object key will be /transfer1_Specimen01.fcs. Note that S3 object keys must start with "/"; a path of "" will result in an Invalid URI response. Defaults to "/".
dest.accessKey String Required for private buckets. The S3 access key. Must be associated with an account with appropriate S3 permissions (e.g. PutObject).
dest.secretKey String Required for private buckets. The S3 secret key.
dest.headers Object Custom headers to include in the S3 request. Common examples are x-amz-storage-class/x-goog-storage-class and x-amz-server-side-encryption. Some headers, such as Content-Length, Content-MD5 and Content-Type, cannot be modified. Refer to https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html for AWS header documentation and https://cloud.google.com/storage/docs/migrating#custommeta regarding compatibility with Google Cloud Platform.
Response

If downloading the file as FCS:

200 OK
Content-Disposition: attachment; filename="<filename>"
Content-Type: application/vnd.isac.fcs
----
<octet-stream>

If downloading the file as TSV:

200 OK
Content-Disposition: attachment; filename="<filename>"
Content-Type: text/tab-separated-values; charset=utf-8
----
<text>

If sending the file to an S3-compatible service:

200 OK
Content-Type: application/json
---
{
    "s3Status": 200,
    "s3StatusMessage": "OK",
    "s3Headers": {
        "x-amz-id-2": "5Z4FF2oZq7z/EaUkT+dg8pOX+i6lym3FRrIcxycB+4UEgo04Xqy/rWjAU935PcUBzUwb6dyT00A=",
        "x-amz-request-id": "P0TFRCZ7SMW2JTGE",
        "date": "Sat, 11 Sep 2021 01:55:40 GMT",
        "etag": "\"3613a1e91e28bb78da20105654dd779c\"",
        "server": "AmazonS3",
        "content-length": "0",
        "connection": "close"
    }
    "s3Response": ""
}

download multiple files or populations (FCS or TSV)

Downloads multiple files bundled into a ZIP archive. Files can either be gated or ungated.

There are two ways to make this request: GET or POST. The GET request can be easier to make, but when requesting many files or populations the maximum URL length could be exceeded. (The combination of the request URL and headers together must be less than about 15 KB.) The POST route instead allows the parameters to be passed in the request body, for which there is no practical maximum size.

Every combination of fcsFileIds and populationIds will be exported (i.e. every population for every FCS file specified).

Unless the original, unmodified FCS files are being exported, the current values of the files' panel properties will be used to set the $PnS (reagent) header keywords.

Required Permissions

This API requires the following permissions:

  • "experiment.read"
  • "fcsfile.download"
GET Request
GET https://cellengine.com/api/v1/experiments/:experimentId/fcsfiles/zip
Parameter Value Description
Path Parameters
experimentId String ID of the experiment.
Optional Query Parameters
fcsFileIds String[] Optional. Defaults to returning all non-control files in the experiment.
populationIds String[] Optional. If provided, only events from these populations will be included in the output files. Defaults to ungated.
compensationId Compensation Required if populationIds is specified. Compensation to use for gating.
compensatedQ Boolean Optional. If true, applies the compensation specified in compensationId to the exported events. For TSV format, the numerical values will be the compensated values. For FCS format, the numerical values will be unchanged, but the file header will contain the compensation as the spill string (file-internal compensation).
addEventNumber Boolean Add an event number column to the exported file. When populationIds is specified (when gating), this number corresponds to the index of the event in the original file.
Required Query Parameters
format fcs, tsv (with header) or tsv (without header), case-insensitive Specifies the format.
preSubsampleN Integer Randomly subsample the file to contain this many events before gating.
preSubsampleP Number Randomly subsample the file to contain this percent of events (0 to 1) before gating.
postSubsampleN Integer Randomly subsample the file to contain this many events after gating.
postSubsampleP Number Randomly subsample the file to contain this percent of events (0 to 1) after gating.
seed Number Seed for random number generator used for subsampling. Use for deterministic (reproducible) subsampling. If omitted, a pseudo-random value is used.

Do not supply a request body with this method.

POST Request
POST https://cellengine.com/api/v1/experiments/:experimentId/fcsfiles/zip
Content-Type: application/json
Parameter Value Description
Path Parameters
experimentId String ID of the experiment.
Optional Body Parameters
fcsFileIds String[] Optional. Defaults to returning all files in the experiment.
populationIds String[] Optional. If provided, only events from these populations will be included in the output files. Defaults to ungated.
compensationId Compensation Required if populationIds is specified. Compensation to use for gating.
compensatedQ Boolean Optional. If true, applies the compensation specified in compensationId to the exported events. For TSV format, the numerical values will be the compensated values. For FCS format, the numerical values will be unchanged, but the file header will contain the compensation as the spill string (file-internal compensation).
preSubsampleN Integer Randomly subsample the file to contain this many events before gating.
preSubsampleP Number Randomly subsample the file to contain this percent of events (0 to 1) before gating.
postSubsampleN Integer Randomly subsample the file to contain this many events after gating.
postSubsampleP Number Randomly subsample the file to contain this percent of events (0 to 1) after gating.
seed Number Seed for random number generator used for subsampling. Use for deterministic (reproducible) subsampling. If omitted, a pseudo-random value is used.
filenameTemplate String Tokenized template to dynamically name each file in the resulting archive.
Required Body Parameters
format fcs, tsv (with header) or tsv (without header), case-insensitive Specifies the format.
Response
Status: 303
Location: <redirect location>
---

Making a GET request to the redirected location yields the following response:

Status: 200
Content-Disposition: attachment; filename="<experiment name> - Gated Populations.zip"
Content-Type: application/zip
Content-Length: <length>
----
<octet-stream>

read

Gets metadata about the file.

Required Permissions

This API requires the following permissions:

  • "experiment.read"
Request
GET /experiments/:experimentId/fcsfiles/:fcsFileId
Parameter Value Description
Path Parameters
experimentId String ID of the experiment.
fcsFileId String ID of the file.

Do not supply a request body with this method.

Response
Status: 200 OK
----
{<fcsfile>}

delete

Deletes the file immediately. To soft-delete a file, set its deleted property instead.

Required Permissions

This API requires the following permissions:

  • "fcsfile.delete"
Request
DELETE https://cellengine.com/api/v1/experiments/:experimentId/fcsfiles/:fcsFileId
Parameter Value Description
Path Parameters
experimentId String ID of the experiment to which the file belongs.
fcsFileId String ID of the FCS file.

Do not supply a request body with this method.

Response
Status: 204 No Content

bulk delete

Deletes multiple files. To soft-delete files, set their deleted properties instead.

Required Permissions

This API requires the following permissions:

  • "fcsfile.delete"
Request
POST https://cellengine.com/api/v1/experiments/:experimentId/fcsfiles/bulkdelete
Parameter Value Description
Path Parameters
experimentId String ID of the experiment to which the file belongs.
Required Body Parameters
(unnamed) String[] Array of IDs of the FCS files.

Do not supply a request body with this method.

Response
Status: 200
Content-Type: application/json
---
{
    nDeleted: <n>
}

update

Modifies an FCS file's metadata.

When modifying annotations, the characters \r and \n and leading and trailing whitespace will automatically be removed from annotation values by the server.

Note that if the experiment has annotationValidators and the request includes changes to annotations that would violate those validators, the change will still be applied. You must make an additional request to validate the FCS files using the validate endpoint.

Required Permissions

This API requires the following permissions:

  • "fcsfile.update"
  • If setting deleted, "fcsfile.delete"
Request
PATCH https://cellengine.com/api/v1/experiments/:experimentId/fcsfiles/:fcsFileId
Parameter Value Description
Path Parameters
experimentId String ID of the experiment to which the file belongs.
fcsFileId String ID of the FCS file.
Optional Body Parameters
filename String
panel[] Channel[]
panel[].channel String
panel[].reagent String Optional; only channel and index are required.
panel[].index Integer
panelName String
isControl Boolean
compensation Compensation
deleted Datetime
gatesLocked Boolean
annotations[] Annotation[]
annotations[].name String
annotations[].value String

See FCS File Resource Representation for a description of the parameters.

Response
Status: 200 OK
----
{<fcsFile>}

bulk update

Modifies multiple FCS files' metadata. Only a subset of FCS file properties may be modified from this API. If you have a need to modify additional properties in bulk, email support@cellengine.com.

When modifying annotations, the characters \r and \n and leading and trailing whitespace will automatically be removed from annotation values by the server.

Note that if the experiment has annotationValidators and the request includes changes to annotations that would violate those validators, the change will still be applied. You must make an additional request to validate the FCS files using the validate endpoint.

Required Permissions

This API requires the following permissions:

  • "fcsfile.update"
  • If setting deleted, "fcsfile.delete"
Request
POST https://cellengine.com/api/v1/experiments/:experimentId/fcsfiles/bulkupdate
Parameter Value Description
Path Parameters
experimentId String ID of the experiment to which the file belongs.
Optional Body Parameters
[].filename String
[].gatesLocked Boolean
[].isControl Boolean
[].compensation Compensation
[].annotations[] Annotation[]
[].annotations[].name String
[].annotations[].value String

See FCS File Resource Representation for a description of the parameters.

Response
Status: 204 No Content

validate annotations

Tests all or some files in the experiment for compliance with the experiment's annotationValidators.

Required Permissions

This API requires the following permissions:

  • "experiment.read"
Request
GET https://cellengine.com/api/v1/experiments/:experimentId/fcsfiles/validate
Parameter Value Description
Path Parameters
experimentId String ID of the experiment to which the file belongs.
Optional Query Parameters
fcsFileId String ID of a specific FCS file to test. Repeat the query parameter to test multiple files.
Response
Status: 200 OK
---
[{
    _id: string,
    valid: boolean,
    errors: string[]
}]
Parameter Value Description
[]._id String FCS file ID.
[].valid Boolean True if the file complies with all validators.
[].errors String[] List of violations.

rename reagent

Required Permissions

This API requires the following permissions:

  • "fcsfile.update"

rename panel

Required Permissions

This API requires the following permissions:

  • "fcsfile.update"

delete annotation

Required Permissions

This API requires the following permissions:

  • "fcsfile.update"

rename annotation

Required Permissions

This API requires the following permissions:

  • "fcsfile.update"

add annotations from header

Required Permissions

This API requires the following permissions:

  • "fcsfile.update"

Gates

Gates are geometric shapes within which events (cells) must be contained to be considered part of a population.

Gates may be any one of RectangleGate, PolygonGate, EllipseGate, RangeGate, QuadrantGate or SplitGate.

When tailoring a gate to a file, a new gate is created with the same GID as the original gate, but with an fcsFileId property set to the file to which the gate is tailored. The update and delete API endpoints accept requests by GID to make for efficient updates to families of tailored gates.

Compound gates (quadrant and split) are made up of "sectors." Quadrant gates have four sectors (upper-right, upper-left, lower-left, lower-right) and split gates have two sectors (left and right). In addition to the top-level GID (like simple gates), these gates have model.gids and names lists that specify the GID and name for each sector, in the order shown above. Populations using compound gates must reference these sector GIDs; referencing the top-level GID of a compound gate is meaningless.

Resource Representation

Property Value Description
experimentId ID, read-only ID of the experiment to which the gate belongs.
name String Name of the gate. (Not used for compound gates.)
type RectangleGate, PolygonGate, EllipseGate, RangeGate, QuadrantGate, SplitGate The type of the gate.
gid String The gate "group ID." Families of tailored gates all use the same GID, but have unique _id and fcsFileId values.
xChannel String The name of the X channel.
yChannel String Required for 2D gates (i.e. not RangeGate or SplitGate). The name of the Y channel.
tailoredPerFile Boolean If true, indicates that gates with this GID are tailored per-file.
fcsFileId String If tailoredPerFile=true, the ID of the FCS file to which this gate is tailored. If blank, this is the default gate that will be used when there is no gate with the required GID and fcsFileId.
model Gate The geometric description of the gate. See tables below for type-specific information.
model.label Number[] X, Y coordinate of the gate label. (Not used for compound gates.)
model.locked Boolean If true, the gate cannot be moved in the Web UI.

RectangleGate

Property Value Description
model.rectangle.x1 Number
model.rectangle.y1 Number
model.rectangle.x2 Number
model.rectangle.y2 Number

PolygonGate

Property Value Description
model.polygon.vertices Number[][] Array of X, Y coordinates, e.g. [[x1, y1], [x2, y2], [x3, y3]]. May contain up to 300 vertices. If you require more than 300 vertices, please contact us.

EllipseGate

Property Value Description
model.ellipse.center Number[] X, Y coordinate of the ellipse center point.
model.ellipse.major Number Length of the semi-major axis.
model.ellipse.minor Number Length of the semi-minor axis. (Note that this may be larger than the major value.)
model.ellipse.angle Number Rotation of the ellipse.

RangeGate

Property Value Description
model.range.x1 Number Position of the first vertical line.
model.range.x2 Number Position of the second vertical line.
model.range.y Number Vertical position of the dashed line joining the vertical lines.

QuadrantGate

Property Value Description
model.quadrant.x Number Position of the center point.
model.quadrant.y Number Position of the center point.
model.quadrant.angles Number[] Angles at which the quadrant lines appear, in radians. Zero (0) points horizontally to the right; angles proceed counter-clockwise.
model.gids ID[] GIDs of the sectors.
names String[] Names of the sectors.
model.labels Number[][] X, Y coordinates of the gate labels.

Quadrant gate sectors are half-open: the bottom and left edges are inclusive, and the top and right edges are exclusive. This ensures that every event appears in exactly one sector. Angles are sorted when gate membership is calculated, meaning that no two sectors can overlap each other.

SplitGate

Property Value Description
model.split.x Number Position of the center point.
model.split.y Number Vertical position of the dashed line extending from the vertical line.
model.gids ID[] GIDs of the sectors.
names String[] Names of the sectors.
model.labels Number[][] X, Y coordinates of the gate labels.

Split gate sectors are half-open: the left edge is inclusive, and the right edge is exclusive. This ensures that every event appears in exactly one sector.

Methods

list

Required Permissions

This API requires the following permissions:

  • "experiment.read"
Request
GET /experiments/:experimentId/gates/
Parameter Value Description
Path Parameters
experimentId String ID of the experiment.
Optional Query Parameters
Standard query parameters for list routes

Do not supply a request body with this method.

Response
200 OK
Content-Type: application/json
---
[
    {<gate>}
]

create

Create one or multiple gates.

Required Permissions

This API requires the following permissions:

  • "gate.create"
  • "population.create" if createPopulation is true
Request
POST https://cellengine.com/api/v1/experiments/:experimentId/gates
Content-Type: application/json
Parameter Value Description
Path Parameters
experimentId String ID of the experiment to which the file belongs.
Optional Query Parameters
createPopulation Boolean Automatically create corresponding population(s). Defaults to false. Not available for bulk gate creation.
parentPopulationId String For use with createPopulation=true. Specifies the parent population.
Required Body Parameters
* Gate or Gate[] A single gate or array of gates to create.

The requests body must be less than 1 MB. As a typical gate is less than 1 kB, approximately 1,000 gates may be created at once.

If any gates fail validation, no gates will be created.

When creating tailored gates, the global gate (with fcsFileId set to null) must exist before creating the tailored gates.

Response

For single gates, without createPopulation query param, or with createPopulation=false:

201 Created
Location: path to new gate
----
<gate>

With createPopulation=true

201 Created
----
{
    gate: <gate>,
    population: <population>
}

For multiple gates:

201 Created
----
[<gate>, <gate>, ...]

update

Required Permissions

This API requires the following permissions:

  • "gate.update"
  • "gate.lock" if setting locked=true
  • "gate.unlock" if setting locked=false
Request
PATCH https://cellengine.com/api/v1/experiments/:experimentId/gates/:gateID
Response

Returns an object reflecting the updated gate.

update family

Required Permissions

This API requires the following permissions:

  • "gate.update"
  • "gate.lock" if setting locked=true
  • "gate.unlock" if setting locked=false
Request
PATCH https://cellengine.com/api/v1/experiments/:experimentId/gates?gid=:GID
Response

Returns an object indicating how many gates were modified: {nModified: <Integer>}.

delete

Deletes a gate or tailored gate family.

If deleting a global gate (with fcsFileId set to null), all tailored gates with the same gid must be deleted first. Otherwise, a 400 error will occur.

When deleting compound gates, the top-level gid must be used; specifying the gid of a sector (i.e. one listed in model.gids) will result in no gates being deleted.

If the operation results in no gates remaining with the same GID, then that GID will be removed from all populations in the experiment. The number of modified populations is reflected in the response.

Required Permissions

This API requires the following permissions:

  • "gate.delete"
Request
DELETE https://cellengine.com/api/v1/experiments/:experimentId/gates/:gateId
DELETE https://cellengine.com/api/v1/experiments/:experimentId/gates?gid=:GID[&exclude=:gateID]
Parameter Value Description
Path Parameters
experimentId String ID of the experiment to which the file belongs.
Optional Path Parameters
gateId String ID of the gate, if deleting a single gate.
Required Query Parameters
gid String GID of the gate family, if deleting a whole tailored gate family.
Optional Query Parameters
exclude String Deprecated ID of a single gate to keep, if deleting a whole tailored gate family.

Deprecated exclude parameter

The exclude query parameter is deprecated and will be removed in the future. While this parameter can be used in a two-step process to untailor gates (the first step deleting all but the to-be-global gate, and the second step making the to-be-global gate the global gate by setting its fcsFileId to null), that two-step process puts the CellEngine experiment in an error state between the first and second steps by having a tailored gate without a global gate.

To safely untailor gates, use the disable tailoring API instead.

Do not supply a request body with this method.

Response
200 OK
Content-Type: application/json
---
{
    nRemoved: <Integer>,
    populations: {
        nModified: <Integer>
    }
}

Apply tailoring

Sets the gate provided in the request body as the gate for the specified FCS files. If tailored gates already exist for any of the specified FCS files, those gates will be deleted (if the provided gate matches the global gate) or updated (if the provided gate does not match the global gate); otherwise, gates will be created.

Required Permissions

This API requires the following permissions:

  • "gate.update"
Request
POST https://cellengine.com/api/v1/experiments/:experimentId/gates/:gateId
DELETE https://cellengine.com/api/v1/experiments/:experimentId/gates?gid=:GID[&exclude=:gateID]
Parameter Value Description
Path Parameters
experimentId String ID of the experiment.
Required Query Parameters
gid String GID of the gate family.
Required Body Parameters
fcsFileIds String[] IDs of files to which to apply tailoring.
gate Object The gate object to apply to the files. experimentId, gid, tailoredPerFile and _id are not required.

Do not supply a request body with this method.

Response
200 OK
Content-Type: application/json
---
{
    updated: {_id: string, fcsFileId: string}[],
    updated: {_id: string, fcsFileId: string}[],
    deleted: {_id: string, fcsFileId: string}[]
}

Disable tailoring

Disables tailoring for a gate family, making a gate into the global gate.

When specifying a compound gate, the top-level gid must be used; using the gid of a sector (i.e. one listed in model.gids) is an error.

Required Permissions

This API requires the following permissions:

  • "gate.delete"
  • "gate.update"
Request
POST https://cellengine.com/api/v1/experiments/:experimentId/gates/disabletailoring
Parameter Value Description
Path Parameters
experimentId String ID of the experiment to which the file belongs.
Required Body Parameters
gid String GID of the gate family for which to disable tailoring.
globalGateId String ID of the gate to make the new global gate.
Response
200 OK
Content-Type: application/json
---
{
    nRemoved: <Integer>
}

Plots

Methods

get

Required Permissions

This API requires the following permissions:

  • "experiment.read"
Request
GET https://cellengine.com/api/v1/experiments/:experimentId/plot
Parameter Value Description
Path Parameters
experimentId String ID of the experiment to which the file belongs.
Required Query Parameters
fcsFileId String FCS file ID.
plotType contour, dot, density or histogram (case-insensitive) Plot type.
xChannel String X channel name.
yChannel String for 2D plots Y channel name.
zChannel String for dot plots colored by a 3rd channel Color channel name.
Optional Query Parameters
axesQ Boolean Display axes lines. Defaults to true.
axisLabelsQ Boolean Display axis labels. Defaults to true.
color String Case-insensitive string in the format #rgb, #rgba, #rrggbb or #rrggbbaa. The foreground color, i.e. color of curves in "histogram" and "contour" plots, dots in "dot" plots.
compensation Compensation Compensation to use for gating and display.
gateLabel String One of "eventcount", "mean", "median", "percent", "mad", "cv", "stddev", "geometricmean", "name", "none".
gateLabelFontSize Number Font size for gate labels.
height Integer Image height. Defaults to 228.
percentileStart Number For contour plots, the percentile of the first contour.
percentileStep Number For contour plots, the percentile step between each contour.
populationId Population Defaults to ungated.
postSubsampleN Integer Randomly subsample the file to contain this many events after gating.
postSubsampleP Number Randomly subsample the file to contain this percent of events (0 to 1) after gating.
preSubsampleN Integer Randomly subsample the file to contain this many events before gating.
preSubsampleP Number Randomly subsample the file to contain this percent of events (0 to 1) before gating.
renderGates Boolean Render gates into the image.
seed Number Seed for random number generator used for subsampling. Use for deterministic (reproducible) subsampling. If omitted, a pseudo-random value is used.
smoothing Number 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 Number The thickness of histogram and contour plot lines. Defaults to 1.
tickLabelsQ Boolean Display tick labels. Defaults to false.
ticksQ Boolean Display ticks. Defaults to true.
width Integer Image width. Defaults to 228.
xAxisLabelQ Boolean Display x axis label. Overrides axisLabelsQ.
xAxisQ Boolean Display x axis line. Overrides axesQ.
xTickLabelsQ Boolean Display x tick labels. Overrides tickLabelsQ.
xTicksQ Boolean Display x ticks. Overrides ticksQ.
yAxisLabelQ Boolean Display y axis label. Overrides axisLabelsQ.
yAxisQ Boolean Display y axis line. Overrides axesQ.
yTickLabelsQ Boolean Display y tick labels. Overrides tickLabelsQ.
yTicksQ Boolean Display y ticks. Overrides ticksQ.
Response
200 OK
Content-Type: image/png
---
<octet-stream>

Populations

On a biological basis, populations are groups of cells that are analyzed together. For example, you may have a "T cells" population or a "STAT3 positive" population. On an implementation basis, populations are combinations of gates.

(Preface: In all examples below, population names are used for ease of discussion. In reality, gate GIDs are used.)

Simple populations look like {"$and": [singlets, T cells, CD4+]}, which would mean that events must be in "singlets" AND "T cells" AND "CD4+". Populations will almost always use the "$and" operator.

More complex populations can be built with combinations of "$and", "$or", "$not" and "$xor":

{"$and": [
    singlets,
    CD3+,
    {"$or": [CD4+, CD8+]}
]}

This would require cells to be in "singlets" AND "CD3+" AND either "CD4+" OR "CD8+". (It would not select CD4+/CD8+ double-positive cells.)

{"$and": [
    singlets,
    {"$not": dead}
]}

This would return cells in "singlets" and not in "dead".

{"$and": [
    singlets,
    leukocytes,
    {"$not": [
        CD3+,
        CD20+
    ]}
]}

This would return singlet leukocytes that are neither CD3+ nor CD20+ (e.g. monocytes, dendritic cells and NK cells from a blood sample). Note that while boolean NOT is technically a unary operator, CellEngine implements the operator as both unary ({"$not": dead}) and n-ary ({"$not": [CD3+, CD20+]}), which could be thought of as neither x nor y or none of x, y or z.

Constructing barcoding populations becomes easy with logical populations. For example, if you have a six-choose-three barcoding scheme (e.g. cells must be positive for exactly three of six channels), one population would be:

{"$and": [
    BC1,
    BC2,
    BC3,
    {"$not": [BC4, BC5, BC6]}
]}

Warning

While it's possible to create any population imaginable via the API, CellEngine might not be able to be able to display the populations in a hierarchy. Plots and statistics will be correct despite this.

gates Syntax

The gates string must be an RFC8259-compliant JSON string. The formal syntax is:

GateQuery {
    ("$and"|"$or"|"$not"|"$xor" : Array<GID|GateQuery>) | ("$not" : GID)
}

Translated, that means a GateQuery is comprised of a JSON-formatted object with a single key (one of "$and", "$or", "$not" or "$xor"), whose value is an array of GID strings and more GateQueries. Additionally, "$not" is allowed to have a scalar GID string value.

Populations using sectors of compound gates (i.e., a half of a split gate or a quadrant of a quadrant gate) must reference the sector GID found at gate.model.gids[#]; referencing the top-level GID of a compound gate is is an error.

Special Values

Wherever a population ID can be supplied to the API, null can be supplied to indicate Ungated (all events).

Resource Representation

Property Value Description
experimentId String, read-only The ID of the experiment to which this population belongs.
gates JSON String The gate expression that defines this population. See above information. This string must be RFC8259-compliant JSON.
name String The name of the population.
parentId String The population's parent population.
terminalGateGid String The GID of the gate that differentiates this population from its parent. This is used in conjunction with parentId to determine if a gate should be displayed on a plot. For basic populations, it should be the GID of the gate that differentiates this population from the parent. For complex populations (e.g. combination populations) with more than one gate that is different from the parent, it should be null. Note: for compound gates, this property should correspond to the sector GID found at gate.model.gids[#], not the top-level GID.
uniqueName String, read-only The unique name of the population, automatically generated by the server. This name includes prepended ancestor names until the name is unique within the experiment.

Methods

list

Required Permissions

This API requires the following permissions:

  • "experiment.read"
Request
GET https://cellengine.com/api/v1/experiments/:experimentId/populations
Parameter Value Description
Path Parameters
experimentId String ID of the experiment.
Optional Query Parameters
Standard query parameters for list routes

Do not supply a request body with this method.

Response
200 OK
Content-Type: application/json
---
[
    {<population>}
]

create

Required Permissions

This API requires the following permissions:

  • "population.create"
Request
POST https://cellengine.com/api/v1/experiments/:experimentId/populations
Response
201 Created
Content-Type: application/json
---
{population}

update

Required Permissions

This API requires the following permissions:

  • "population.update"
Request
PATCH https://cellengine.com/api/v1/experiments/:experimentId/populations/:populationId
Response
200 OK
Content-Type: application/json
---
{population}

delete

Deletes a population.

If this population is selected in any illustrations in the same experiment, those selections are cleared.

If the specified population is defined by a sector of a compound gate (e.g. a quadrant of a quadrant gate), all other sectors of the compound gate will be deleted as well.

Required Permissions

This API requires the following permissions:

  • "population.delete"
  • "gate.delete" if deleteBranch=true
Request
DELETE https://cellengine.com/api/v1/experiments/:experimentId/populations/:populationId
Parameter Value Description
Path Parameters
experimentId String ID of the experiment to which the file belongs.
populationId String ID of the population.
Optional Query Parameters
deleteBranch Boolean Defaults to false. If true, deletes corresponding gate and all descendant populations/gates.
includeRoot Boolean Applies to deleteBranch=true usage only. Defaults to true. If false, only descendants of the specified population are deleted.

Do not supply a request body with this method.

Response

Without deleteBranch

204 No Content

With deleteBranch=true

200 OK
Content-Type: application/json
---
{
    nRemoved: <Integer>,
    _id: <String[]>,
    gates: {
        nRemoved: <Integer>,
        gid: <String[]>
    }
}

The response gates.gid excludes sector GIDs; it only contains top-level GIDs.


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.

Resource Representation

Property Value Description
experimentId String, read-only The ID of the experiment to which this scale set belongs.
name String The name of the scale set.
scales[] Scale[] The scales comprising the scale set.
scales[].channelName String The name of the channel to which this scale applies.
scales[].scale Scale The scale for this channel.
scales[].scale.cofactor Number, optional For ArcSinhScales, the value by which the input is divided.
scales[].scale.minimum Number The minimum display value for the scale.
scales[].scale.maximum Number The maximum display value for the scale.
scales[].scale.type ArcSinhScale, LinearScale or LogScale The type of scale.

Methods

list

Gets the list of scale sets in the experiment. Currently there is exactly one scale set per experiment.

Required Permissions

This API requires the following permissions:

  • "experiment.read"
Request
GET https://cellengine.com/api/v1/experiments/:experimentId/scalesets
Parameter Value Description
Path Parameters
experimentId String ID of the experiment.
Optional Query Parameters
Standard query parameters for list routes

Do not supply a request body with this method.

Response
200 OK
Content-Type: application/json
---
[
    {<scaleset>}
]

update

Modifies the scale set. Changing a scale will also adjust the coordinates of gates using the modified scale.

Required Permissions

This API requires the following permissions:

  • "scaleset.update"
Request
PATCH https://cellengine.com/api/v1/experiments/:experimentId/scalesets/:scaleSetId
Response

Statistics

Methods

get

Required Permissions

This API requires the following permissions:

  • "experiment.read"
Request
POST https://cellengine.com/api/v1/experiments/:experimentId/bulkstatistics
Content-Type: application/json
Parameter Value Description
Path Parameters
experimentId String ID of the experiment to which the file belongs.
Required Body Parameters
statistics String[] Any of "mean", "median", "quantile", "mad" (median absolute deviation), "geometricMean", "eventcount", "cv", "stddev" or "percent" (case-insensitive).
q Number for "quantile" statistic
channels String[] for "mean", "median", "geometricmean", "cv", "stddev", "mad" or "quantile" statistics Names of channels to calculate statistics for.
Optional Body Parameters
annotations Boolean Include file annotations in output (defaults to false).
compensationId Compensation Compensation to use for gating and statistic calculation. Defaults to uncompensated. See special compensation values.
digits Number Number of digits to appear after the decimal point. May be a value between 0 and 20, inclusive. (TSV and CSV format only.)
fcsFileIds String[] FCS files to get statistics for. If omitted, statistics for all non-control FCS files will be returned.
format String One of "TSV (with[out] header)", "CSV (with[out] header)" or "json" (default), case-insensitive.
ids Boolean Include population and file IDs in output (defaults to true).
layout String The file (TSV/CSV) or object (JSON) layout.
  • "tall-skinny" One row/object per combination of FCS file, population, statistic and channel.
  • "medium" One row/object per combination of FCS file, population and channel. Separate column/property for each statistic.
  • "short-wide" One row/object per FCS file. One column/property per combination of population, statistic and channel. This format is not readily machine-readable and does not include population IDs or the uniquePopulationName.
Case-insensitive.
percentOf String|String[] Population ID or array of population IDs. If omitted or the string "PARENT", will calculate percent of parent for each population. If a single ID, will calculate percent of that population for all populations specified by populationIds. If an array, will calculate percent of each of those populations.
populationIds String[] List of population IDs. Defaults to ungated. For ungated, omit or use null.
Response

For format="json", a JSON array with all combinations of provided parameters (FcsFiles x Populations x channels x statistics). For example:

POST https://cellengine.com/api/v1/experiments/:experimentId/bulkstatistics
{
    "statistics": ["mean", "median", "quantile"],
    "channels": ["PE-A", "FSC-A"],
    "q": 0.95,
    "compensationId": -1,
    "fcsFileIds": ["<fcsFileId1>", "<fcsFileId2>"],
    "format": "json",
    "layout": "medium",
    "populationIds": ["<populationId1>", "<populationId2>"]
}
200 OK
Content-Type: application/json
---
[
    {
        fcsFileId: "<fcsFileId1>",
        filename: "Specimen 01.fcs",
        populationId: "<populationId1>",
        population: "Singlets",
        uniquePopulationName: "Singlets",
        parentPopulationId: null,
        parentPopulation: "Ungated",
        channel: "PE-A",
        reagent: "CD3",
        mean: 52040.376758718616,
        median: 50881.291015625,
        quantile: 51616.5477815448
    },
    {
        fcsFileId: "<fcsFileId1>",
        filename: "Specimen 01.fcs",
        populationId: "<populationId1>",
        population: "Singlets",
        uniquePopulationName: "Singlets",
        parentPopulationId: null,
        parentPopulation: "Ungated",
        channel: "FSC-A",
        mean: 87881.26381655093,
        median: 86734.2890625,
        quantile: 87800.75920644606
    },
    ... continued for fcsFileId2, populationId2
]

For format="csv", "tsv", "csv (with header)" or "tsv (with header)", a text file in the specified format.