def tab_content(active_tab): if active_tab == "tab-qc": fig_qc = st.plot_qc(adata, jitter=0.2, fig_size=(2, 2), return_svg=True) return html.Img( src="data:image/svg+xml;base64,{}".format(fig_qc)), card_qc elif active_tab == "tab-dr": return html.Div(id="dr-graphic"), card_dr elif active_tab == "tab-sp": return html.Div(id="st-graphic"), card_sp else: fig = st.plot_stream(adata, root='S1', return_svg=True) return card_content_ds, card_ds
from dash.dependencies import Input, Output import dash_bootstrap_components as dbc import numpy as np import stream as st import matplotlib matplotlib.use('Agg') from app import app adata = st.read(file_name='./SampleData/Nestorowa_2016/Nestorowa-2016.pkl', workdir='./stream_result') adata.uns[ 'discription'] = 'This scRNA-seq dataset contains 1656 cells and 4768 genes from mouse hematopoietic stem and progenitor cell differentiation. A single-cell resolution map of mouse hematopoietic stem and progenitor cell differentiation. Blood 128, e20-31 (2016).' fig_qc = st.plot_qc(adata, jitter=0.2, fig_size=(2, 2), return_svg=True) available_samples = [ 'Nestorowa, S. et al. 2016', 'Harrison, S. et al. 2021', 'Trapnell, C. et al. 2014', ' Tang, Q. et al. 2017' ] available_projections = [ 'dimension_reduction', 'visualization_2D', 'flat_tree', 'branches' ] available_colors = adata.obs.columns available_stream = ['single_cell_stream', 'stream'] layout = html.Div([ dbc.Container([ dbc.Col(html.H1("Visualization", className="text-center"), className="mb-5 mt-5"),
className="card-title", style={'textAlign': 'center'}), html.P(adata.uns['discription']), dbc.Row( [dbc.Col(card_assay), dbc.Col(card_cell), dbc.Col(card_feature)], className="mb-4", ) ]), ], ) # Pre fig_qc = st.plot_qc(adata_computed, size=0, jitter=0, fig_size=(2, 2), return_svg=True) card_C_qc_finished = dbc.FormGroup([ html.Img(src="data:image/svg+xml;base64,{}".format(fig_qc), style={ 'width': '100%', 'height': '400px', 'lineHeight': '400px', 'borderWidth': '1px', 'borderStyle': 'dashed', 'borderRadius': '5px', 'textAlign': 'center', }), dbc.CardBody([