AnnData#

adata_dict utility functions for anndata. Some of these ease manipulation of and information retrieval from AnnData.

Get column names from adata.obs with string matching#

get_adata_columns(adata[, starts_with, ...])

A simple string matching and filtering function to get column names from adata.obs.

Remove genes#

remove_genes(adata, genes_to_remove[, adt_key])

Remove specified genes from an AnnData object in-place.

Add metadata#

add_col_to_adata_obs(adata, indices, values, ...)

Adds a column to adata.obs for given indices.

add_col_to_adata_var(adata, indices, values, ...)

Adds a column to adata.var for given indices.

add_col_to_pd_df(pd_df, indices, values, ...)

Adds a column to pd_df for given indices.

Convert column dtypes#

convert_obs_col_to_category(adata, cols)

Convert column(s) in adata.obs to category dtype.

convert_obs_col_to_string(adata, cols)

Convert column(s) in adata.obs to str dtype.

convert_obs_index_to_str(adata)

Converts the index of adata.obs to str.

Filter a list of genes based on their presence in adata.var.index#

filter_gene_list(adata, gene_list)

Filter a list of genes based on their presence in adata.var.index.