cellxgene_lamin_validator.Validator#

class cellxgene_lamin_validator.Validator(adata, var_field=FieldAttr(Gene.ensembl_gene_id), obs_fields={'assay': FieldAttr(ExperimentalFactor.name), 'assay_ontology_term_id': FieldAttr(ExperimentalFactor.ontology_id), 'cell_type': FieldAttr(CellType.name), 'cell_type_ontology_term_id': FieldAttr(CellType.ontology_id), 'development_stage': FieldAttr(DevelopmentalStage.name), 'development_stage_ontology_term_id': FieldAttr(DevelopmentalStage.ontology_id), 'disease': FieldAttr(Disease.name), 'disease_ontology_term_id': FieldAttr(Disease.ontology_id), 'donor_id': FieldAttr(ULabel.name), 'organism': FieldAttr(Organism.name), 'organism_ontology_term_id': FieldAttr(Organism.ontology_id), 'self_reported_ethnicity': FieldAttr(Ethnicity.name), 'self_reported_ethnicity_ontology_term_id': FieldAttr(Ethnicity.ontology_id), 'sex': FieldAttr(Phenotype.name), 'sex_ontology_term_id': FieldAttr(Phenotype.ontology_id), 'suspension_type': FieldAttr(ULabel.name), 'tissue': FieldAttr(Tissue.name), 'tissue_ontology_term_id': FieldAttr(Tissue.ontology_id), 'tissue_type': FieldAttr(ULabel.name)}, using='laminlabs/cellxgene', verbosity='hint', **kwargs)#

Bases: AnnDataValidator

CELLxGENE Lamin validator.

Attributes

adata_curated AnnData#

Return the curated AnnData object.

fields Dict#

Return the columns fields to validate against.

obs_fields Dict#

Return the obs fields to validate against.

var_field DeferredAttribute#

Return the registry field to validate variables index against.

Methods

to_cellxgene(is_primary_data, title=None)#

Converts the AnnData object to the cellxgene-schema input format.

Be aware that this function only implements the most important requires of the CELLxGENE schema. If you want to ensure that it fully adheres to the CELLxGENE schema, run cellxgene-schema on the AnnData object.

Parameters:
  • is_primary_data (bool) – Whether the measured data is primary data or not.

  • title (Optional[str], default: None) – Title of the AnnData object. Commonly the name of the publication. This parameter is required if the AnnData object is not a part of a collection.

Return type:

AnnData

Returns:

An AnnData object which adheres to the cellxgene-schema.