remove genes

Remove a gene from the dataset. Preserves the complete var names in raw attribute.

Parameters

remove_genes: List[str] A list of gene names to remove.


Web view

remove_genes_screenshot

Python equivalent

import scanpy as sc

remove_genes_list = ['malat1']
for gene in remove_genes_list:
    remove_genes = adata.var_names.str.startswith(gene)
    remove = np.array(remove_genes)
    keep = np.invert(remove)
    adata = adata[:,keep]