Skip to content

Commit 077ad19

Browse files
manasaV3mvenkatakrishnan
andauthored
chore: Updating claude plugin (#52)
* chore: Updating claude plugin * improved assay ontology recommendation --------- Co-authored-by: mvenkatakrishnan <mvenkatakrishnan@gmail.com>
1 parent 6ce63f9 commit 077ad19

2 files changed

Lines changed: 44 additions & 18 deletions

File tree

plugins/catalog/skills/catalog-register/SKILL.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,30 @@ unset — empty is honest; a fabricated value is a data-quality bug.
205205
ask whether each `location` (data asset) should point at the next level down
206206
(e.g. one location per well/FOV) rather than the whole store. Map `locations`
207207
accordingly — don't assume one dataset = one `.zarr` root.
208+
11. **Derive `organism` / `tissue` / `disease` only when *formally entailed* by an
209+
existing source value — confirm before coding, never hallucinate.** Sample
210+
fields like organism, tissue and disease are frequently absent as their own column
211+
yet fully determined by another column. A `cell_line` / `cell_type` pins down
212+
both the species and the tissue of origin. You may fill such a field **only**
213+
when the value is *derived*, never guessed.
214+
- **Formal derivation, not intuition.** The target must be *entailed* by an
215+
authority, not inferred by feel. The mechanism is the OLS hierarchy from
216+
rule 9: resolve the source label (e.g. `cell_type="A549"``EFO:0001086`),
217+
then read its ancestors. If an unambiguous ancestor pins the field
218+
(`A549` → parent `Homo sapiens cell line` ⇒ `organism = Homo sapiens /
219+
NCBITaxon:9606`).
220+
- **Ambiguous ⇒ leave unset.** If the source value does not *uniquely*
221+
determine the target — e.g. a cell *type* aligns with models in multiple species — do **not** derive. Leave it unset
222+
and note it; never pick the "likely" option.
223+
- **Confirm with the user before writing the derivation into code.**
224+
Derivation is a mapping *decision*, not a lookup. Show the user the rule you intend to encode as source field → target field, the entailing authority (which ancestor/lookup), and
225+
exactly which rows will stay unset because they're ambiguous. Get
226+
explicit approval. Only then code it. Don't silently bake in a derivation.
227+
- **Cell lines belong in `tissue`.** When you do derive, a cell line's
228+
canonical slot is `sample.tissue = [TissueEntry(label=<line>,
229+
ontology_id=<resolved id>, type="cell line")]` — not an ad-hoc `cell_line`
230+
extra. Its anatomical tissue-of-origin (e.g. A549 → lung / UBERON) is a
231+
*further* derivation, held to the same entailment + confirmation bar.
208232
- **`version` is never null.** It's a required signature field (`str`, not
209233
optional). If the source has no version, default it to `"1.0.0"` — use
210234
`src.get("release") or "1.0.0"`, never pass `None`.
@@ -244,7 +268,7 @@ Get token from catalog's `/docs` → Token → `/token/issue`. Pass via `CATALOG
244268
here with a precise error, before any network call.
245269
- **`record_schema_version` is auto-set.** Don't map a source field
246270
onto it; the model defaults it.
247-
- **`dataset_type` values are `raw` / `processed`** (`DatasetType.raw`) — not `primary`.
271+
- **`dataset_type` values are `raw` / `processed`** (`DatasetType.raw`)
248272
- **`data_quality.checks_*` accept any shape** (`Any`): a count, a list of
249273
names, or a nested dict all validate.
250274
- **`extra="allow"` cuts both ways.** Unknown keys are preserved (great for
@@ -262,6 +286,7 @@ Get token from catalog's `/docs` → Token → `/token/issue`. Pass via `CATALOG
262286
- **No live server on a clean machine.** `--dry-run` swaps the client's internal
263287
`_http` for an `httpx.MockTransport` fake catalog (`_mock_client` in the
264288
template) so you can validate the full submit path without a token.
289+
- Don't ask user for sensitive tokens or credentials.
265290

266291
## Troubleshooting
267292

@@ -277,4 +302,4 @@ Get token from catalog's `/docs` → Token → `/token/issue`. Pass via `CATALOG
277302
to update it in place (see *Registering*).
278303
- `ValueError: update_if_exists and error_on_duplicate cannot both be True`
279304
both flags were set; `update_if_exists=True` requires `error_on_duplicate=False`.
280-
- `AuthenticationError` (401) → bad/expired token; reissue at `/token/issue`.
305+
- `AuthenticationError` (401) → bad/expired token; ask user to reissue at `/token` page.

schema/v1.4.0/schema.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,16 @@ and modality-specific metadata all live at the dataset level.
115115

116116
### Dataset types
117117

118-
**Raw** are data produced by a single experimental acquisition — one pass through
118+
**Raw** are data produced by a single experimental acquisition from a machine — one pass through
119119
an instrument or pipeline under consistent conditions (same organism, same assay, same
120120
modality). If two groups of files came from the same run under the same conditions,
121121
they go in one dataset. If anything changes between them, register them separately.
122122

123123
**Processed** are always new datasets. When an existing dataset is processed,
124124
the output goes in a new dataset record linked back to its source via a lineage edge.
125-
The original is never modified. A processed dataset can be derived from multiple source
126-
datasets across different samples, assays, or modalities.
125+
The original is never modified. Any qualitative change to the raw dataset such as preprocessing,
126+
makes it a processed dataset. A processed dataset can be derived from multiple source datasets
127+
across different samples, assays, or modalities.
127128

128129
The `dataset_type` field records this distinction as `raw` or `processed`.
129130

@@ -182,12 +183,12 @@ level are permitted for domain-specific or team-specific needs.
182183

183184
#### Experimental metadata
184185

185-
| Field | Type | Required | Description |
186-
|---|---|---|---|
187-
| `sub_modality` | string | No | More granular specification of the experimental procedure (e.g. `scRNA-seq`, `brightfield`, `bulk`). |
188-
| `assay` | list[json] | No | Assay(s) used to produce the dataset. Each entry: `{ label, ontology_id }`. Recommended ontology: **EFO** (e.g. `EFO:0022605`). |
189-
| `machine_information` | json | No | Information about the instrument used for data generation. |
190-
| `experimental_protocols` | json | No | Protocol details for the experiment. |
186+
| Field | Type | Required | Description |
187+
|---|---|---|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|
188+
| `sub_modality` | string | No | More granular specification of the experimental procedure (e.g. `scRNA-seq`, `brightfield`, `bulk`). |
189+
| `assay` | list[json] | No | Assay(s) used to produce the dataset. Each entry: `{ label, ontology_id }`. Recommended ontology: **EFO** (e.g. `EFO:0022605`), **FBbi** (eg. `FBbi:00100015`). |
190+
| `machine_information` | json | No | Information about the instrument used for data generation. |
191+
| `experimental_protocols` | json | No | Protocol details for the experiment. |
191192

192193
#### Sample metadata
193194

@@ -208,13 +209,13 @@ ontology recommended below. These follow the
208209
[CZI cross-modality standard](https://github.com/chanzuckerberg/data-guidance/blob/main/standards/cross-modality/1.1.0/schema.md);
209210
the `label` should be the ontology term's preferred label.
210211

211-
| Field | Recommended ontology | Notes & special values |
212-
|---|---|---|
213-
| `organism` | **NCBITaxon** | e.g. `NCBITaxon:9606` (human), `NCBITaxon:10090` (mouse), `NCBITaxon:7955` (zebrafish), `NCBITaxon:7227` (Drosophila), `NCBITaxon:6239` (C. elegans). |
214-
| `assay` | **EFO** | Experimental Factor Ontology, e.g. `EFO:0022605`. |
215-
| `disease` | **MONDO** | Use `PATO:0000461` for normal/healthy and `MONDO:0021178` for injury. |
216-
| `development_stage` | organism-specific | **HsapDv** (human), **MmusDv** (mouse), **WBls** (C. elegans), **ZFS** (zebrafish), **FBdv** (Drosophila); `UBERON:0000105` (life cycle stage) for other organisms. Use `unknown` if unavailable and `na` for cell lines. |
217-
| `tissue` | depends on `type` | **UBERON** for tissue/organoid (or organism-specific **WBbt** / **ZFA** / **FBbt**); **CL** for cell culture; **Cellosaurus** (`CVCL_` prefix) for cell lines; `GO:0005575` (cellular_component) descendants for organelles. |
212+
| Field | Recommended ontology | Notes & special values |
213+
|---|--------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
214+
| `organism` | **NCBITaxon** | e.g. `NCBITaxon:9606` (human), `NCBITaxon:10090` (mouse), `NCBITaxon:7955` (zebrafish), `NCBITaxon:7227` (Drosophila), `NCBITaxon:6239` (C. elegans). |
215+
| `assay` | modality-specific | Default: Experimental Factor Ontology, e.g. `EFO:0022605`, for imaging use Biological Imaging Methods Ontology eg: `FBbi:00000243` |
216+
| `disease` | **MONDO** | Use `PATO:0000461` for normal/healthy and `MONDO:0021178` for injury. |
217+
| `development_stage` | organism-specific | **HsapDv** (human), **MmusDv** (mouse), **WBls** (C. elegans), **ZFS** (zebrafish), **FBdv** (Drosophila); `UBERON:0000105` (life cycle stage) for other organisms. Use `unknown` if unavailable and `na` for cell lines. |
218+
| `tissue` | depends on `type` | **UBERON** for tissue/organoid (or organism-specific **WBbt** / **ZFA** / **FBbt**); **CL** for cell culture; **Cellosaurus** (`CVCL_` prefix) for cell lines; `GO:0005575` (cellular_component) descendants for organelles. |
218219

219220
The `tissue` entry's `type` field is a controlled value: one of `tissue`, `organoid`,
220221
`cell culture`, `cell line`, or `organelle`.

0 commit comments

Comments
 (0)