silterra commited on
Commit
68787b5
·
1 Parent(s): a02989c

Add basic streamlit app

Browse files
Files changed (2) hide show
  1. Dockerfile +4 -3
  2. app.py +34 -3
Dockerfile CHANGED
@@ -1,4 +1,5 @@
1
- FROM silterra/diffdock-pocket
 
2
 
3
  COPY . /app
4
 
@@ -6,6 +7,6 @@ WORKDIR /app
6
 
7
  EXPOSE 8501
8
 
9
- # Entrypoint script which activates conda environment
10
- ENTRYPOINT ["/bin/micromamba", "run", "-n", "basic", "streamlit", "run", "app.py"]
11
  # ENTRYPOINT ["./entrypoint.sh"]
 
1
+ # Use the same container for the HF-space that we compiled for general use
2
+ FROM silterra/diffdock-pocket-dev
3
 
4
  COPY . /app
5
 
 
7
 
8
  EXPOSE 8501
9
 
10
+ # Run streamlit app under conda environment
11
+ ENTRYPOINT ["/bin/micromamba", "run", "-n", "diffdock-pocket", "streamlit", "run", "app.py"]
12
  # ENTRYPOINT ["./entrypoint.sh"]
app.py CHANGED
@@ -1,6 +1,37 @@
1
- # import torch
2
 
3
  import streamlit as st
4
 
5
- x = st.slider('Select a value')
6
- st.write(x, 'squared is', x * x)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
 
3
  import streamlit as st
4
 
5
+ # Create the Streamlit app
6
+ st.title("DiffDock Pocket: Protein-Ligand Interaction Calculator")
7
+
8
+ # Create a form block
9
+ with st.form(key="calculation_form"):
10
+ # File upload for Protein PDB
11
+ protein_pdb = st.file_uploader("Protein PDB", type=["pdb"])
12
+
13
+ # File upload for Ligand SDF
14
+ ligand_sdf = st.file_uploader("Ligand SDF", type=["sdf"])
15
+
16
+ # Numeric input for "Samples per Complex"
17
+ samples_per_complex = st.number_input("Samples per Complex", min_value=1, max_value=100, value=4, step=1)
18
+
19
+ # Boolean checkbox for "Keep Local Structures"
20
+ keep_local_structures = st.checkbox("Keep Local Structures", value=True)
21
+
22
+ # Boolean checkbox for "Save Visualization"
23
+ save_visualization = st.checkbox("Save Visualization", value=True)
24
+
25
+ # Submit button
26
+ submit_button = st.form_submit_button("Calculate")
27
+
28
+ if submit_button:
29
+ # Implement your calculation logic here
30
+ st.write("TODO Calculating... (Add your implementation logic)")
31
+
32
+ # For demonstration purposes, display the user inputs
33
+ st.write(f"Protein PDB File: {protein_pdb}")
34
+ st.write(f"Ligand SDF File: {ligand_sdf}")
35
+ st.write(f"Samples per Complex: {samples_per_complex}")
36
+ st.write(f"Keep Local Structures: {keep_local_structures}")
37
+ st.write(f"Save Visualization: {save_visualization}")