Пример #1
0
def get_layout():
    # df = compile_fcs()
    fcs = sf.find_unique_values(fcs_df, 'runid')
    fc_dropdown = dcc.Dropdown(id="flowcell-dropdown",
                               multi=False,
                               placeholder="Choose flowcell",
                               options=fcs)

    z_sel = html.Div([
        html.H5('Z Scale'),
        dcc.RadioItems(id="z-scale",
                       options=[{
                           'label': '   Linear',
                           'value': 'linear'
                       }, {
                           'label': '   Log10',
                           'value': 'log'
                       }],
                       value='linear')
    ])

    plate_slider = html.Div([
        html.H5('Plate Number'),
        dcc.Slider(id='plt-slider',
                   min=1,
                   max=24,
                   step=1,
                   value=1,
                   marks={i: str(i)
                          for i in range(1, 25)})
    ],
                            style={
                                'width': '49%',
                                'padding': '0px 20px 20px 20px'
                            })

    csv_button = sf.make_row(
        sf.make_col(
            html.A(children=[
                html.I(className="fas fa-download"),
                "  Download Sample Level Data"
            ],
                   id="sample-download",
                   download="c19_read_counts.csv",
                   href="",
                   target="_blank",
                   className="btn btn-default downloadButton",
                   role="button")))

    count_hm = html.Div([dcc.Graph(id='ct-hm')], className="six columns")

    pct_hm = html.Div([dcc.Graph(id='pct-hm')], className="six columns")

    norm_hm = html.Div([dcc.Graph(id='plt-avg-hm')], className='six columns')

    sel_row = html.Div([z_sel, plate_slider], className='row')

    layout = html.Div(
        [fc_dropdown, sel_row, csv_button, norm_hm, pct_hm, count_hm])
    return layout
Пример #2
0
def get_layout():
    site = pd.read_csv(
        '/ghds/groups/labdesk/bshih/c19dash/c19_dashboard/c19_tat.csv').fillna(0)

    sample_textarea = html.Div([dcc.Textarea(
        id='textarea',
        placeholder='Please Enter Sample ID Separated By Commas eg. HCP0327, HCP0393, HCE1369',
        style={'width': '50%', 'height': 50}
    )
    ])

    date_range = html.Div([dcc.DatePickerRange(
        id='date-range',
        clearable=True),
        html.Div(id='date-range-output')
    ])

    site = site[site['Site Name'].notnull()]['Site Name'].unique()
    site.sort()

    site_dropdown = html.Div(dcc.Dropdown(
        id='site-dropdown',
        options=[{"label": i, "value": i} for i in site],
        placeholder='Collection Site',
        multi=True)
    )

    query_button = sf.make_row(children=[sf.make_col(html.Button('Submit', id='query-button', n_clicks=0),
                                                     col_num=1)])

    textarea_button = sf.make_row(children=[sf.make_col(html.Button('Submit', id='textarea-button', n_clicks=0),
                                                        col_num=1)])

    smp_id_table = sf.make_row(
        html.Div(id='smp-id-table', style={'width': '100%'}))

    smp_site_date_table = sf.make_row(
        html.Div(id='smp-site-date-table', style={'width': '100%'}))

    layout = html.Div([html.H5('Enter Sample ID'), sample_textarea, textarea_button,
                       html.H5('Sample Information'), smp_id_table,
                       html.H5('Pick Site or Date Range or Both'), date_range,
                       site_dropdown, query_button, smp_site_date_table
                       ])

    return layout
Пример #3
0
def get_layout():
    date_range = html.Div([
        dcc.DatePickerRange(id='date-picker-range'),
        html.Div(id='output-container-date-picker-range')
    ])

    fc_submit = sf.make_row(children=[
        sf.make_col(html.Button(
            "Submit", id="fc-button", n_clicks=0, n_clicks_timestamp=0),
                    col_num=1)
    ])

    submit_res = html.Div(id='button-res-monitor')

    pos_plot = sf.make_row(
        dcc.Graph(id='pos-plot-monitoring',
                  style={
                      'width': '75%',
                      'overflowX': 'auto'
                  },
                  config={'displayModeBar': True}))
    neg_plot = sf.make_row(
        dcc.Graph(id='neg-plot-monitoring',
                  style={
                      'width': '75%',
                      'overflowX': 'auto'
                  },
                  config={'displayModeBar': True}))

    pos_trip_plot = sf.make_row(
        dcc.Graph(id='pos-trip-plot-monitoring',
                  style={
                      'width': '75%',
                      'overflowX': 'auto'
                  },
                  config={'displayModeBar': True}))
    neg_trip_plot = sf.make_row(
        dcc.Graph(id='neg-trip-plot-monitoring',
                  style={
                      'width': '75%',
                      'overflowX': 'auto'
                  },
                  config={'displayModeBar': True}))

    layout = html.Div([
        html.H5('Pick a date range '), date_range, fc_submit, submit_res,
        html.H5('Positive Control Monitoring Triplicate'), pos_plot,
        html.H5('Negative Control Monitoring Triplicate'), neg_plot,
        html.H5('Positive Control Monitoring Singlicate'), pos_trip_plot,
        html.H5('Negative Control Monitoring Singlicate'), neg_trip_plot
    ])

    return layout
Пример #4
0
def get_layout():
    # df = compile_fcs()
    # fcs = sf.find_unique_values(fcs_df, 'runid')

    fc_sel_subhead = sf.make_row(children=[
        sf.make_col(html.Label("Choose Flowcell", className="mbdSelector"),
                    col_num=6),
        sf.make_col(html.Label("Choose Experiment", className="mbdSelector"),
                    col_num=6)
    ])

    fc_sel = sf.make_row(children=[
        sf.make_col(dcc.Dropdown(id="flowcell-dropdown-plate",
                                 multi=False,
                                 placeholder="Choose flowcell"),
                    col_num=6),
        sf.make_col(
            dcc.Dropdown(
                id="metric-dropdown",
                multi=False,
                options=[{
                    "label": i,
                    "value": i
                } for i in sorted(dropdown_list)],
                # placeholder = "select metric"),
                value='covid_count'),
            col_num=6)
    ])

    box_header = sf.make_row(
        sf.make_col(
            html.Div(children="Box Plots for Each Extraction Plate",
                     className="mbdSubheading")))

    box_plots = dcc.Loading(id="load-box-plots",
                            type="default",
                            children=[
                                sf.make_row(
                                    sf.make_col(dcc.Graph(id='box-plt'),
                                                col_num=12))
                            ])

    html.Div([dcc.Graph(id='box-plt')], className='six columns')

    map_header = sf.make_row(
        sf.make_col(
            html.Div(children="Plate Maps for Each Extraction Plate",
                     className="mbdSubheading")))

    norm_hm = html.Div([dcc.Graph(id='plt-all-hm')], className='six columns')

    layout = html.Div(
        [fc_sel_subhead, fc_sel, box_header, box_plots, map_header, norm_hm])
    return layout
Пример #5
0
def get_layout():
    master = sf.master_df()
    positive = master[master['call'] == 'detected']

    time_diff = pd.to_datetime(master['AIMS Reporting Notified Date']) \
                - pd.to_datetime(master['accession_date'])

    tat = (time_diff.dropna().dt.total_seconds() / 3600).mean().astype(int)

    heading = sf.make_row(children=[
        sf.make_col(children=[
            html.H2(f"To this day, we have processed {len(master)} samples."),
            html.Div(
                html.H2(f"Of those samples, {len(positive)} are positive.")),
            html.Div(
                html.
                H2(f"Average Turnaround Time: {tat} Hours from Accessioning to Reporting."
                   ))
        ]),
        sf.make_col(
            dcc.Graph(id='location-pie',
                      style={'height': 500},
                      config={'displayModeBar': False}))
    ])

    date_range = html.Div([
        dcc.DatePickerRange(id='date-picker-range'),
        html.Div(id='output-container-date-picker-range')
    ])

    fc_submit = sf.make_row(children=[
        sf.make_col(html.Button("Submit",
                                id="fc-button-clinical",
                                n_clicks=0,
                                n_clicks_timestamp=0),
                    col_num=1)
    ])

    submit_res = html.Div(id='button-res-clinical')

    site = pd.read_csv(
        '/ghds/groups/labdesk/bshih/c19dash/c19_dashboard/c19_tat.csv').fillna(
            0)
    site = site[site['Site Name'].notnull()]['Site Name'].unique()
    site.sort()

    site_dropdown = html.Div(
        dcc.Dropdown(id='percent-detect-site-dropdown',
                     options=[{
                         "label": i,
                         "value": i
                     } for i in site],
                     placeholder='Collection Site',
                     multi=True))

    tot_smp_plot = html.Div([dav.VegaLite(id='tot-smp-plot')],
                            style={
                                'width': '100%',
                                'height': '400px'
                            })
    tat_plot = html.Div([dav.VegaLite(id='tat-plot')],
                        style={
                            'width': '100%',
                            'height': '400px'
                        })

    percent_detect = html.Div([dav.VegaLite(id='percent-detect-plot')],
                              style={
                                  'width': '100%',
                                  'height': '400px'
                              })
    total_sample = html.Div([dav.VegaLite(id='total-sample-plot')],
                            style={
                                'width': '100%',
                                'height': '400px'
                            })

    smp_status_plot = html.Div([dav.VegaLite(id='smp-status-plot')],
                               style={
                                   'width': '100%',
                                   'height': '400px'
                               })
    smp_status_table = html.Div(id='smp-status-table',
                                style={
                                    'width': '100%',
                                    'overflowX': 'auto'
                                })

    layout = html.Div([
        heading,
        html.H3('Pick a date range '), date_range, fc_submit, submit_res,
        html.H3('Sample Statistics'), tot_smp_plot, tat_plot,
        html.H3('Site Specific Metrics'), site_dropdown, percent_detect,
        total_sample,
        html.H3('Sample Status'), smp_status_plot, smp_status_table
    ],
                      style={'width': '100%'})

    return layout
Пример #6
0
def get_layout():
    date_range = html.Div([
        dcc.DatePickerRange(id='date-picker-range',
                            end_date=dt.today(),
                            start_date=dt.today() - timedelta(days=30)),
        html.Div(id='output-container-date-picker-range')
    ])

    fc_submit = sf.make_row(children=[
        sf.make_col(html.Button(
            "Submit", id="fc-button", n_clicks=0, n_clicks_timestamp=0),
                    col_num=0.5),
        sf.make_col(html.Button(
            "Reset", id="fc-reset-button", n_clicks=0, n_clicks_timestamp=0),
                    col_num=0.5)
    ])
    submit_res = html.Div(id='button-res',
                          children='Enter date values and press submit')

    fc_metric_dropdown = html.Div(
        dcc.Dropdown(id='fc-metric-dropdown',
                     multi=False,
                     value="cluster_density",
                     options=[{
                         "label": k,
                         "value": v
                     } for k, v in FC_METRICS2.items()]))

    pl_metric_dropdown = html.Div(
        dcc.Dropdown(id='pl-metric-dropdown',
                     multi=False,
                     value="reads_total",
                     options=[{
                         "label": k,
                         "value": v
                     } for k, v in POOL_METRICS.items()]))

    smp_metric_dropdown = html.Div(
        dcc.Dropdown(id='smp-metric-dropdown',
                     multi=False,
                     value="count",
                     options=[{
                         'label': x,
                         'value': x
                     } for x in ['count', 'percent']]))
    control_sel = sf.make_row(children=[
        sf.make_col(dcc.Dropdown(id="cont-type-dropdown",
                                 multi=False,
                                 value="Positive",
                                 options=[{
                                     'label': x,
                                     'value': x
                                 } for x in ['Positive', 'NTC']]),
                    col_num=3),
        sf.make_col(dcc.Dropdown(id="cont-metric-dropdown",
                                 multi=False,
                                 value="count",
                                 options=[{
                                     'label': x,
                                     'value': x
                                 } for x in ['count', 'percent']]),
                    col_num=3),
    ])
    discord_sel = sf.make_row(children=[
        sf.make_col(dcc.Dropdown(
            id="y-dropdown",
            multi=False,
            value='percent_detect',
            options=[{
                'label': x,
                'value': x
            } for x in [
                'count_not_detect', 'count_no_call', 'count_detects',
                'percent_not_detect', 'percent_detect', 'percent_no_call'
            ]]),
                    col_num=3),
        sf.make_col(dcc.Dropdown(id="group-dropdown",
                                 multi=True,
                                 value=['0', '1', '2', '3'],
                                 options=[{
                                     'label': x,
                                     'value': x
                                 } for x in ['0', '1', '2', '3']]),
                    col_num=3),
    ])

    fc_plot = sf.make_row(
        dcc.Graph(id='lm-fc-plot',
                  style={
                      'width': '90%',
                      'overflowY': 'scroll'
                  }))
    pl_plot = sf.make_row(
        dcc.Graph(id='lm-pl-plot',
                  style={
                      'width': 1000,
                      'overflowY': 'scroll'
                  }))
    smp_plot = sf.make_row(
        dcc.Graph(id='smp-plot', style={
            'width': 1000,
            'overflowY': 'scroll'
        }))
    pos_plot = sf.make_row(
        dcc.Graph(id='pos-plot', style={
            'width': 1000,
            'overflowY': 'scroll'
        }))
    per_plot = sf.make_row(
        dcc.Graph(id='per-plot', style={
            'width': 1000,
            'overflowY': 'scroll'
        }))
    cont_plot = sf.make_row(
        dcc.Graph(id='cont-plot', style={
            'width': 1000,
            'overflowY': 'scroll'
        }))

    discord_plot = sf.make_row(
        dcc.Graph(id='discord-plot',
                  style={
                      'width': 1000,
                      'overflowY': 'scroll'
                  }))

    layout = html.Div([
        html.H5('Pick a date range '), date_range, fc_submit, submit_res,
        html.H5('Flowcell Level Metrics'), fc_metric_dropdown, fc_plot,
        html.H5('Pool Level Metrics'), pl_metric_dropdown, pl_plot,
        html.H5('Sample Metrics'), smp_metric_dropdown, smp_plot, control_sel,
        pos_plot, cont_plot, per_plot
    ])

    return layout
Пример #7
0
def get_main_layout():
    # Page header
    page_header = sf.make_row(
        sf.make_col(children=[
            html.Nav(className="navbar navbar-light",
                     children=[
                         html.Span(children=[
                             html.Img(src="assets/favicon.ico",
                                      width="41",
                                      height="41",
                                      className="brand-icon"),
                             html.Span("GUARDANT-19 Dashboard",
                                       className="headerText")
                         ],
                                   className="navbar-brand brand-format"),
                         html.Span("v{}".format(__version__),
                                   className="version")
                     ])
        ]))

    # Nav bar
    nav_bar = sf.make_row(
        sf.make_col(
            html.Ul(
                className="nav nav-tabs nav-fill",
                children=[
                    html.Li(dcc.Link("Clinical Statistics",
                                     href="/clinical",
                                     id="clinical-tab",
                                     className="nav-link fc-tab"),
                            className="nav-item"),
                    html.Li(dcc.Link("Sample Query",
                                     href="/sample-query",
                                     id="sample-query-tab",
                                     className="nav-link fc-tab"),
                            className="nav-item"),
                    html.Li(dcc.Link("Monitoring",
                                     href="/monitoring",
                                     id="monitoring-tab",
                                     className="nav-link fc-tab"),
                            className="nav-item"),
                    #                     html.Li(
                    #                         dcc.Link("% RT-PCR Fail",
                    #                                  href="/rtpcr-fail",
                    #                                  id="rtpcr-fail-tab",
                    #                                  className="nav-link fc-tab"),
                    #                         className="nav-item"),
                    html.Li(dcc.Link("Flowcell Metrics",
                                     href="/flowcell-metrics",
                                     id="fc-metric-tab",
                                     className="nav-link fc-tab"),
                            className="nav-item"),
                    html.Li(dcc.Link("Pool Metrics",
                                     href="/pool-qc",
                                     id="pool-qc-tab",
                                     className="nav-link fc-tab"),
                            className="nav-item"),
                    html.Li(dcc.Link("All Plate Maps",
                                     href="/plate-maps-all",
                                     id="plate-map-all-tab",
                                     className="nav-link fc-tab"),
                            className="nav-item"),
                    html.Li(dcc.Link("Longitudinal Monitoring",
                                     href="/longitudinal-monitoring",
                                     id="lm-tab",
                                     className="nav-link fc-tab"),
                            className="nav-item")
                ])))

    top_layout = html.Div(children=[
        dcc.Location(id="url-start", refresh=False),
        dcc.Location(id="url", refresh=False), page_header, nav_bar,
        html.Div(id="interval-test", className="hidden-div"),
        html.Div(id='page-content', className="container-fluid tab-container")
    ],
                          className="container-fluid page-container")
    return top_layout