Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
02378a0
Add a setup file for the project
xiaoruiDong Apr 18, 2023
3079937
Utilize unused imports in featurization
xiaoruiDong Apr 18, 2023
9563cbe
clean up imports in featurization
xiaoruiDong Apr 18, 2023
79c122f
Move constant variables to the top in featurization
xiaoruiDong Apr 18, 2023
e5959c1
Simplify dataset definition and reference
xiaoruiDong Apr 18, 2023
2f1dbdb
Add two convenient function check_mol and smiles_to_mol
xiaoruiDong Apr 18, 2023
9af9a8d
Add a helper function to create necessary features
xiaoruiDong Apr 18, 2023
2f51656
Add a function to featurize molecule given a RDKit Mol object
xiaoruiDong Apr 18, 2023
aa04db4
Bugfix: featurize mol missing returns
xiaoruiDong Apr 18, 2023
1616e53
Simplify featurize_mol_from_smiles
xiaoruiDong Apr 18, 2023
ae796e5
Simplify featurize_mol method of geom_confs
xiaoruiDong Apr 18, 2023
f341404
Add from_data_list to avoid errors in neighbors in pyg 2
xiaoruiDong Apr 18, 2023
398897b
Reame model to geomol
xiaoruiDong Apr 18, 2023
0b0b64c
Rename model to geomol continue
xiaoruiDong Apr 18, 2023
39a60fb
Adjust for the change in global_add_pool
xiaoruiDong Apr 18, 2023
5e3cb5a
update generate_confs with from_data_list
xiaoruiDong Apr 18, 2023
a59e38b
Add a dummy __init__ file to root for easy external import
xiaoruiDong Apr 18, 2023
6a87769
AutoPEP8 correction
xiaoruiDong Sep 12, 2023
cf1daef
Ignore Mac .DS_Store
xiaoruiDong Sep 12, 2023
6bfda9c
Update the environment setup script
xiaoruiDong Mar 14, 2024
acdc7a8
Add a convenient path to the trained models
xiaoruiDong Mar 14, 2024
50475e0
Add YAML as requirement
xiaoruiDong Mar 14, 2024
9d6f768
Decouple model device assignment with available device
xiaoruiDong Mar 14, 2024
563ef0c
Workaround for batch_angles_from_coords
xiaoruiDong Mar 14, 2024
d8d4058
introduce more accurate device control during inference
xiaoruiDong Mar 14, 2024
f8cccd4
Make the model device agnotic
xiaoruiDong Mar 14, 2024
689d572
Fix shapes for dihedral_pairs-related operations in model
xiaoruiDong Mar 14, 2024
70341a4
Fix device mismatch during inference for a ring molecule
xiaoruiDong Mar 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ __pycache__/
.eggs/

# Jupyter
.ipynb_checkpoints/
.ipynb_checkpoints/

# Mac File System
.DS_Store
File renamed without changes.
73 changes: 13 additions & 60 deletions devtools/create_env.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Developed by Kevin A. Spiekermann
# Developed by Xiaorui Dong and Kevin A. Spiekermann
# This script does the following tasks:
# - creates the conda
# - prompts user for desired CUDA version
# - installs PyTorch with specified CUDA version in the environment
# - installs torch torch-geometric in the environment

SCRIPT_DIR=$(dirname $0)

CONDA_ENV_NAME="GeoMol"

# get OS type
unameOut="$(uname -s)"
Expand All @@ -17,66 +19,17 @@ case "${unameOut}" in
esac
echo "Running ${machine}..."

if [ "$machine" != "MacOS" ]; then
# Prompt the user to input their desired CUDA version or 'cpu'
echo "Please input your desired CUDA version in the format xx.xx (e.g., 10.2, 12.3) or 'cpu' for no CUDA available:"
read cuda_input

# request user to select one of the supported CUDA versions
# source: https://pytorch.org/get-started/locally/
PS3='Please enter 1, 2, 3, or 4 to specify the desired CUDA version from the options above: '
options=("9.2" "10.1" "10.2" "cpu" "Quit")
select opt in "${options[@]}"
do
case $opt in
"9.2")
CUDA="cudatoolkit=9.2"
CUDA_VERSION="cu92"
break
;;
"10.1")
CUDA="cudatoolkit=10.1"
CUDA_VERSION="cu101"
break
;;
"10.2")
CUDA="cudatoolkit=10.2"
CUDA_VERSION="cu102"
break
;;
"cpu")
# "cpuonly" works for Linux and Windows
CUDA="cpuonly"
# Mac does not use "cpuonly"
if [ $machine == "Mac" ]
then
CUDA=" "
fi
CUDA_VERSION="cpu"
break
;;
"Quit")
exit
;;
*) echo "invalid option $REPLY";;
esac
done

echo "Creating conda environment..."
echo "Running: conda env create -f environment.yml"
conda env create -f devtools/environment.yml
if [ "$machine" == "MacOS" ] && [ "$(uname -m)" == "arm64" ]; then

# activate the environment to install torch-geometric
source activate GeoMol
$SHELL $SCRIPT_DIR/install_pyg_macos_arm64.sh -n $CONDA_ENV_NAME

echo "Installing PyTorch with requested CUDA version..."
echo "Running: conda install pytorch torchvision $CUDA -c pytorch"
conda install pytorch torchvision $CUDA -c pytorch
else

echo "Installing torch-geometric..."
echo "Using CUDA version: $CUDA_VERSION"
# get PyTorch version
TORCH_VERSION=$(python -c "import torch; print(torch.__version__)")
echo "Using PyTorch version: $TORCH_VERSION"
source $SCRIPT_DIR/install_pyg.sh -n $CONDA_ENV_NAME -c $cuda_input

pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-${TORCH_VERSION}+${CUDA_VERSION}.html
pip install torch-sparse -f https://pytorch-geometric.com/whl/torch-${TORCH_VERSION}+${CUDA_VERSION}.html
pip install torch-cluster -f https://pytorch-geometric.com/whl/torch-${TORCH_VERSION}+${CUDA_VERSION}.html
pip install torch-spline-conv -f https://pytorch-geometric.com/whl/torch-${TORCH_VERSION}+${CUDA_VERSION}.html
pip install torch-geometric
fi
148 changes: 6 additions & 142 deletions devtools/environment.yml
Original file line number Diff line number Diff line change
@@ -1,146 +1,10 @@
name: GeoMol
channels:
- rdkit
- anaconda
- conda-forge
- defaults
- conda-forge
dependencies:
- _libgcc_mutex=0.1=main
- _openmp_mutex=4.5=1_gnu
- argon2-cffi=20.1.0=py37h5e8e339_2
- async_generator=1.10=py_0
- attrs=21.2.0=pyhd8ed1ab_0
- backcall=0.2.0=pyh9f0ad1d_0
- backports=1.0=py_2
- backports.functools_lru_cache=1.6.4=pyhd8ed1ab_0
- blas=1.0=mkl
- bleach=3.3.0=pyh44b312d_0
- bzip2=1.0.8=h7b6447c_0
- ca-certificates=2021.5.30=ha878542_0
- cairo=1.16.0=hf32fb01_1
- certifi=2021.5.30=py37h89c1867_0
- cffi=1.14.5=py37hc58025e_0
- cycler=0.10.0=py37_0
- dbus=1.13.18=hb2f20db_0
- decorator=4.4.2=pyhd3eb1b0_0
- defusedxml=0.7.1=pyhd8ed1ab_0
- entrypoints=0.3=pyhd8ed1ab_1003
- expat=2.4.1=h2531618_2
- fontconfig=2.13.1=h6c09931_0
- freetype=2.10.4=h5ab3b9f_0
- glib=2.68.2=h36276a3_0
- gst-plugins-base=1.14.0=h8213a91_2
- gstreamer=1.14.0=h28cd5cc_2
- icu=58.2=he6710b0_3
- importlib-metadata=4.6.0=py37h89c1867_0
- intel-openmp=2021.2.0=h06a4308_610
- ipykernel=5.5.5=py37h085eea5_0
- ipython=7.25.0=py37h085eea5_1
- ipython_genutils=0.2.0=py_1
- ipywidgets=7.6.3=pyhd3deb0d_0
- jedi=0.18.0=py37h89c1867_2
- jinja2=3.0.1=pyhd8ed1ab_0
- jpeg=9b=h024ee3a_2
- jsonschema=3.2.0=pyhd8ed1ab_3
- jupyter=1.0.0=py37h89c1867_6
- jupyter_client=6.1.12=pyhd8ed1ab_0
- jupyter_console=6.4.0=pyhd8ed1ab_0
- jupyter_core=4.7.1=py37h89c1867_0
- jupyterlab_pygments=0.1.2=pyh9f0ad1d_0
- jupyterlab_widgets=1.0.0=pyhd8ed1ab_1
- kiwisolver=1.3.1=py37h2531618_0
- lcms2=2.12=h3be6417_0
- ld_impl_linux-64=2.35.1=h7274673_9
- libboost=1.73.0=h3ff78a5_11
- libffi=3.3=he6710b0_2
- libgcc-ng=9.3.0=h5101ec6_17
- libgfortran-ng=7.5.0=ha8ba4b0_17
- libgfortran4=7.5.0=ha8ba4b0_17
- libgomp=9.3.0=h5101ec6_17
- libpng=1.6.37=hbc83047_0
- libsodium=1.0.18=h36c2ea0_1
- libstdcxx-ng=9.3.0=hd4cf53a_17
- libtiff=4.2.0=h85742a9_0
- libuuid=1.0.3=h1bed415_2
- libwebp-base=1.2.0=h27cfd23_0
- libxcb=1.14=h7b6447c_0
- libxml2=2.9.12=h03d6c58_0
- lz4-c=1.9.3=h2531618_0
- markupsafe=2.0.1=py37h5e8e339_0
- matplotlib=3.3.4=py37h06a4308_0
- matplotlib-base=3.3.4=py37h62a2d02_0
- matplotlib-inline=0.1.2=pyhd8ed1ab_2
- mistune=0.8.4=py37h5e8e339_1004
- mkl=2021.2.0=h06a4308_296
- mkl-service=2.3.0=py37h27cfd23_1
- mkl_fft=1.3.0=py37h42c9631_2
- mkl_random=1.2.1=py37ha9443f7_2
- nbclient=0.5.3=pyhd8ed1ab_0
- nbconvert=6.1.0=py37h89c1867_0
- nbformat=5.1.3=pyhd8ed1ab_0
- ncurses=6.2=he6710b0_1
- nest-asyncio=1.5.1=pyhd8ed1ab_0
- networkx=2.5.1=pyhd3eb1b0_0
- notebook=6.4.0=pyha770c72_0
- numpy=1.20.2=py37h2d18471_0
- numpy-base=1.20.2=py37hfae3a4d_0
- olefile=0.46=py37_0
- openssl=1.1.1k=h7f98852_0
- packaging=20.9=pyh44b312d_0
- pandas=1.2.5=py37h295c915_0
- pandoc=2.14.0.3=h7f98852_0
- pandocfilters=1.4.2=py_1
- parso=0.8.2=pyhd8ed1ab_0
- pcre=8.45=h295c915_0
- pexpect=4.8.0=pyh9f0ad1d_2
- pickleshare=0.7.5=py_1003
- pillow=8.2.0=py37he98fc37_0
- pip=21.1.3=py37h06a4308_0
- pixman=0.40.0=h7b6447c_0
- pot=0.7.0=py37h3340039_0
- prometheus_client=0.11.0=pyhd8ed1ab_0
- prompt-toolkit=3.0.19=pyha770c72_0
- prompt_toolkit=3.0.19=hd8ed1ab_0
- ptyprocess=0.7.0=pyhd3deb0d_0
- py-boost=1.73.0=py37ha9443f7_11
- py3dmol=0.9.1=pyhd8ed1ab_0
- pycparser=2.20=pyh9f0ad1d_2
- pygments=2.9.0=pyhd8ed1ab_0
- pyparsing=2.4.7=pyhd3eb1b0_0
- pyqt=5.9.2=py37h05f1152_2
- pyrsistent=0.17.3=py37h5e8e339_2
- python=3.7.10=h12debd9_4
- python-dateutil=2.8.1=pyhd3eb1b0_0
- python_abi=3.7=2_cp37m
- pytz=2021.1=pyhd3eb1b0_0
- pyyaml=5.3.1=py37h7b6447c_1
- pyzmq=22.1.0=py37h336d617_0
- qt=5.9.7=h5867ecd_1
- qtconsole=5.1.1=pyhd8ed1ab_0
- qtpy=1.9.0=py_0
- rdkit=2020.09.1.0=py37hd50e099_1
- readline=8.1=h27cfd23_0
- scipy=1.6.2=py37had2a1c9_1
- seaborn=0.11.1=pyhd3eb1b0_0
- send2trash=1.7.1=pyhd8ed1ab_0
- setuptools=52.0.0=py37h06a4308_0
- sip=4.19.8=py37hf484d3e_0
- six=1.16.0=pyhd3eb1b0_0
- sqlite=3.36.0=hc218d9a_0
- terminado=0.10.1=py37h89c1867_0
- testpath=0.5.0=pyhd8ed1ab_0
- tk=8.6.10=hbc83047_0
- tornado=6.1=py37h27cfd23_0
- tqdm=4.61.1=pyhd3eb1b0_1
- traitlets=5.0.5=py_0
- typing_extensions=3.10.0.0=pyha770c72_0
- wcwidth=0.2.5=pyh9f0ad1d_2
- webencodings=0.5.1=py_1
- wheel=0.36.2=pyhd3eb1b0_0
- widgetsnbextension=3.5.1=py37h89c1867_4
- xz=5.2.5=h7b6447c_0
- yaml=0.2.5=h7b6447c_0
- zeromq=4.3.4=h9c3ff4c_0
- zipp=3.4.1=pyhd8ed1ab_0
- zlib=1.2.11=h7b6447c_3
- zstd=1.4.9=haebb681_0
- rdkit >=2020.03.2
- networkx
- pot
- yaml
- pyyaml
Loading