File size: 2,400 Bytes
a61d226
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import gradio as gr
import os
import pyBigWig
from func_gradio import predict_func,make_plots

inputs = [
    gr.Dropdown([str(i) for i in range(1, 23)], label='Chromosome', default='1'),
    gr.Dropdown(['Micro-C', 'Hi-C (ChIA-PET)']
                , label='Chromatin contact map', info='One type of contact map is predicted for each time'),
    gr.Number(label='Region of interest (500kb for Micro-C and 1Mb for Hi-C)', info='From'),
    gr.Number(info='To', show_label=False),
    gr.File(label='Processed ATAC-seq file (in .pickle format)'),

]

outputs = [
    gr.Files(label='Download the results'),
]

app1 = gr.Interface(
    fn=predict_func,
    inputs=inputs,
    outputs=outputs,
    title='A computational tool to use ATAC-seq to impute epigenome, transcriptome, and high-resolution chromatin contact maps',
    description='<a href="https://github.com/zzh24zzh/EPCOT_gradio" class="built-with svelte-1lyswbr" target="_blank" '
                'style="font-size: 15px; font-color: black; font-weight:bold" rel="noreferrer">'
                'View Documentation </a>',
    # examples=[["11","Micro-C","10500000","11000000","./examples/atac_GM12878.pickle"],
    #     ["11","Hi-C (ChIA-PET)","7750000","8750000","./examples/atac_GM12878.pickle"]]
)


with open(os.path.abspath('data/epigenomes.txt'), 'r') as f:
    epis=f.read().splitlines()
inputs1 = [
    gr.File(label="Prediction file (in .npz format))"),
    gr.Markdown(value='### Visualization options'),
    gr.Dropdown(epis,label='Epigenome features',multiselect=True,max_choices=10,value=['CTCF','H3K4me3']),
    gr.Radio(choices=['Signal p-values (archsinh)','Binding probability'], label='Type of epigenomic feature data'
             , value='Signal p-values (archsinh)'),
    gr.Slider(maximum=16,label='Range of values displayed on the plots',info="Choose between 0 and 16 (contact maps)",value=4),
    gr.Slider(minimum=2,maximum=12,info="Choose between 2 and 12 (epigenomic feature signals)",value=4,show_label=False),
    gr.Slider(minimum=2,maximum=12,info="Choose between 2 and 12 (CAGE-seq)",value=8,show_label=False),
]
outputs1 = gr.Plot(label='Plots')
app2 = gr.Interface(
    fn=make_plots,
    inputs=inputs1,
    outputs=outputs1,
    live=True
)

demo = gr.TabbedInterface([app1, app2], ["Run model", "Visualize prediction results"],
                          theme=gr.themes.Soft())

demo.launch(debug=True)