pachterlab / kallistobustools

kallisto | bustools workflow for pre-processing single-cell RNA-seq data
https://kallistobus.tools/
MIT License
115 stars 29 forks source link

mitochondrial gene filtering #21

Open AuroreCapillon opened 3 years ago

AuroreCapillon commented 3 years ago

Hi,

While cleaning my data following your protocol (kb_into_2_python) I ran into an issue concerning the mitochondrial filtering. When running :

mito_ensembl_ids = sc.queries.mitochondrial_genes("dmelanogaster", attrname="ensembl_gene_id")
mito_genes = mito_ensembl_ids["external_gene_name"].values

adata.obs['percent_mito'] = np.sum(
    adata[:, mito_genes].X, axis=1).A1 / np.sum(adata.X, axis=1).A1

adata.obs['n_counts'] = adata.X.sum(axis=1).A1

I get 0 mitochondrial gene/cell. However they are still present as I find some in the following steps (highly variable genes). I am applying it on Drosophila melanogaster. In my transcripts_to_genes file the mitochondrial genes are annotated "mt:", so I tried to adapt the code : mito_ensembl_ids = sc.queries.mitochondrial_genes("dmelanogaster", attrname="ensembl_gene_id",chromosome='mt:')

I also tried to change ensembl_gene_id into external_gene_name, but to no avail. Did anyone encounter the same issue ?