We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6b4d7e6 commit 935af04Copy full SHA for 935af04
2 files changed
src/pySingleCellNet/utils/__init__.py
@@ -16,6 +16,7 @@
16
from .gene import (
17
score_gene_modules,
18
find_knn_modules,
19
+ what_module_has_gene,
20
extract_top_bottom_genes,
21
rank_genes_subsets,
22
pull_out_genes,
src/pySingleCellNet/utils/gene.py
@@ -109,6 +109,20 @@ def find_knn_modules(
109
adata.uns['knn_modules'] = modules
110
111
112
+def what_module_has_gene(
113
+ adata,
114
+ target_gene,
115
+ mod_slot='knn_modules'
116
+) -> list:
117
+ if mod_slot not in adata.uns.keys():
118
+ raise ValueError(mod_slot + " have not been identified.")
119
+ genemodules = adata.uns[mod_slot]
120
+ return [key for key, genes in genemodules.items() if target_gene in genes]
121
+
122
123
124
125
126
127
128
def extract_top_bottom_genes(
0 commit comments