DeepLoop / app.py
edmundmiller's picture
fix: Add a /
1b0a2dc unverified
raw
history blame
1.32 kB
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",
)