Switch to unified view

a b/openomics_web/layouts/control_tabs.py
1
import dash_core_components as dcc
2
import dash_html_components as html
3
4
from openomics import MicroRNA, LncRNA, MessengerRNA, Protein
5
6
7
def control_tabs():
8
    return html.Div(id='circos-control-tabs', className='control-tabs', children=[
9
        dcc.Tabs(id='circos-tabs', value='what-is', children=[
10
            dcc.Tab(
11
                label='Welcome',
12
                value='what-is',
13
                children=html.Div(className='control-tab', children=[
14
                    html.H5(className='what-is', children="OpenOmics: The Multi-Omics Explorer"),
15
16
                    html.P('OpenOmics provides a bioinformatics API and web-app '
17
                           'platform integrate, analyze, and visualize the '
18
                           'multi-omics and clinical data. You can interact with the '
19
                           'data input tabs to integrate the various different data types '
20
                           'including bio-databases, multi-omics expression, genomics, '
21
                           'and clinical data.'),
22
23
                    html.Div([
24
                        'Cite us at: ',
25
                        html.A('OpenOmics paper',
26
                               href='http://www.doi.org/10.1101/gr.092759.109'),
27
                        '.'
28
                    ]),
29
                    html.Div([
30
                        'For a look into the OpenOmics API and usage documentation, please visit the '
31
                        'original repository ',
32
                        html.A('OpenOmics GitHub', href='https://github.com/JonnyTran/OpenOmics.git'),
33
                        '.'
34
                    ]),
35
36
                    html.Br(),
37
                    html.Button(id='start-button', style={"align": "center"}, n_clicks=0,
38
                                children='Get Started'),
39
                ])
40
            ),
41
42
            dcc.Tab(
43
                label='Import Clinical Data',
44
                value='clinical-upload',
45
                className='control-tab',
46
                children=[
47
                    html.Div(['Cohort name: ', ]),
48
                    dcc.Input(
49
                        id='clinical-cohort', style={'width': '100%'},
50
                        placeholder="Leave empty to use filename", type='text'),
51
                    html.Br(),
52
                    html.Div(['Select clinical data type']),
53
                    dcc.RadioItems(
54
                        id='clinical-data-type',
55
                        options=[
56
                            {'label': 'Patients data', 'value': 'Patients data'},
57
                            {'label': 'Samples data', 'value': 'Samples data'},
58
                            {'label': 'Drug responses', 'value': 'Drug responses'},
59
                        ],
60
                        value='Patients data', ),
61
                    html.Br(),
62
                    html.Div(['Import Clinical Data', ]),
63
                    html.Div(children=[
64
                        dcc.Upload(
65
                            id='upload-clinical',
66
                            children=html.Div(['Drag and Drop or ', html.A('Select Files')]),
67
                            style={
68
                                'width': '100%',
69
                                'height': '60px',
70
                                'lineHeight': '60px',
71
                                'borderWidth': '1px',
72
                                'borderStyle': 'dashed',
73
                                'borderRadius': '5px',
74
                                'textAlign': 'center',
75
                                'margin': '10px'
76
                            },
77
                            multiple=False
78
                        )
79
                    ]),
80
                    html.Br(),
81
                    html.Div(id='clinical-column-select', children=[
82
                        html.Div(['Select the patient id column to index by:']),
83
                        dcc.Dropdown(
84
                            id='clinical-patient-col-name',
85
                            disabled=True
86
                        ),
87
                        html.Div(['Select the column prefixes to import:']),
88
                        dcc.Dropdown(
89
                            id='clinical-data-columns-select',
90
                            disabled=True,
91
92
                        )
93
                    ]),
94
                    html.Br(),
95
                    html.Button(id='clinical-submit-button', n_clicks=0, children='Submit'),
96
                ]
97
            ),
98
99
            dcc.Tab(
100
                label='Import Omics Data',
101
                value='data-upload',
102
                className='control-tab',
103
                children=[
104
                    html.Div(['Cohort name: ', ]),
105
                    dcc.Input(
106
                        id='data-table-cohort', style={'width': '100%'},
107
                        placeholder="Leave empty to use filename", type='text'),
108
                    html.Br(),
109
                    html.Br(),
110
                    html.Div(['Select data type:', ]),
111
                    dcc.RadioItems(
112
                        id='data-table-type',
113
                        options=[
114
                            {'label': 'Protein Expression', 'value': Protein.name()},
115
                            {'label': 'miRNA Expression', 'value': MicroRNA.name()},
116
                            {'label': 'lncRNA Expression', 'value': LncRNA.name()},
117
                            {'label': 'mRNA Expression', 'value': MessengerRNA.name()},
118
                        ],
119
                        value=MicroRNA.name(), ),
120
                    html.Br(),
121
                    html.Div(['Import a data file', ]),
122
                    html.Div(children=[
123
                        dcc.Upload(
124
                            id='upload-data-table',
125
                            children=html.Div(['Drag and Drop or ', html.A('Select Files')]),
126
                            style={
127
                                'width': '100%',
128
                                'height': '60px',
129
                                'lineHeight': '60px',
130
                                'borderWidth': '1px',
131
                                'borderStyle': 'dashed',
132
                                'borderRadius': '5px',
133
                                'textAlign': 'center',
134
                                'margin': '10px'
135
                            },
136
                            multiple=True
137
                        )
138
                    ]),
139
                    html.Br(),
140
                    html.Div(id='data-table-column-select', children=[
141
                        html.Div(['Select the gene id/name column to index by:']),
142
                        dcc.Dropdown(
143
                            id='data-table-genes-col-name',
144
                            disabled=True
145
                        ),
146
                        html.Div(['Select the column prefixes to import:']),
147
                        dcc.Dropdown(
148
                            id='data-table-columns-select',
149
                            disabled=True,
150
151
                        )
152
                    ]),
153
                    html.Br(),
154
                    html.Div(['Each gene is indexed by:']),
155
                    dcc.RadioItems(
156
                        id='data-table-genes_index',
157
                        options=[
158
                            {'label': 'Gene symbol', 'value': 'gene_name'},
159
                            {'label': 'Gene index', 'value': 'gene_index'},
160
                            {'label': 'Transcript name', 'value': 'transcript_name'},
161
                            {'label': 'Transcript index', 'value': 'transcript_index'},
162
                        ],
163
                        value='gene_name',
164
                    ),
165
                    html.Br(),
166
                    html.Div(['Is the table transposed?']),
167
                    dcc.RadioItems(
168
                        id='data-table-transpose',
169
                        options=[
170
                            {'label': 'Sample name columns', 'value': "True"},
171
                            {'label': 'Gene name in columns', 'value': "False"},
172
                        ],
173
                        value="True",
174
                    ),
175
                    html.Br(),
176
                    html.Button(id='upload-data-table-submit', n_clicks=0, children='Submit'),
177
                ]
178
            ),
179
180
            dcc.Tab(
181
                label='Annotate database',
182
                value='annotatte-db',
183
                className='control-tab',
184
                children=[
185
                    html.Div('To be implemented'),
186
                ]
187
            ),
188
189
        ])
190
    ])