dylanplummer commited on
Commit
d0bebed
·
1 Parent(s): dd2eb16

cosmetic upgrades

Browse files
Files changed (2) hide show
  1. README.md +1 -1
  2. app.py +7 -7
README.md CHANGED
@@ -1,6 +1,6 @@
1
  ---
2
  title: HiGLUE
3
- emoji: 🐢
4
  colorFrom: indigo
5
  colorTo: yellow
6
  sdk: gradio
 
1
  ---
2
  title: HiGLUE
3
+ emoji: 📿
4
  colorFrom: indigo
5
  colorTo: yellow
6
  sdk: gradio
app.py CHANGED
@@ -173,7 +173,7 @@ def perturb(gene, locus1, locus2):
173
  # get integer index of gene
174
  gene_idx = gene_idx_map[gene]
175
  rna.obs['log2FC'] = ism[:, gene_idx]
176
- rna.obs['new_counts'] = perterbed_rna_recon[:, gene_idx]
177
 
178
  fig = sc.pl.umap(rna,
179
  color=['celltype', 'log2FC'],
@@ -194,24 +194,24 @@ def perturb(gene, locus1, locus2):
194
  # convert from argb to rgba
195
  image_from_plot = image_from_plot[:, :, [1, 2, 3, 0]]
196
 
197
- fig, ax = plt.subplots(figsize=(6, 3))
198
- sc.pl.violin(rna, gene, groupby='celltype', layer='counts', show=False, ax=ax)
199
  ax.set_title(f'Normal {gene} expression')
200
  fig.canvas.draw()
201
  violin_img = np.frombuffer(fig.canvas.tostring_argb(), dtype=np.uint8)
202
  violin_img = violin_img.reshape(fig.canvas.get_width_height()[::-1] + (4,))
203
  violin_img = violin_img[:, :, [1, 2, 3, 0]]
204
 
205
- fig, ax = plt.subplots(figsize=(6, 3))
206
- sc.pl.violin(rna, 'new_counts', groupby='celltype', show=False, ax=ax)
207
  ax.set_title(f'{gene} expression after perturbation')
208
  fig.canvas.draw()
209
  violin_img_new = np.frombuffer(fig.canvas.tostring_argb(), dtype=np.uint8)
210
  violin_img_new = violin_img_new.reshape(fig.canvas.get_width_height()[::-1] + (4,))
211
  violin_img_new = violin_img_new[:, :, [1, 2, 3, 0]]
212
 
213
- fig, ax = plt.subplots(figsize=(6, 3))
214
- sc.pl.violin(rna, 'log2FC', groupby='celltype', show=False, ax=ax)
215
  ax.set_title(f'{gene} expression change')
216
  ax.hlines(0, -1, len(celltypes), linestyles='dashed')
217
  fig.canvas.draw()
 
173
  # get integer index of gene
174
  gene_idx = gene_idx_map[gene]
175
  rna.obs['log2FC'] = ism[:, gene_idx]
176
+ rna.obs['new_mean'] = perterbed_rna_recon[:, gene_idx]
177
 
178
  fig = sc.pl.umap(rna,
179
  color=['celltype', 'log2FC'],
 
194
  # convert from argb to rgba
195
  image_from_plot = image_from_plot[:, :, [1, 2, 3, 0]]
196
 
197
+ fig, ax = plt.subplots(figsize=(6, 4))
198
+ sc.pl.violin(rna, gene, groupby='celltype', layer='counts', show=False, ax=ax, rotation=90)
199
  ax.set_title(f'Normal {gene} expression')
200
  fig.canvas.draw()
201
  violin_img = np.frombuffer(fig.canvas.tostring_argb(), dtype=np.uint8)
202
  violin_img = violin_img.reshape(fig.canvas.get_width_height()[::-1] + (4,))
203
  violin_img = violin_img[:, :, [1, 2, 3, 0]]
204
 
205
+ fig, ax = plt.subplots(figsize=(6, 4))
206
+ sc.pl.violin(rna, 'new_mean', groupby='celltype', show=False, ax=ax, rotation=90)
207
  ax.set_title(f'{gene} expression after perturbation')
208
  fig.canvas.draw()
209
  violin_img_new = np.frombuffer(fig.canvas.tostring_argb(), dtype=np.uint8)
210
  violin_img_new = violin_img_new.reshape(fig.canvas.get_width_height()[::-1] + (4,))
211
  violin_img_new = violin_img_new[:, :, [1, 2, 3, 0]]
212
 
213
+ fig, ax = plt.subplots(figsize=(6, 4))
214
+ sc.pl.violin(rna, 'log2FC', groupby='celltype', show=False, ax=ax, rotation=90)
215
  ax.set_title(f'{gene} expression change')
216
  ax.hlines(0, -1, len(celltypes), linestyles='dashed')
217
  fig.canvas.draw()