Skip to content
 
 

Repository files navigation

subcellular-proteomics-curation

An adjusted version of CZI's cellxgene-schema, repurposed for subcellular proteomics datasets. The original tool validates single-cell genomics data against the cellxgene schema using GENCODE gene references; this fork swaps gene validation for UniProt protein validation and trims the genomics-only machinery (ATAC-seq, spatial/Visium, species mapping, schema migration, and the original CLI).

It is used as a library enabling validation scripts for anndata objects that are generated by grassp analysis.

Installation

The package lives in the cellxgene_schema_cli/ subdirectory. Install it directly from GitHub with pip:

pip install "git+https://github.com/czbiohub-sf/subcellular-proteomics-curation.git#subdirectory=cellxgene_schema_cli"

This pulls in all dependencies, including the ontology data package grassp-ontology-guide (a CZ Biohub fork of cellxgene-ontology-guide that adds non-animal organisms such as yeast). That wheel is referenced directly in requirements.txt; if you need to install it on its own:

pip install https://github.com/czbiohub-sf/grassp-ontology-guide/releases/download/v1.9.0/cellxgene_ontology_guide-1.9.0-py3-none-any.whl

Install from a local clone

make install   # runs: cd cellxgene_schema_cli && pip install -r requirements.txt && pip install .

Usage

The package is consumed as a library. The key entry points:

from cellxgene_schema import validate
from cellxgene_schema.write_labels import AnnDataLabelAppender
from cellxgene_schema.uniprot import GeneChecker

# Validate an in-memory AnnData object
validator = validate.Validator()
validator.adata = adata
validator._set_schema_def()
validator._deep_check()
print(validator.errors, validator.warnings)

# Append human-readable labels (protein names, lengths, locations, ontology labels)
appender = AnnDataLabelAppender(adata)
appender._add_labels()

See validate_objects.py and annotate_objects.py in the curation_grassp project for the full validation and annotation workflow.

Protein references

Protein validation uses gzipped UniProt TSV files bundled in cellxgene_schema_cli/cellxgene_schema/uniprot_files/. Supported organisms are configured in the SupportedOrganisms enum in cellxgene_schema/uniprot.py. The reference files are regenerated with cellxgene_schema_cli/scripts/protein_processing.py --force, and outdated UniProt accessions can be remapped with scripts/update_uniprot_ids.py.

Bundled reference version

The files currently committed were downloaded from UniProt release 2026_02 (released 10-June-2026), retrieved 26-August-2026.

file accessions reviewed (Swiss-Prot)
proteins_homo_sapiens.tsv.gz 210,709 20,431
proteins_mus_musculus.tsv.gz 87,782 17,267
proteins_rattus_norvegicus.tsv.gz 61,540 8,232
proteins_drosophila_melanogaster.tsv.gz 42,895 3,899
proteins_saccharomyces_cerevisiae.tsv.gz 6,733 6,733

Each file has the columns requested by the per-species query in uniprot_files/protein_info.yml: Entry, Reviewed, Length, Gene Names (primary), Gene Names (synonym), Annotation (annotation score), Protein names, Subcellular location [CC].

Schema definition

The validation rules live in cellxgene_schema_cli/cellxgene_schema/schema_definitions/schema_definition.yaml.

Development

make unit-test   # run the unit tests
make check       # pre-commit (black, ruff) + mypy

Authors

This is a fork of CZI's single-cell-curation (the cellxgene-schema tool), originally developed by the Chan Zuckerberg Initiative.

This fork is maintained by the Computational Biology Platform at the Chan Zuckerberg Biohub San Francisco.

About

Code and documentation for the curation of grassp datasets

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages