---
name: glass-toolkit
description: Use the Glass CLI (`glass`) to get hosted single-cell RNA-seq data from Glass Bio. It searches the processed public catalog by text, gene set, or cluster similarity; reads datasets, clusters, markers and cell-type annotations; uploads H5AD files; creates subsets and merges; and downloads H5AD files.
metadata:
  version: "0.28.1"
---

# Glass toolkit

`glass` gives access to Glass Bio's hosted and preprocessed single-cell data. Noninteractive commands print exactly one JSON envelope on stdout by default. Use `--human` for a terminal summary. `--json` remains accepted. Successful HTTP requests are quiet. `--verbose` prints request traces to stderr. Errors remain visible. Use `--output hits.json` to save the complete success envelope. Stdout then contains a small `json_file` receipt with the path, byte count, and SHA-256. Read the saved file for the result.

The [CLI reference and migration guide](https://demo.glass.bio/cli.md) lists all commands and old-to-new replacements.

## Setup

- **Install:** if `glass --version` fails, install the CLI. It needs Python 3.11 or later.

  ```sh
  curl -fsSL https://demo.glass.bio/api/scripts/install-glass.sh | bash -s -- --api-base https://demo.glass.bio/api/v1
  ```

- **Check the deployment:** run `glass cli status --json`. It shows which features this deployment enables, the CLI version, and the account. A disabled feature returns `feature_disabled`.
- **Update:** run `glass update`. Commands use the saved deployment, or demo when none is configured.
- **Choose access:** catalog searches and dataset commands require sign-in, including searches of public datasets. Public Astral reads work without sign-in.
- **Use one deployment:** install the CLI and read this skill from the same deployment. The guide at `glass.bio/install.md` targets demo. For dev, use `https://dev.glass.bio/toolkit`.
- **Authenticate:**
  - An agent uses `GLASS_TOKEN`. A user creates a token once with `glass auth tokens create --name agent --scope read --scope submit --json`.
  - To allow dataset deletion, include `--scope delete` in `glass auth tokens create`.
  - Never print or store the token.
  - Interactive alternative: `glass auth login --no-browser`. Give the printed URL and code to the user.

## Rules

- **Exit codes:**
  - 0: success
  - 1: API or job failure
  - 2: invalid input
  - 3: sign-in required
  - 4: wait deadline (rerun `glass jobs wait JOB_ID`)
  - 130: interrupted
- **Retry:** retry only when `error.retryable` is true. After a 429, wait at least `Retry-After`. Do not retry `quota_exhausted`, `feature_disabled` or `client_outdated`. For `client_outdated`, reinstall the CLI.
- **Field errors:** `error.fields` names each invalid field.
- **Failed waits:** a failed wait returns `job_failed`. `error.message` explains the failure. `error.cause` contains backend details when available. Successful `jobs get` and `jobs list` commands can save failed or running job states.
- **Confirm first:**
  - `datasets upload`, `datasets annotations create`, `datasets subset`, and `datasets merge` start paid jobs. Get the user's agreement first.
  - `datasets delete` is irreversible. Get explicit confirmation.
- **Duplicate submissions:** if a submission fails with a retryable error, retry with the printed `--idempotency-key`. If you lose a job ID, run `glass jobs list --json` instead of submitting again.
- **Defaults:** commands that take a dataset ID use its latest version unless you pass `--version`. Lists return 20 items by default and at most 50. To get the next page, pass `nextCursor` as `--cursor`.

## Typed requests and command schemas

These commands accept `--input FILE` or `--input -` for a JSON API request:

- `datasets search`, `datasets values list`, `datasets clusters search --mode genes`, `datasets clusters search --mode similarity`
- `datasets clusters get`, `datasets clusters compare`, `datasets subset`, `datasets merge`, `datasets annotations create`, `datasets comparisons create`
- `auth tokens create`, `cohorts prepare`, `cohorts aggregate`, `cohorts score`, `cohorts compare`, `cohorts bundle`
- `datasets get`, `datasets annotations get`, `datasets comparisons get`
- `astral get`, `astral score`

Run the same command with `--schema` to read its request, success envelope, and error schemas.
This command works offline without login or a deployment. It always prints JSON.
These static schemas differ from live catalog filter values and `astral get --representation manifest`.
`datasets values list --field FIELD --schema` describes `CatalogOptionsRequest` and its result.
For typed values requests, an explicit `--field FIELD` must match the input `field`.
`datasets clusters search --mode similarity --input` submits the browser API's `ClusterSearchRequest`.
Its `--limit` is an HTTP query parameter, outside the input body.
For typed gene search, `top_n` belongs in `GeneSetSearchRequest`. Do not supply `--limit` with `--input` in gene mode.
Select `--mode genes` or `--mode similarity` for typed cluster search and offline schemas.
The two modes use separate request models. Flags from the other mode fail.
`--genes`, `--genes-file`, and `--similar-to` select flag requests. These selectors are mutually exclusive and do not accept `--input`.
An explicit `--mode` must agree with the selector. Without a selector, `--schema` requires `--mode`.
Use `expectedVersionId`, `expectedGroupingRevision`, and `expectedClusterId` to pin a typed similarity query.
For cluster retrieval, `--representation gene_ranks --schema` describes the certified rank request and result.

```sh
glass datasets clusters search --mode genes --schema > gene-search-schema.json
glass datasets clusters search --mode genes --input request.json --output hits.json
cat request.json | glass datasets clusters search --mode genes --input - --output hits.json
glass astral get --input rows.json --output rows.parquet
```

For example, `request.json` can contain:

```json
{"genes":["CD3D","CD3E","CD3G","TRAC","IL7R"],"filters":{"organism":"human"},"top_n":10}
```

The input is the request body, without an envelope. Use the API field names from `--schema`. Omitted fields use the server defaults. Unknown request fields and invalid field types fail. Do not combine `--input` with request flags or positional inputs.
`--wait`, `--idempotency-key`, and `--output` remain command controls where supported.
For JSON results, `--output` saves the complete success envelope and prints a `json_file` receipt. Failures keep their error or status on stdout and leave the destination unchanged. Binary commands save the artifact and print its existing receipt. A file receipt is not the saved result. Use the saved file with `--from` or other file inputs.
Use exact version and cluster references in typed subset, merge, annotation, and comparison requests.

Every command accepts `--profile NAME`, `--session-dir PATH`, and `--api-base URL` before or after its command name.
Use either `--profile` or `--session-dir`. The selected directory supplies both the deployment configuration and saved login.
`--api-base` replaces the deployment URL. `GLASS_TOKEN` remains the first credential source for commands that accept tokens.

## Gene inputs

`--genes VALUE...` takes gene values. `--genes-file FILE` reads one gene per line. Use `--genes-file -` for stdin.
These options are mutually exclusive on `astral get`, `datasets clusters search`, `datasets clusters get`, and `cohorts prepare`.
Astral retrieval accepts gene symbols or IDs. Gene search accepts 2-200 symbols or canonical Ensembl IDs.
Cluster `gene_ranks` requires 5-50 distinct canonical Ensembl IDs. Cohort preparation requires IDs from the count axis.
The CLI preserves each contract's resolution rules. It does not convert symbols to IDs locally.
Gene search uses the same curated Astral backend as Marble chat. It returns ten distinct-study hits by default.
Each hit contains the dataset title and ID, cell type, score, and study mean.
Use `filters.cellType` and `filters.annotationLevel` in typed requests to narrow the population.
Astral search results contain dataset IDs, not exact `clusterRef` values for `gene_ranks`.

## Result files

Noninteractive result commands accept `--output FILE`, including searches, clusters, cohorts, jobs, and `cli status`.
Login, interactive chat, and CLI updates keep their separate lifecycle behavior.
`--representation` selects the content or artifact. `--output` changes its destination only.
JSON results keep the same envelope and data as stdout. The receipt describes the exact saved bytes.
`--human` prints a summary of the receipt. `--verbose` keeps request traces on stderr.
Parquet tables and evidence ZIPs require an output path. Dataset artifact preparation can return a job without a file.
Offline schemas describe the selected request, result, file requirement, and possible receipts.

```sh
glass datasets search --query lung --output catalog.json
glass datasets clusters search --genes CD3D CD3E CD3G TRAC IL7R --organism Homo_sapiens --output hits.json
glass datasets clusters get --from hits.json --rank 1 --representation gene_ranks --output ranks.json
glass jobs get JOB_ID --output job.json
```

## Commands

| Goal | Command |
| --- | --- |
| Discover live Astral columns, counts, and limits | `glass astral get --representation manifest --organism human` |
| Retrieve labeled centroid expression | `glass astral get --input expression.json --output centroids.parquet` |
| Score an Astral gene set on the server | `glass astral score --input score.json` |
| Search catalog datasets | `glass datasets search --query "lung fibrosis" --organism Homo_sapiens --json` |
| Discover supported clinical filter values | `glass datasets values list --field intervention --query nivolumab` |
| Rank catalog clusters by 5-50 genes | `glass datasets clusters search --genes-file genes.txt --organism Homo_sapiens --output hits.json` |
| Find catalog clusters similar to one cluster | `glass datasets clusters search --similar-to cluster.json --output hits.json` |
| Restrict similarity to selected reference samples | `glass datasets clusters search --similar-to cluster.json --references references.json --output hits.json` |
| List your datasets, or everything readable | `glass datasets list [--all] [--query TEXT] --json` |
| Show a dataset: metadata, QC, annotation | `glass datasets get DATASET_ID --json` |
| List clusters with exact clusterRefs | `glass datasets clusters list DATASET_ID [--level marble_cell_type] --json` |
| Compare one cluster with the atlas background | `glass datasets clusters compare --from hits.json --rank 1` |
| Show a cluster's metadata, markers, annotation | `glass datasets clusters get --from hits.json --rank 1 --include markers --json` |
| Download a dataset as H5AD | `glass datasets get --representation h5ad --wait DATASET_ID --output data.h5ad` |
| Upload an H5AD | `glass datasets upload data.h5ad --name NAME --reference grch38-gencode-v32 --wait --json` |
| Annotate cell types | `glass datasets annotations create DATASET_ID --context "lung, IPF" --wait --json` |
| Export an annotation | `glass datasets annotations get --representation annotation_json ANNOTATION_ID --output labels.json` |
| Subset clusters of one dataset | `glass datasets subset DATASET_ID --cluster 0 --cluster 4 --name NAME --wait --json` |
| Subset saved search hits across datasets | `glass datasets subset --from hits.json --ranks 1,2,5 --name NAME --wait --json` |
| Merge whole datasets | `glass datasets merge DATASET_A DATASET_B --name NAME --wait --json` |
| Find or wait for jobs | `glass jobs list --json`, `glass jobs wait JOB_ID --json` |

Each `glass COMMAND --help` shows an example.

## Search and cluster evidence

Use `datasets search` for catalog metadata and `datasets clusters search` for gene or similarity discovery.
`datasets search --sort relevance|cell_count|year` uses the existing catalog order.
Catalog pages return at most 50 datasets. Keep the same sort, query, filters, and limit with `--cursor`.

`datasets values list --field FIELD` lists live filter values and sample counts.
The supported fields are `material`, `culture`, `disease-role`, `intervention`, `exposure`, and `intervention-time`.
`--query` matches part of a value name. The same six clinical filters restrict the option counts.
Values use `--offset` and return at most 100 items, with a default of 50.
Other catalog filters, sorting, and cursors do not apply to values.

`datasets clusters search --genes-file genes.txt --organism Homo_sapiens --query-max-rank 3000` sets the existing rank cutoff, from 1500 to 5000.
Inspect a hit's certified ranks with the same genes, cutoff, and index revision:

```sh
glass datasets clusters search --genes-file genes.txt --organism Homo_sapiens --query-max-rank 3000 --output hits.json
glass datasets clusters get --from hits.json --rank 2 --representation gene_ranks
```

The rank result reports stored ranks, capped ranks, build-floor flags, score, and index revision.
It returns only server rows. Unavailable indices and stale population references fail.
For an exact `--cluster-ref`, supply 5-50 distinct canonical Ensembl IDs through `--genes` or `--genes-file`.
`--gene-rank-index-revision` pins the index. Omit it to use the current certified index.
Saved gene hits preserve their original query and reject rank overrides.

`datasets clusters get --include metadata --include markers --include annotation` selects existing evidence sections.
`--marker-limit` accepts 1-100 rows and defaults to 20. `--include composition` adds existing cohort metadata.
`datasets clusters compare` returns the existing atlas-background DGE result for one exact cluster.
The flag and typed input paths use the same evidence sections and marker limit.

`datasets clusters search --similar-to cluster.json` pins the query version, grouping revision, and cluster ID.
Save one `clusterRef` from `datasets clusters list` as `cluster.json`. Similarity results retain their catalog index revision.
Indexed similarity hits require resolution within their saved hosted version before cluster retrieval or subset creation.

## Dataset retrieval

`datasets get` returns metadata by default. `--output metadata.json` saves the complete response envelope and returns a file receipt.
Dataset metadata, annotation metadata, and manifest JSON files use this envelope.
Select `--representation h5ad`, `source_cell_map`, or `input_grouping` for an artifact.
Without `--output`, an artifact request returns its ready transfer or a preparing job.
A preparing result retains the pinned `dataRef`. Add `--wait` to wait for preparation.
With `--output`, ready artifacts use an atomic file write after length and SHA-256 checks.
If preparation is pending without `--wait`, no file is written. Resume with the returned version and `--wait`.
H5AD preparation packages existing data and starts no biological analysis.

`datasets annotations get ANNOTATION_ID` returns metadata. Use `--representation annotation_json` for all labels, evidence, and sources.
`datasets comparisons get --from comparison.json --output genes.parquet` retrieves the full Parquet result.
This operation requires `--output` and retains the exact result and group references.
The comparison input can be a saved receipt, successful job result, or exact `ComparisonResultRef`.
Use `--input` with an exact `DatasetRef`, `AnnotationRef`, or `ComparisonResultRef` for these retrieval commands.
`--representation` and `--output` remain command controls. The selected representation does not change with the output path.

## Astral retrieval

Discover columns and counts before retrieving expression:

```sh
glass astral get --representation manifest --organism human > manifest.json
glass astral get --organism human --output metadata.parquet
glass astral get --organism human --genes IL7R CD3D --output expression.parquet
```

The public Astral commands are `get` and `score`.
`get` defaults to `--representation table` and requires `--output` for its binary Parquet table.
`--representation manifest` returns live manifest JSON to stdout or saves the complete envelope with `--output`.
`--schema` describes the selected representation offline, including its request, response, and file requirement.
Each schema contains only reachable definitions and their complete transitive references.
The manifest request accepts `organism`, `atlasVersion`, `annotationLevel`, and `include`.
`--output` never changes the selected content.
Omit genes for metadata only. Use `--input` for server filters, metadata projection, and `geneMode`.
The default manifest contains versions, columns, units, hashes, counts, cell-type labels, filters, and limits.
Gene and study lists are null by default. Repeat `--include genes --include studies` to retrieve both lists.
Typed requests use `"include": ["genes", "studies"]`. The server projects these lists before transfer.
Use `filters` for exact sample, cell-type, study, catalog-label, and scalar-age selection.
Use `columns` for metadata projection. The server always retains `centroid_id`.
Set `geneMode` to `all` for the complete gene axis. Select at most 200 centroids for a non-admin export.
The CLI decodes the stream and checks its checksum and byte count before replacing the output file.
Use `--atlas-version` from the manifest response to pin the atlas.
Use `--centroid-ids` to retrieve exact rows in the supplied order.
The Parquet file includes catalog metadata and canonical gene columns.
Its `glass` schema metadata records gene symbols, units, versions, and column descriptions.
`n_cells` supplies cell counts for later analysis.

Age columns preserve more than a single number. `age` contains stored labels, including ranges
and categories. `age_value`, `age_unit`, `age_context`, and `age_basis` describe a single observation.
A missing unit stays missing. `age_minimum` and `age_maximum` retain interval endpoints in `age_unit`.
`age_state=known` means recognized information, not necessarily a scalar donor age.
`age_observations` contains all observations as JSON, including converted `value_years` and source text.

`age_years` contains one reported or sampling age with explicit units, converted to years.
Months divide by 12; days divide by 365.25; weeks multiply by 7/365.25.
Death, diagnosis, gestational, and post-conception ages remain available in the other age columns.
Cell-line, organoid, and xenograft ages do not populate `age_years`.
For cohorts, filter tissue and age context together. Group by study and verified donor ID before
statistical comparisons; separate samples can belong to the same donor.
The server applies byte limits and never silently truncates rows.
Metadata and selected-gene downloads have no daily export quota or centroid cap.
All-gene downloads share the browser export quota: two per UTC day anonymously, or twenty per account.
Admins bypass caller quotas and centroid caps. All byte limits still apply.

## Astral scoring

`astral score` sends an `ExpressionScoreRequest` to the existing server scorer.
The server selects centroids through the same filters and pins as table retrieval.
The CLI does not download atlas metadata for local selection or calculate expression or summaries.
Public Astral retrieval and scoring require no login and start no stored analysis job.

A complete score request can contain:

```json
{
  "organism": "human",
  "filters": {"cellType": "Astrocytes"},
  "specification": {"name": "glial-program", "genes": ["GFAP", "S100B"]},
  "skipUnresolved": false,
  "groupby": "study",
  "weighting": "cells"
}
```

```sh
glass astral score --schema
glass astral score --input score.json --output scores.json
glass astral score --organism human --centroid-ids 123 456 --spec program.json
```

Use `atlasVersion`, `catalogRevision`, `annotationsSha256`, and `pointKeysSha256` to pin a request.
Without an atlas version, the CLI resolves the current version through compact live manifest discovery.
Score selection permits at most 50,000 centroids. The server rejects an empty selection.
A program specification contains `name` and `genes`, with two to 200 distinct resolved genes.
Score errors report every input gene in `error.geneResolution`.
Correct unresolved genes, or set `skipUnresolved` to exclude absent, ambiguous, and duplicate inputs explicitly.
The flag shortcut is `--skip-unresolved`. At least two distinct resolved genes must remain.
Successful scores include every resolution and the exact target and control genes.
`--output scores.json` saves the complete response envelope and returns a compact file receipt.
The file retains selection, controls, gene resolutions, scientific methods, scores, summaries, and provenance.
Without `--output`, the full JSON envelope goes to stdout for pipes or shell redirects.
Scoring uses the existing atlas-wide control background and output quantization before it subsets selected centroids.
A smaller selection preserves the controls and score scale.
Optional summaries require both `groupby` and `weighting`, or both `--by` and `--weight`.
They average centroid scores. They do not recompute scores from pooled cells.

## Cleanup

The example token has `read` and `submit` scopes. It cannot delete datasets.
For cleanup with your saved CLI login, clear `GLASS_TOKEN` before deletion.

```sh
unset GLASS_TOKEN
glass datasets delete SUBSET_ID
glass datasets delete NEW_ID
glass auth tokens revoke TOKEN_ID
```

## Example: one cell type across studies

1. `glass datasets clusters search --similar-to cluster.json --json > hits.json`
2. Show the user the ranked hits and agree on which ranks to keep.
3. `glass datasets subset --from hits.json --ranks 1,2,5 --name t-cells --wait --json`. The new dataset is `data.result.dataRef`.
4. `glass datasets get --representation h5ad --wait NEW_DATASET_ID --output t-cells.h5ad`, if the user wants the file.

## Example: compare against a disease cohort

1. Save a catalog page: `glass datasets search --query osteosarcoma --organism Homo_sapiens --limit 50 --json > references.json`.
2. If the page has `inputCursor=null` and `nextCursor=null`, use the saved result. Otherwise, collect deliberate selections into an SRX array.
3. Search within those samples: `glass datasets clusters search --similar-to cluster.json --references references.json --json > hits.json`.
4. Inspect the atlas-background genes with `glass datasets clusters compare --from hits.json --rank 1`.

`--references` also accepts an SRX array, such as `["SRX10306544", "SRX9615334"]`.
The typed form is `{"allowedSrxAccessions": ["SRX10306544", "SRX9615334"]}`.
Use `--references -` to read either form from stdin.
The backend restricts candidates before it ranks similarity scores.
Explicit reference lists bypass the three-samples-per-paper diversity cap.
Broad searches retain that cap. The requested result limit still applies to both searches.
An empty list matches no references. Without the flag, the search uses the broader catalog.
Accessions must be unique. The maximum is 50,000 accessions.

Saved results include `data.referenceCohort.allowedSrxAccessions` and the original catalog result in `catalogSearch`, when supplied.
Saved catalog results must contain `inputCursor=null` and `nextCursor=null` for `--references`.
Partial pages and older files without `inputCursor` fail before a similarity request.
To select page items deliberately, supply an explicit SRX array.
Continue catalog search with `--cursor` and the same query, filters, and limit.
Catalog pages cover accessible hosted matches. They do not cover all published studies.
Cursors bind the query and current accessible anchor. The listing is live, not a frozen snapshot.

Ranked results include `retrieval`: candidate bounds, authorized stage counts, effective paper cap,
and one-cluster-per-SRX policy. `truncated` describes only the final output limit.
The search scope remains `bounded`, even when `truncated=false`.
Unknown raw candidate counts and eligible totals remain null to protect inaccessible data.
Each requested SRX has a status: `returned`, `output_limited`, `source_excluded`, or `unresolved`.
`unresolved` does not establish absence from the index or lack of a comparable population.
Gene search reports the same bounded scope without adding reference filters.
Keyword labels do not establish treatment, sampling method, or population identity. Inspect reference metadata before interpreting the matches.

## Concepts

- **Clusters:** a cluster is identified by its `clusterRef`. `glass datasets clusters list` lists each `clusterRef`. Save one reference for `datasets clusters search --similar-to`.
- **Uploads:** processing re-clusters an upload, so its hosted clusters do not match your local cluster numbers.
  Uploads apply Otsu count filtering, mitochondrial filtering, and minimum-gene filtering by default.
  For already filtered data, add `--no-filter-cells` to retain every uploaded cell and barcode.
  The API equivalent is `filterCells: false` in `POST /api/v1/uploads`.
  QC metrics, gene canonicalization, and reclustering still run. Glass still prefixes barcode names.
  The CLI saves the choice in its manifest. Resume uses the saved choice.
- **Similarity hits:** these are nearest cluster centroids in the catalog index. Scores are not probabilities. `datasets subset --from` and `datasets clusters get --from` resolve each hit within its saved hosted version.
- **Within-dataset markers:** `datasets clusters get --include markers --marker-limit 20` reads existing markers from the selected version. `data.markers` retains the method, comparison, artifact revision, rows, and truncation. Missing markers return `state=not_computed`.
- **Similarity genes:** `datasets clusters compare` returns the website Similarity tab's atlas-background comparison in `data.dge.genes`. It returns up to 100 increased and 100 decreased genes. It starts no job. `--include markers` also selects within-dataset markers.
- **Annotation evidence:** `datasets clusters get --include annotation` returns existing annotation entries with the independent annotation ID. For the full evidence and sources, use `datasets annotations get ANNOTATION_ID --representation annotation_json`.
- **Gene-search scores:** these rank cluster mean expression. They do not show that the genes are expressed together in the same cells.
- **Limits:**
  - Upload: 30 GiB, 3,000,000 cells and 100,000 genes.
  - Subset: 50 clusters from at most 20 datasets.
  - Merge: 2-20 datasets.


## Compare populations across datasets

Use `glass datasets clusters list DATASET_ID --version VERSION_ID --level LEVEL --json` to discover exact references.
Save selected `clusterRef` objects as a JSON array for each group. Each group uses one dataset version.
The groups can use different versions. The server checks current grouping revisions and unions selected cells.

```sh
glass datasets comparisons create --group-a query.json --group-b reference.json --json > comparison.json
glass jobs wait JOB_ID --json > completed.json
glass datasets comparisons get --from comparison.json --output genes.parquet --json
```

The export retains two rankings per gene, one for each source group. Each ranking includes adjusted p-values and expression means.
The `score` follows `source_cluster` versus the other group; it does not use the fixed A-versus-B direction.
Positive `logfoldchange` means higher expression in requested group A. Means are mean log1p(CP10K), not arithmetic CP10K means.
Parquet metadata identifies the method, source groups, coverage, and contrast direction.
The website still shows at most 25 ranked rows. Legacy results lack full coverage and require a new comparison.
This cell-level Wilcoxon comparison does not control study effects or establish patient-level treatment response.

### Donor counts and gene-set analysis

Use `glass cohorts aggregate --manifest cohort.json --json` for resolved donor mappings.
For slower cohorts, add `--timeout 180`. This option also works with `--input`.
The default is 30 seconds for each connection or response-data wait. A timeout does not cancel server work.
Pin dataset versions, the atlas release, cell-type labels, and accepted confidence values.
Keep donor, specimen, condition, time point, and treatment distinct in the manifest.
Use the same global donor ID across studies and specimens.

Use `glass cohorts score --counts counts.json --spec scoring.json --json` to score a gene set.
Supply normalization, coverage thresholds, and specimen aggregation in the scoring specification.
Use `glass cohorts compare --cohort primary scores.json --spec contrasts.json --json` for unpaired donor comparisons.
Supply arm definitions, donor thresholds, bootstrap settings, and comparable contrast IDs explicitly.
Repeat `--cohort NAME FILE` for separately computed annotation selections. Each name must be unique.
Use `--spec` without cohorts. Use `--input` for a complete request with cohorts.
Use `glass cohorts bundle --from results.json --output evidence.zip --json` to bundle saved scores or comparisons with their inputs.
For descriptive scores, supply the saved `cohorts score` result directly. No comparison or control group is required.
The score bundle preserves score rows, exclusions, frozen counts, source receipts, and scoring settings for offline replay.
The CLI sends these requests to the existing hosted analysis services.
Use `--input FILE` or `--input -` for a complete typed request.
Use `--schema` for the exact request and receipt schemas.
`cohorts bundle` requires `--output` and returns the full evidence ZIP.
It writes the file atomically and returns its byte length and SHA-256.
It preserves the saved inputs and starts no new biological analysis.

The current inference method supports unpaired donors. Small groups remain descriptive.
Use `cohorts score --schema` and `cohorts compare --schema` for the complete specifications.
