kiharalab/GNN_DOVE

Solution suggest for AttributeError: 'NoneType' object has no attribute 'GetNumAtoms' #1

yauz3 opened this issue · 2 comments

yauz3 commented

Hi.
I think your project is great. Thank you for sharing this project.

Unfortunately, once protein-protein complex does not have CHAIN B. Determination of receptor and ligand is giving this error:
AttributeError: 'NoneType' object has no attribute 'GetNumAtoms' #1
because llist returns none and Rdkit is giving this error.
Problem 1
Therefore, I changed some lines to use in my research. I also compare with original code results for a couple of complexes and the result are the same.
def Extract_Interface(pdb_path):
b=0
if (dat_in[0] == 'TER'):
b=b+1
Just before **if (dat_in[0] == 'ATOM'): **
.....
if b == 0:
rlist.append(tmp_list)
tmp_list = []
tmp_list.append([x, y, z, atom_type, count_l])
count_l += 1
receptor_list.append(line)
else:
llist.append(tmp_list)
tmp_list = []
tmp_list.append([x, y, z, atom_type, count_l])
count_l += 1
ligand_list.append(line)
Just Before print("After filtering the interface region, %d receptor, %d ligand"%(len(final_receptor),len(final_ligand)))

I will arrange my structure with TER between ligand and receptor. ZDock is already providing this format.

PROBLEM 2
Sometimes atom number in protein complex is not in order. It can be started from 1 again. So, I changed these lines.

def Form_interface(rlist,llist,receptor_list,ligand_list,cut_off=10):
....................
control=0
try:
for residue in newllist:
for tmp_atom in residue:
our_index = tmp_atom[4]
"""print("ouurrr_index")
print(our_index)"""
final_ligand.append(ligand_list[our_index])
control=control+1
except:
if control > 0:
pass
else:
b = 0
for residue in newllist:
for tmp_atom in residue:
our_index = b
"""print("ouurrr_index")
print(our_index)"""
final_ligand.append(ligand_list[our_index])
b = b + 1
Just before print("After filtering the interface region, %d receptor, %d ligand"%(len(final_receptor),len(final_ligand)))

I am planning to use original form as much as I can. I hope these can help some.

Thank you so much for your kind suggestion! Could you please make a pull request for that. I think I can include your suggestion to this repo.

yauz3 commented

I am quite happy to help. Your project is amazing, I am looking forward to your research.