Create a requirements.txt file:
streamlit>=1.28.0
pandas>=1.5.0
rdkit-pypi>=2022.9.0
py3Dmol>=2.0.0
numpy>=1.24.0
pathlib- Install dependencies:
pip install -r requirements.txt- Install AutoDock Vina (for rescoring functionality):
# Option 1: Using conda
conda install -c conda-forge autodock-vina
# Option 2: Download from official site
# https://vina.scripps.edu/downloads/- Set up OpenDock environment:
# Create the opendock environment
conda create -n opendock python=3.9
conda activate opendock
# Install OpenDock and its dependencies
# (Follow OpenDock specific installation instructions)
pip install opendock # or your specific installation method- Run the app:
streamlit run pdb_sdf_docking_viewer.pyTo add support for additional score property names, modify the score_keys list in parse_sdf_with_scores:
score_keys = ['docking_score', 'score', 'vina_score', 'affinity', 'binding_energy', 'your_custom_score']To rescore all ligands at once, you can modify the app to include:
if st.button("🎯 Rescore All Ligands"):
progress_bar = st.progress(0)
for i, ligand in enumerate(st.session_state.ligands):
vina_score = run_vina_rescoring(
st.session_state.protein_content,
ligand['mol_block']
)
if vina_score:
ligand['vina_score'] = vina_score
progress_bar.progress((i + 1) / len(st.session_state.ligands))Add functionality to export rescored ligands:
if st.button("💾 Export Results"):
results_df = pd.DataFrame([
{
'name': lig['name'],
'original_score': lig['score'],
'vina_score': lig.get('vina_score', 'N/A'),
'mw': lig['mw'],
'logp': lig['logp']
}
for lig in st.session_state.ligands
])
st.download_button(
"Download CSV",
results_df.to_csv(index=False),
"docking_results.csv",
"text/csv"
)