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

more cosmetic upgrades

Browse files
Files changed (2) hide show
  1. README.md +1 -1
  2. app.py +4 -1
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
@@ -184,7 +184,7 @@ def perturb(gene, locus1, locus2):
184
  frameon=False,
185
  return_fig=True)
186
  fig.suptitle(f'{gene} expression after removing ' + a1 + '-' + a2)
187
- fig.tight_layout()
188
  #fig.patch.set_facecolor('none')
189
  #fig.patch.set_alpha(0.0)
190
 
@@ -197,6 +197,7 @@ def perturb(gene, locus1, locus2):
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,))
@@ -205,6 +206,7 @@ def perturb(gene, locus1, locus2):
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,))
@@ -214,6 +216,7 @@ def perturb(gene, locus1, locus2):
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()
218
  violin_img_fc = np.frombuffer(fig.canvas.tostring_argb(), dtype=np.uint8)
219
  violin_img_fc = violin_img_fc.reshape(fig.canvas.get_width_height()[::-1] + (4,))
 
184
  frameon=False,
185
  return_fig=True)
186
  fig.suptitle(f'{gene} expression after removing ' + a1 + '-' + a2)
187
+ #fig.tight_layout()
188
  #fig.patch.set_facecolor('none')
189
  #fig.patch.set_alpha(0.0)
190
 
 
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.tight_layout()
201
  fig.canvas.draw()
202
  violin_img = np.frombuffer(fig.canvas.tostring_argb(), dtype=np.uint8)
203
  violin_img = violin_img.reshape(fig.canvas.get_width_height()[::-1] + (4,))
 
206
  fig, ax = plt.subplots(figsize=(6, 4))
207
  sc.pl.violin(rna, 'new_mean', groupby='celltype', show=False, ax=ax, rotation=90)
208
  ax.set_title(f'{gene} expression after perturbation')
209
+ fig.tight_layout()
210
  fig.canvas.draw()
211
  violin_img_new = np.frombuffer(fig.canvas.tostring_argb(), dtype=np.uint8)
212
  violin_img_new = violin_img_new.reshape(fig.canvas.get_width_height()[::-1] + (4,))
 
216
  sc.pl.violin(rna, 'log2FC', groupby='celltype', show=False, ax=ax, rotation=90)
217
  ax.set_title(f'{gene} expression change')
218
  ax.hlines(0, -1, len(celltypes), linestyles='dashed')
219
+ fig.tight_layout()
220
  fig.canvas.draw()
221
  violin_img_fc = np.frombuffer(fig.canvas.tostring_argb(), dtype=np.uint8)
222
  violin_img_fc = violin_img_fc.reshape(fig.canvas.get_width_height()[::-1] + (4,))