Closed alchemistcai closed 2 months ago
Other source code remains unchanged.
Yes, main.py
expects binding residue indices instead of probabilities. I forgot to add the parsing script in the initial commit, now you can find it here: parse_dl_results.py and I have updated the README as well. Thanks for catching the error! Let me know if you run into any other issues.
After generating parsed pkl file,I run src/main.py and it raises KeyError.
python $esm_bind_path/3D_modeling/src/parse_dl_results.py ZN multi_modal_binding/results/inference/2024-09-11-18-21/predictions.pkl --lower_factor 0.6
python -u $esm_bind_path/3D_modeling/src/main.py --ion ZN --restraint_force_constant 41840 --prediction_result parsed_result_predictions_ZN_lower_factor_0.60.pkl --pdb-dir ./ --output-dir ./
# Traceback (most recent call last):
# File "/home/regen/git_develop/ESMBind/3D_modeling/src/main.py", line 140, in <module>
# main(
# File "/home/regen/git_develop/ESMBind/3D_modeling/src/main.py", line 25, in main
# predictions = predictions[ion]
# ~~~~~~~~~~~^^^^^
KeyError: 'ZN'
I add print statements in src/main.py,predictions is {'sea': [211, 249], 'see': [138, 211, 249]}
.
src/main.py>main
function needs to update its interface and implementation.
I just updated the main.py
to remove this line and it should be fixed. Note however in my test case the keys of the prediction
have the structure: pdbid_chainid
, e.g., 7LCI_A, you may need to modify here https://github.com/Structurebiology-BNL/ESMBind/blob/6b31680b967b1881e0375c0d0aca57ea327640ad/3D_modeling/src/main.py#L45 and subsequent places in https://github.com/Structurebiology-BNL/ESMBind/blob/6b31680b967b1881e0375c0d0aca57ea327640ad/3D_modeling/src/add_ions.py#L460 where pdb_id and chain_id are used to make your example working.
I use
3D_modeling/src/main.py
to generate 3D structure and initial placements for ZN is 0.By adding two print statements in
add_ions.py
,it seems like that we need to convert predictions.pkl's probability into possible residues ids,butsrc/main.py
doesn't work.residue.id[1]
is int,and is not possible in predictions[id](float array).