Arts-of-coding commited on
Commit
5440309
·
verified ·
1 Parent(s): 39d9809

Update dash_plotly_QC_scRNA.py

Browse files
Files changed (1) hide show
  1. dash_plotly_QC_scRNA.py +3 -3
dash_plotly_QC_scRNA.py CHANGED
@@ -413,10 +413,10 @@ def update_graph_and_pie_chart(batch_chosen, s_chosen, g2m_chosen, condition1_ch
413
  dff_5 = dff_long4.join(dff_long3, on=["batch","Gene"], how="outer")
414
  result = dff_5.select([
415
  pl.when((pl.col('len').is_not_null()) & (pl.col('total').is_not_null()))
416
- .then(pl.col('len') / pl.col('total'))
417
  .otherwise(None).alias("%"),
418
  ])
419
- result = result.with_columns(pl.col("%").fill_null(1.0))
420
  dff_5[["percentage"]] = result[["%"]]
421
  dff_5 = dff_5.select(pl.col("batch","Gene","percentage"))
422
 
@@ -475,7 +475,7 @@ def update_graph_and_pie_chart(batch_chosen, s_chosen, g2m_chosen, condition1_ch
475
  hover_name='batch',template="seaborn")
476
 
477
  fig_scatter_12 = px.scatter(data_frame=expression_means, x="Gene", y="batch", color="Mean expression",
478
- size="percentage", size_max = 10,
479
  #labels={'X_umap-0': 'umap1' , 'X_umap-1': 'umap2'},
480
  hover_name='batch',template="seaborn")
481
 
 
413
  dff_5 = dff_long4.join(dff_long3, on=["batch","Gene"], how="outer")
414
  result = dff_5.select([
415
  pl.when((pl.col('len').is_not_null()) & (pl.col('total').is_not_null()))
416
+ .then(pl.col('len') / pl.col('total')*100)
417
  .otherwise(None).alias("%"),
418
  ])
419
+ result = result.with_columns(pl.col("%").fill_null(100))
420
  dff_5[["percentage"]] = result[["%"]]
421
  dff_5 = dff_5.select(pl.col("batch","Gene","percentage"))
422
 
 
475
  hover_name='batch',template="seaborn")
476
 
477
  fig_scatter_12 = px.scatter(data_frame=expression_means, x="Gene", y="batch", color="Mean expression",
478
+ size="percentage", size_max = 100,
479
  #labels={'X_umap-0': 'umap1' , 'X_umap-1': 'umap2'},
480
  hover_name='batch',template="seaborn")
481