Skip to main content

Python tool for validating H5AD AnnData files before uploading to the Cell Annotation Platform.

Project description

cap-validator

PyPI version License Build Status

Overview

Python tool for validating H5AD AnnData files before uploading to the Cell Annotation Platform. The same validation code is used in Cell Annotation Platform following requirements from the CAP-AnnData schema published here.

Full documentation could be found in the GitHub Wiki

Features

  • ✨ Validates all upload requirements and returns results at once
  • 🚀 RAM efficient
  • 🧬 Provides a full list of supported ENSEMBL gene IDs for Homo sapiens and Mus musculus

Installation

pip install -U cap-upload-validator

Usage

Basic usage

from cap_upload_validator import UploadValidator

h5ad_path = "path_to.h5ad"

uv = UploadValidator(h5ad_path)
uv.validate()

CLI interface

$ capval tmp/tmp.h5ad
CapMultiException: 
AnnDataMissingEmbeddings: 
        The embedding is missing or is incorrectly named: embeddings must be a [n_cells x 2] 
        numpy array saved with the prefix X_, for example: X_tsne, X_pca or X_umap.
        
AnnDataMisingObsColumns: 
            Required obs column(s) missing: file must contain 
            'assay', 'disease', 'organism' and 'tissue' fields with valid values.
        
For details visit: 
        https://github.com/cellannotation/cap-validator/wiki/Validation-Errors

$ capval --help
usage: capval [-h] adata_path

CLI tool to validate an AnnData H5AD file before uploading to the Cell Annotation Platform.
The validator will raise CAP-specific errors if the file does not follow the CAP AnnData Schema,
as defined in:
https://github.com/cellannotation/cell-annotation-schema/blob/main/docs/cap_anndata_schema.md

Full documentation, including a list of possible validation errors, is available at:
https://github.com/cellannotation/cap-validator/wiki

Usage Example:
    `capval path/to/anndata.h5ad`

positional arguments:
  adata_path  Path to the AnnData h5ad file.

optional arguments:
  -h, --help  show this help message and exit

License

BSD 3-Clause License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cap_upload_validator-1.7.0.tar.gz (2.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cap_upload_validator-1.7.0-py3-none-any.whl (2.5 MB view details)

Uploaded Python 3

File details

Details for the file cap_upload_validator-1.7.0.tar.gz.

File metadata

File hashes

Hashes for cap_upload_validator-1.7.0.tar.gz
Algorithm Hash digest
SHA256 cdc9da65e84deecd4833e472bb126d0deed7521a34406b7c46c468a488bf9b1a
MD5 345f79fa796eed26cfc2e992542c932b
BLAKE2b-256 a12a64aa929ea1dbadd10e8788e1391fb6d5e038593892c841c17d272da53b23

See more details on using hashes here.

File details

Details for the file cap_upload_validator-1.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cap_upload_validator-1.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c49ad0882fd5568a8d93c0ffc024edcc6e82fc2f564551e381592f1a5ffcc31e
MD5 bc4fdb18a4252e39663136066f4fa74b
BLAKE2b-256 102c75edf09e04416b37389241f5a55d9aaf92b12e677cfd0ff4c7355a9a70c6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page