Closed eisascience closed 2 months ago
Sorry, I don't know what you mean.
In R, I can do something like: st.seq[["percent.mt"]] <- PercentageFeatureSet(st.seq, pattern = "^mt-") or st.seq[["percent.mt"]] <- PercentageFeatureSet(st.seq, geneSet=MyCustomSet)
what would be the equivalent here ? thanks
Run data.tl.cal_qc(), then you can get the indicator you mentioned by data.cells['pct_counts_mt'], note that you need to do it before any normalization methods.
The default approach doesnt always work.. it looks for like MT- genes... but what if MT- genes are not enough? or due to the ref genome dont exist in that nomenclature ?
Need a way to recompute with a custom set of genes ...
scanpy (which is the core of stereopy) has something like below.. but its not enough... I need to say have a vector of mt genes .. say myMTgenes = customCharVectorOfGenes
annotate the group of mitochondrial genes as "mt"
adata.var["mt"] = adata.var_names.str.startswith("MT-") sc.pp.calculate_qc_metrics( adata, qc_vars=["mt"], percent_top=None, log1p=False, inplace=True )