Spaces:
Sleeping
Sleeping
File size: 1,319 Bytes
4b0a09a e07fb1f 4b0a09a 8574486 e1a4424 8574486 e1a4424 8574486 f4d15bb e1a4424 f4d15bb 8574486 1b0a2dc e1a4424 8574486 d9b4d9b | 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 58 | import streamlit as st
from predict_chromosome import predict_and_write
st.title("DeepLoop")
#########
# INPUT #
#########
# TODO A drop down of models for different depths
# depth = st.selectbox("Select Model", ["Model 1", "Model 2", "Model 3"])
# HACK
chromosome = "chr11"
# Load the model from hugging face
from huggingface_hub import from_pretrained_keras
model = from_pretrained_keras("funlab/DeepLoop-CPGZ-LoopDenoise")
from huggingface_hub import snapshot_download
anchors = snapshot_download(
repo_id="funlab/hg19_HindIII_anchor_bed", repo_type="dataset"
)
HiCorr_data = snapshot_download("funlab/HiCorr_test_data", repo_type="dataset")
predict_and_write(
model,
full_matrix_dir=HiCorr_data + f"/anchor_2_anchor.loop.{chromosome}",
input_name=HiCorr_data + f"/anchor_2_anchor.loop.{chromosome}.p_val",
outdir="results",
anchor_dir=anchors,
chromosome=chromosome,
small_matrix_size=128,
step_size=128,
dummy=5,
# max_dist,
val_cols=["obs" "exp" "pval"],
# keep_zeros,
)
# Print and list the files
import os
st.write("Files created:")
st.write(os.listdir("results"))
# Offer a download
st.write("Download the results")
st.download_button(
label="Download Results",
data="results",
file_name="results.zip",
mime="application/zip",
)
|