edmundmiller commited on
Commit
e1a4424
·
unverified ·
1 Parent(s): 8574486

Add demo example

Browse files

https://github.com/JinLabBioinfo/DeepLoop?tab=readme-ov-file#run-deeploop

Files changed (1) hide show
  1. app.py +23 -11
app.py CHANGED
@@ -4,26 +4,38 @@ from .predict_chromosome import predict_and_write
4
 
5
  st.title("DeepLoop")
6
 
 
 
 
 
 
7
  # TODO A drop down of models for different depths
8
  # depth = st.selectbox("Select Model", ["Model 1", "Model 2", "Model 3"])
 
 
9
 
10
  # Load the model from hugging face
11
  from huggingface_hub import from_pretrained_keras
12
 
13
  model = from_pretrained_keras("funlab/DeepLoop-CPGZ-LoopDenoise")
14
 
 
 
 
 
 
15
 
16
  predict_and_write(
17
  model,
18
- full_matrix_dir,
19
- input_name,
20
- out_dir,
21
- anchor_dir,
22
- chromosome,
23
- small_matrix_size,
24
- step_size,
25
- dummy,
26
- max_dist,
27
- val_cols,
28
- keep_zeros,
29
  )
 
4
 
5
  st.title("DeepLoop")
6
 
7
+
8
+ #########
9
+ # INPUT #
10
+ #########
11
+
12
  # TODO A drop down of models for different depths
13
  # depth = st.selectbox("Select Model", ["Model 1", "Model 2", "Model 3"])
14
+ # HACK
15
+ chromosome = "chr11"
16
 
17
  # Load the model from hugging face
18
  from huggingface_hub import from_pretrained_keras
19
 
20
  model = from_pretrained_keras("funlab/DeepLoop-CPGZ-LoopDenoise")
21
 
22
+ from datasets import load_dataset
23
+
24
+ anchors = load_dataset("funlab/hg19_HindIII_anchor_bed")
25
+ full_matrix = load_dataset("funlab/HiCorr_test_data")
26
+
27
 
28
  predict_and_write(
29
  model,
30
+ full_matrix_dir=full_matrix,
31
+ input_name=f"anchor_2_anchor.loop.{chromosome}.p_val",
32
+ outdir="results",
33
+ anchor_dir=anchors,
34
+ chromosome=chromosome,
35
+ small_matrix_size=128,
36
+ step_size=128,
37
+ dummy=5,
38
+ # max_dist,
39
+ val_cols=["obs" "exp" "pval"],
40
+ # keep_zeros,
41
  )