terra.harmonize_adata#
- terra.harmonize_adata(adata, gene_mapping_dict_file_path=None, gene_occurrence_count_file_path=None, gene_occurrence_count_filter_value=10, ensembl_release=111, species='human', min_genes_per_cell=10, min_cells_per_gene=10)#
Harmonize an AnnData object prior to tokenization.
- Parameters:
adata (
AnnData) – An unharmonized AnnData object.gene_mapping_dict_file_path (
Optional[str] (default:None)) – Path to a pickled gene-name-to-ensembl-ID mapping dictionary. IfNone, ensembl IDs are looked up from the specified Ensembl release instead.gene_occurrence_count_file_path (
Optional[str] (default:None)) – Path to a pickled dictionary of per-gene pretraining occurrence counts. If provided, genes with too few occurrences are filtered out; ifNone, this filtering step is skipped.gene_occurrence_count_filter_value (
int(default:10)) – Minimum number of pretraining occurrences a gene must have to be kept.ensembl_release (
int(default:111)) – Ensembl release used to retrieve ensembl IDs.species (
str(default:'human')) – Species passed to the Ensembl release lookup.min_genes_per_cell (
int(default:10)) – Minimum amount of genes per cell for a cell not to be filtered.min_cells_per_gene (
int(default:10)) – Minimum number of cells a gene must be expressed in for the gene not to be filtered.
- Returns:
adata (
AnnData) – A harmonized AnnData object.