forked from YoshitakaMo/localcolabfold
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update_linux.sh
executable file
·30 lines (25 loc) · 1.23 KB
/
update_linux.sh
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
#!/bin/bash
COLABFOLDDIR=$1
if [ ! -d $COLABFOLDDIR/colabfold-conda ]; then
echo "Error! colabfold-conda directory is not present in $COLABFOLDDIR."
exit 1
fi
pushd $COLABFOLDDIR || { echo "${COLABFOLDDIR} is not present." ; exit 1 ; }
# get absolute path of COLABFOLDDIR
COLABFOLDDIR=$(cd $(dirname colabfold_batch); pwd)
# activate conda in $COLABFOLDDIR/conda
. ${COLABFOLDDIR}/conda/etc/profile.d/conda.sh
export PATH="${COLABFOLDDIR}/conda/condabin:${PATH}"
conda activate $COLABFOLDDIR/colabfold-conda
# reinstall colabfold and alphafold-colabfold
python3.10 -m pip uninstall -q "colabfold[alphafold-minus-jax] @ git+https://github.com/sokrypton/ColabFold" -y
python3.10 -m pip uninstall alphafold-colabfold -y
python3.10 -m pip install --no-warn-conflicts "colabfold[alphafold-minus-jax] @ git+https://github.com/sokrypton/ColabFold"
# use 'agg' for non-GUI backend
pushd ${COLABFOLDDIR}/colabfold-conda/lib/python3.10/site-packages/colabfold
sed -i -e "s#from matplotlib import pyplot as plt#import matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt#g" plot.py
sed -i -e "s#appdirs.user_cache_dir(__package__ or \"colabfold\")#\"${COLABFOLDDIR}/colabfold\"#g" download.py
# remove cache directory
rm -rf __pycache__
popd
popd