Spaces:
Runtime error
Runtime error
Commit ·
339f7e8
1
Parent(s): ec304d3
quick fix
Browse files
app.py
CHANGED
|
@@ -206,9 +206,9 @@ def get_heatmap(celltype, gene, locus1, locus2, heatmap_range):
|
|
| 206 |
a1_start = int(locus1.split(':')[1])
|
| 207 |
else:
|
| 208 |
try:
|
| 209 |
-
loc = rna.var.loc[
|
| 210 |
except KeyError:
|
| 211 |
-
print('Could not find loci',
|
| 212 |
return None
|
| 213 |
a1_chrom = loc["chrom"]
|
| 214 |
a1_start = loc["chromStart"]
|
|
@@ -218,9 +218,9 @@ def get_heatmap(celltype, gene, locus1, locus2, heatmap_range):
|
|
| 218 |
a2_start = int(locus2.split(':')[1])
|
| 219 |
else:
|
| 220 |
try:
|
| 221 |
-
loc = rna.var.loc[
|
| 222 |
except KeyError:
|
| 223 |
-
print('Could not find loci',
|
| 224 |
return None
|
| 225 |
a2_chrom = loc["chrom"]
|
| 226 |
a2_start = loc["chromStart"]
|
|
@@ -236,8 +236,9 @@ def get_heatmap(celltype, gene, locus1, locus2, heatmap_range):
|
|
| 236 |
plt.axis('image')
|
| 237 |
|
| 238 |
w, h = fig.canvas.get_width_height()
|
| 239 |
-
heatmap_x =
|
| 240 |
-
heatmap_y =
|
|
|
|
| 241 |
ax.scatter(int(heatmap_x), int(heatmap_y), color='green', marker='*', s=100)
|
| 242 |
|
| 243 |
# redraw the canvas
|
|
|
|
| 206 |
a1_start = int(locus1.split(':')[1])
|
| 207 |
else:
|
| 208 |
try:
|
| 209 |
+
loc = rna.var.loc[gene]
|
| 210 |
except KeyError:
|
| 211 |
+
print('Could not find loci', gene)
|
| 212 |
return None
|
| 213 |
a1_chrom = loc["chrom"]
|
| 214 |
a1_start = loc["chromStart"]
|
|
|
|
| 218 |
a2_start = int(locus2.split(':')[1])
|
| 219 |
else:
|
| 220 |
try:
|
| 221 |
+
loc = rna.var.loc[gene]
|
| 222 |
except KeyError:
|
| 223 |
+
print('Could not find loci', gene)
|
| 224 |
return None
|
| 225 |
a2_chrom = loc["chrom"]
|
| 226 |
a2_start = loc["chromStart"]
|
|
|
|
| 236 |
plt.axis('image')
|
| 237 |
|
| 238 |
w, h = fig.canvas.get_width_height()
|
| 239 |
+
heatmap_x = (a1_idx / len(bins)) * w
|
| 240 |
+
heatmap_y = (a2_idx / len(bins)) * h
|
| 241 |
+
print(heatmap_x, heatmap_y)
|
| 242 |
ax.scatter(int(heatmap_x), int(heatmap_y), color='green', marker='*', s=100)
|
| 243 |
|
| 244 |
# redraw the canvas
|