drjieliu commited on
Commit
b0adba5
·
1 Parent(s): 4434b3d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -29
app.py CHANGED
@@ -46,8 +46,6 @@ def process(bam_file,progress=gr.Progress()):
46
  else:
47
  progress(0.2, desc="Downloading BAM file "+bam_file)
48
  gdown.download(url=bam_file,fuzzy=True, output='ATAC/'+fid + '.bam')
49
- # tmp_bamid=bam_file.split('file/d/')[1].split('/view?')[0]
50
- # gdown.download(id=tmp_bamid,output=fid + '.bam')
51
  progress(0.4, desc="Index BAM file")
52
  time.sleep(0.1)
53
  pysam.index('ATAC/'+fid + '.bam')
@@ -65,25 +63,8 @@ def process(bam_file,progress=gr.Progress()):
65
  return 'ATAC/atac_' + fid + '.pickle'
66
 
67
 
68
- css='li {font-size: 15px;}'
69
-
70
- with gr.Blocks(theme=gr.themes.Monochrome(),css=css) as app:
71
- gr.Markdown('<h1 style="text-align: center; font-size: 2.2em"> '
72
- 'A computational tool to use ATAC-seq to impute epigenome, transcriptome, and high-resolution chromatin contact maps</h1>')
73
-
74
- gr.HTML('<div style="text-align: center;">'
75
- '<a href="https://github.com/zzh24zzh/EPCOT_gradio" style="margin-right: 20px;font-size: 18px; color:black;">[Code]</a>'
76
- '<a href="https://www.biorxiv.org/content/10.1101/2022.05.23.493129v2" style="font-size: 18px; color:black;">[Paper]</a>'
77
- '</div>')
78
- # gr.Markdown('[[Code]](https://github.com/zzh24zzh/EPCOT_gradio) [[Paper]](https://www.biorxiv.org/content/10.1101/2022.05.23.493129v2)')
79
- gr.Markdown('## Instructions:\n'
80
- '- Use the first app to process ATAC-seq data by uploading an ATAC-seq BAM file.\n'
81
- '- Execute the model by uploading the processed ATAC-seq file to the "Run Model" interface in the second app.\n'
82
- '- Visualize the prediction results by uploading the predicted files from the "Run Model" interface to the "Visualize Prediction Results" interface.\n')
83
- gr.Markdown('<hr>')
84
- gr.Markdown('<h1 font-size: 2em"> App 1: Process ATAC-seq data</h1>\n'
85
- # '<p style="font-size: 15px;">Hosted on a server from Liu Lab</p>\n'
86
- '<p style="font-size: 15px;"><strong>Notice:</strong> Downsample the BAM file before upload if the size is too large</p>')
87
  with gr.Row():
88
  with gr.Column():
89
  inp=gr.Textbox(
@@ -96,12 +77,6 @@ with gr.Blocks(theme=gr.themes.Monochrome(),css=css) as app:
96
  out = gr.File(label='Download the processed file')
97
  btn2.click(fn=process, inputs=inp, outputs=out)
98
 
99
- gr.Markdown('<hr>')
100
- gr.Markdown('<h1 font-size: 2em;"> App 2: Run models and visualize prediction results</h1>\n'
101
- '<p style="font-size: 16px;">'
102
- 'Hosted on <a href="https://huggingface.co/spaces/drjieliu/EPCOT" style="font-size: 16px;">Hugging Face Space</a> </p>')
103
- with gr.Column():
104
- gr.HTML('<iframe src="https://drjieliu-epcot.hf.space" '
105
- 'border="none" width="100%" height=1200></iframe>')
106
 
107
- app.launch(debug=True,enable_queue=True)
 
 
46
  else:
47
  progress(0.2, desc="Downloading BAM file "+bam_file)
48
  gdown.download(url=bam_file,fuzzy=True, output='ATAC/'+fid + '.bam')
 
 
49
  progress(0.4, desc="Index BAM file")
50
  time.sleep(0.1)
51
  pysam.index('ATAC/'+fid + '.bam')
 
63
  return 'ATAC/atac_' + fid + '.pickle'
64
 
65
 
66
+ css="li {font-size: 16px; --font: 'Quicksand', 'ui-sans-serif', 'system-ui', sans-serif"
67
+ with gr.Blocks(css=css) as app:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  with gr.Row():
69
  with gr.Column():
70
  inp=gr.Textbox(
 
77
  out = gr.File(label='Download the processed file')
78
  btn2.click(fn=process, inputs=inp, outputs=out)
79
 
 
 
 
 
 
 
 
80
 
81
+
82
+ app.queue(concurrency_count=1,max_size=10).launch()