Skip to main content

Schema Validation

DRAFT: LinkML based schema for cell annotations.

For the original/working repo visit https://github.com/cellannotation/cell-annotation-schema

Cell Annotation Schema

A general, open-standard schema for cell annotations and related metadata.

This effort is part of scFAIR, an initiative to standardize single-cell genomics metadata.

Motivation

Annotation of single cell transcriptomics data with cell types/classes is inherently variable. The reasons authors choose to annotate a set of cells with a particular label are not typically represented in annotated data and there is no established standard for doing so. For relatively simple datasets it may be possible to reconstruct this information by reading an associated publication, but as single cell transcriptomics datasets and accompanying publications become increasingly complex, doing so is becoming increasingly difficult and in many cases publications lack the necessary detail.

CAS provides a programmatically accessible standard designed to solve this problem by allowing users to record additional metadata about individual cell type annotations, including marker genes used as evidence and details of automated annotation transfer. The standard is represented as LinkML schema as this allows all metadata to be gathered in a single, compact validatable file - which includes a link to a cell by gene matrix file of annotated data. However, the schema is designed so that it can be decomposed into individual tables suitable for use in dataframes/TSVs and flattened onto obs in AnnData format.

User stories:

https://github.com/cellannotation/cell-annotation-schema/blob/main/docs/user_stories.md

Examples

Examples used in testing can be browsed under: https://github.com/Cellular-Semantics/cell-annotation-schema/tree/main/examples

brain-bican contains a growing set of working taxonomies including:

Overview

The top level of the LinkML schema is used to store metadata about the annotations: Author details; links to the annotated matrix file, version information etc. This can be thought of as a table that links to a set of subtables.

The top level wraps other JSON objects (sub-tables):

  1. A list of annotation objects (a table of annotations). Each annotation belongs to a named labelset
  2. A table of labelsets - recording names, and additional metadata including a description and provenance (manual vs automated) and if automated, details of automated annotation algorithms etc.

Core schema vs extensions

We define a core schema with a very limited set of compulsory fields. The core schema avoids specifying that additional fields are forbidden, allowing extensions to be built and for any users to add their own customs fields as long as they don't stomp on existing fields in the specification.

Documentation for the core and extension schemas is available at:

Merged LinkML schemas are available at build folder

This repo also contains the CAP AnnData Specification.

Editing the schema

  1. Schema editing is done in the src/cell_annotation_schema/schema folder.
  2. Dataclasses needs to be updated to reflect the changes in the schema. This is done by running make build command in the project root folder. (see project.Makefile Note: this will require creating a poetry virtual env and install dependencies via poetry install

Releases

We publish both versioned releases and a nightly snapshot at https://github.com/Cellular-Semantics/cell-annotation-schema/releases

Release assets include a core schema file and extensions (currently for BICAN and the Cell Annotation Platform).

PyPI release is at https://pypi.org/project/cell-annotation-schema/

You can discover instructions on utilizing the PyPI package by visiting the following link https://github.com/cellannotation/cell-annotation-schema/blob/main/docs/pypi_package.md.

Metadata

Release files for cas-linkml 0.0.16

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cas-linkml 0.0.16
File Size Uploaded Provenance
cas_linkml-0.0.16.tar.gz 2.1 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cas-linkml 0.0.16
File Interpreter ABI Platform
cas_linkml-0.0.16-py3-none-any.whl Python 3 none any Details

Total release size: 4.2 MB

Release files / cas_linkml-0.0.16.tar.gz

Download URL cas_linkml-0.0.16.tar.gz
Size 2.1 MB
Tags Source
SHA-256 checksum
How to use checksums
202a897a6d3bff600c368fec23392890ab306d68c7e6ab1ed4368024f19d4b59
BLAKE2b-256 checksum
How to use checksums
3d22f51548bbc801108fc3153db59804f269c23039a13a378821a1ba3d696f5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.12.3 Linux/6.11.0-1018-azure

Release files / cas_linkml-0.0.16-py3-none-any.whl

Download URL cas_linkml-0.0.16-py3-none-any.whl
Size 2.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
e6741da2ea96d2a8416a7772af09b39765b3a5b56a56eecaf6e0ba6062e131a1
BLAKE2b-256 checksum
How to use checksums
855109b74a02808b866ba2743a589861482b6112a4dda015c3dca1d28b8e0d9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.12.3 Linux/6.11.0-1018-azure

Security for cas-linkml 0.0.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page