THUNLP-MT / dyMEAN

This repo contains the codes for our paper "End-to-End Full-Atom Antibody Design"
https://arxiv.org/abs/2302.00203
MIT License
89 stars 8 forks source link

Error in Dataloader #15

Closed yilia-yao closed 8 months ago

yilia-yao commented 8 months ago

Hi, it's a very interesting and great work.

Here comes the TypeError problem. I changed the parameter of design.py, mainly is the input pdb, toxin chain, antibody sequence and so on (multi-cdr design). It works on many tests.

But one report an error, here is the information:

0%| | 0/1 [00:00<?, ?it/s] Traceback (most recent call last): File "/home/XXX/anaconda3/envs/dyMEAN/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/home/XXX/anaconda3/envs/dyMEAN/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/data/XXX/software/dyMEAN/api/design.py", line 239, in design(ckpt=ckpt, # path to the checkpoint of the trained model File "/data/XXX/software/dyMEAN/api/design.py", line 164, in design for batch in tqdm(dataloader): File "/home/XXX/anaconda3/envs/dyMEAN/lib/python3.8/site-packages/tqdm/std.py", line 1182, in iter for obj in iterable: File "/home/XXX/anaconda3/envs/dyMEAN/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 681, in next data = self._next_data() File "/home/XXX/anaconda3/envs/dyMEAN/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1376, in _next_data return self._process_data(data) File "/home/XXX/anaconda3/envs/dyMEAN/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1402, in _process_data data.reraise() File "/home/XXX/anaconda3/envs/dyMEAN/lib/python3.8/site-packages/torch/_utils.py", line 461, in reraise raise exception TypeError: Caught TypeError in DataLoader worker process 0. Original Traceback (most recent call last): File "/home/XXX/anaconda3/envs/dyMEAN/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 302, in _worker_loop data = fetcher.fetch(index) File "/home/XXX/anaconda3/envs/dyMEAN/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/XXX/anaconda3/envs/dyMEAN/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/data/XXX/software/dyMEAN/api/design.py", line 91, in getitem hc_residues, hc_smask = self.generate_ab_chain(h_seq) File "/data/XXX/software/dyMEAN/api/design.py", line 73, in generate_ab_chain residues.append(Residue(s, fake_coords, pos)) File "/data/XXX/software/dyMEAN/data/pdb_utils.py", line 384, in init self.sidechain = VOCAB.get_sidechain_info(symbol) File "/data/XXX/software/dyMEAN/data/pdb_utils.py", line 326, in get_sidechain_info return copy(self.amino_acids[idx].sidechain) TypeError: list indices must be integers or slices, not NoneType

I think something went wrong when side chain information or index is introduced. But I can not figure it out.

Can anyone do me a favor? Thanks a lot.

kxz18 commented 8 months ago

Hi, thank you for you interest in our work! Looks like the error is because of a residue whose type not recognized by the vocabulary. Can you check whether there are any non-standard amino acids in the epitope or the antibody sequence?

yilia-yao commented 8 months ago

Hi, thank you for you interest in our work! Looks like the error is because of a residue whose type not recognized by the vocabulary. Can you check whether there are any non-standard amino acids in the epitope or the antibody sequence?

Thanks a lot. Problem solved! My fault, some non-standard amino acids are involved, I didn't notice it before.