Chainsaw / scripts /setup.sh
wuxing0105's picture
Upload folder using huggingface_hub
80a72c3 verified
Raw
History Blame Contribute Delete
1.25 kB
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)
REPO_ROOT=$(cd -- "${SCRIPT_DIR}/.." >/dev/null 2>&1 && pwd)
STRIDE_DIR="${SCRIPT_DIR}/stride"
cd "${REPO_ROOT}"
if ! python -c "import torch; print(torch.__version__)"; then
echo "PyTorch is not installed in the active environment." >&2
echo "On SCNet, activate the DTK 25.04 / PyTorch 2.5.1 environment first." >&2
exit 1
fi
python -m pip install -r "${REPO_ROOT}/conf/requirements.txt"
if [[ ! -x "${STRIDE_DIR}/stride" ]]; then
if ! command -v make >/dev/null 2>&1 || ! command -v gcc >/dev/null 2>&1; then
echo "gcc and make are required to compile STRIDE." >&2
exit 1
fi
if [[ ! -f "${STRIDE_DIR}/Makefile" && -f "${STRIDE_DIR}/stride.tgz" ]]; then
tar -xzf "${STRIDE_DIR}/stride.tgz" -C "${STRIDE_DIR}"
fi
make -C "${STRIDE_DIR}"
chmod +x "${STRIDE_DIR}/stride"
fi
export STRIDE_EXE="${STRIDE_DIR}/stride"
python "${SCRIPT_DIR}/get_predictions.py" --help >/dev/null
echo "Chainsaw setup complete."
echo "Run: python scripts/get_predictions.py --structure_file scripts/example_files/AF-A0A1W2PQ64-F1-model_v4.pdb --output output/inference/predictions.tsv"