Spaces:
Runtime error
Runtime error
Commit ·
276281c
1
Parent(s): 09fc963
try to save memory
Browse files
app.py
CHANGED
|
@@ -278,7 +278,6 @@ def get_heatmaps(gene, locus1, locus2, heatmap_range):
|
|
| 278 |
|
| 279 |
|
| 280 |
def perturb(gene, locus1, locus2, use_max_gene, tf_knockout):
|
| 281 |
-
in_rna = rna.copy()
|
| 282 |
if tf_knockout:
|
| 283 |
guidance_hvf = prior.copy()
|
| 284 |
try:
|
|
@@ -287,8 +286,6 @@ def perturb(gene, locus1, locus2, use_max_gene, tf_knockout):
|
|
| 287 |
pass
|
| 288 |
# find index of tf and set all counts and values to zero
|
| 289 |
gene_idx = gene_idx_map[gene]
|
| 290 |
-
in_rna.layers['counts'][:, gene_idx] = 0
|
| 291 |
-
in_rna.X[:, gene_idx] = 0
|
| 292 |
a1 = get_closest_peak_to_gene(gene, rna, peaks)
|
| 293 |
try:
|
| 294 |
guidance_hvf.remove_node(a1)
|
|
@@ -367,7 +364,7 @@ def perturb(gene, locus1, locus2, use_max_gene, tf_knockout):
|
|
| 367 |
except:
|
| 368 |
pass
|
| 369 |
|
| 370 |
-
perterbed_rna_recon = glue.decode_data("rna", "rna",
|
| 371 |
ism = np.log2((perterbed_rna_recon + eps) / (rna_recon + eps))
|
| 372 |
if tf_knockout:
|
| 373 |
max_gene_idxs = np.abs(np.mean(ism, axis=0)).argsort()[::-1][:10]
|
|
|
|
| 278 |
|
| 279 |
|
| 280 |
def perturb(gene, locus1, locus2, use_max_gene, tf_knockout):
|
|
|
|
| 281 |
if tf_knockout:
|
| 282 |
guidance_hvf = prior.copy()
|
| 283 |
try:
|
|
|
|
| 286 |
pass
|
| 287 |
# find index of tf and set all counts and values to zero
|
| 288 |
gene_idx = gene_idx_map[gene]
|
|
|
|
|
|
|
| 289 |
a1 = get_closest_peak_to_gene(gene, rna, peaks)
|
| 290 |
try:
|
| 291 |
guidance_hvf.remove_node(a1)
|
|
|
|
| 364 |
except:
|
| 365 |
pass
|
| 366 |
|
| 367 |
+
perterbed_rna_recon = glue.decode_data("rna", "rna", rna, guidance_hvf)
|
| 368 |
ism = np.log2((perterbed_rna_recon + eps) / (rna_recon + eps))
|
| 369 |
if tf_knockout:
|
| 370 |
max_gene_idxs = np.abs(np.mean(ism, axis=0)).argsort()[::-1][:10]
|