File size: 1,246 Bytes
80a72c3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/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"