张振豪 commited on
Commit
da5bf14
·
1 Parent(s): e622f2f
Files changed (2) hide show
  1. func_gradio.py +1 -2
  2. util.py +0 -2
func_gradio.py CHANGED
@@ -5,7 +5,7 @@ from util import check_region,predict_microc,predict_cage,predict_epis,filetobro
5
  from scipy.sparse import load_npz
6
  import matplotlib.pyplot as plt
7
  from matplotlib.gridspec import GridSpec
8
-
9
  def predict_func(input_chrom,cop_type, region_start,region_end, atac_seq):
10
  device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
11
  print(device)
@@ -60,7 +60,6 @@ def predict_func(input_chrom,cop_type, region_start,region_end, atac_seq):
60
 
61
 
62
  def make_plots(in_file,md,epis,epi_type, maxv1, maxv2,maxv3):
63
- import matplotlib
64
  matplotlib.use("Agg")
65
  # matplotlib.pyplot.switch_backend('Agg')
66
  if in_file is None:
 
5
  from scipy.sparse import load_npz
6
  import matplotlib.pyplot as plt
7
  from matplotlib.gridspec import GridSpec
8
+ import matplotlib
9
  def predict_func(input_chrom,cop_type, region_start,region_end, atac_seq):
10
  device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
11
  print(device)
 
60
 
61
 
62
  def make_plots(in_file,md,epis,epi_type, maxv1, maxv2,maxv3):
 
63
  matplotlib.use("Agg")
64
  # matplotlib.pyplot.switch_backend('Agg')
65
  if in_file is None:
util.py CHANGED
@@ -248,11 +248,9 @@ def predict_microc(
248
 
249
 
250
  def filetobrowser(out_epis,out_cages,out_cop,chrom,start,end,file_id):
251
- import uuid
252
  with open('data/epigenomes.txt', 'r') as f:
253
  epigenomes = f.read().splitlines()
254
 
255
- # filename = str(uuid.uuid4())
256
  files_to_zip = file_id
257
  if os.path.exists(files_to_zip):
258
  shutil.rmtree(files_to_zip)
 
248
 
249
 
250
  def filetobrowser(out_epis,out_cages,out_cop,chrom,start,end,file_id):
 
251
  with open('data/epigenomes.txt', 'r') as f:
252
  epigenomes = f.read().splitlines()
253
 
 
254
  files_to_zip = file_id
255
  if os.path.exists(files_to_zip):
256
  shutil.rmtree(files_to_zip)