pengzhangzhi / ab_opt

Official implementation of Generative Diffusion Models for Antibody Design, Docking, and Optimization.
Apache License 2.0
41 stars 6 forks source link

ab_opt.ipynb: name 'res' is not defined #6

Open adriansh11 opened 3 weeks ago

adriansh11 commented 3 weeks ago

Hello!

Thank your for your amazing work!

During the execution of the first block of the code, an error 'name 'res' is not defined' occurred. How can I fixed it?

pengzhangzhi commented 3 weeks ago

Can you elaberate on what block of the code?

adriansh11 commented 3 weeks ago

Can you elaberate on what block of the code?

I used colab version and after and after running this part of the code:

#@title setup
%%time

#@title Install PyRosetta.
# !!! Please note the license agreement of PyRosetta!!!

import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)

import os
from IPython.display import HTML
from google.colab import files

import numpy as np
import pandas as pd
import glob
import warnings
warnings.filterwarnings('ignore')
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
import json
import glob

import os
import subprocess

!git clone https://github.com/pengzhangzhi/ab_opt.git

!wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
!chmod +x Miniconda3-latest-Linux-x86_64.sh
!bash ./Miniconda3-latest-Linux-x86_64.sh -b -f -p /usr/local
import sys
sys.path.append('/usr/local/lib/python3.7/site-packages/')

# Update PATH
import os
os.environ['PATH'] = '/usr/local/bin:' + os.environ['PATH']

# Initialize Conda
!conda init

!pip install torch==1.13.0+cu116 --extra-index-url https://download.pytorch.org/whl/cu116
!conda install pyg::pytorch-scatter=2.0.9 -y
!conda install pyyaml  -y
!conda install -c conda-forge pdbfixer -y
!conda install -c bioconda abnumber -y
!pip install -U "ray[default]"
!pip install dynamic-yaml tqdm biopython pandas joblib lmdb easydict scipy wandb notebook seaborn
!pip install logomaker
!conda install -c conda-forge libstdcxx-ng -y

filename='PyRosetta4.Release.python311.linux'
user = 'levinthal'
password = 'paradox'
try:
  res = subprocess.run([
      'wget', '--user', user, '--password', password,
      f'https://graylab.jhu.edu/download/PyRosetta4/archive/release/{filename}/{filename}.release-360.tar.bz2'
  ],capture_output=True, text=True, check=True)
except:
  print(res.stdout)

subprocess.run(['tar', '-xvjf', f'{filename}.release-360.tar.bz2'],capture_output=True, text=True, check=True)
os.chdir(os.path.join(f"{filename}.release-360","setup"))
subprocess.run(['python', 'setup.py', 'install'])
os.chdir('../..')

I have an error: `--------------------------------------------------------------------------- CalledProcessError Traceback (most recent call last)

in [/usr/lib/python3.10/subprocess.py](https://localhost:8080/#) in run(input, capture_output, timeout, check, *popenargs, **kwargs) 525 if check and retcode: --> 526 raise CalledProcessError(retcode, process.args, 527 output=stdout, stderr=stderr) CalledProcessError: Command '['wget', '--user', 'levinthal', '--password', 'paradox', 'https://graylab.jhu.edu/download/PyRosetta4/archive/release/PyRosetta4.Release.python311.linux/PyRosetta4.Release.python311.linux.release-360.tar.bz2']' returned non-zero exit status 8. During handling of the above exception, another exception occurred: NameError Traceback (most recent call last) in NameError: name 'res' is not defined`