dauparas / LigandMPNN

MIT License
236 stars 47 forks source link

2 design a new sequence and pack side chains (return 4 side chain packing samples) #24

Open amelie-iska opened 6 months ago

amelie-iska commented 6 months ago

Running the following command:

python run.py \
        --model_type "ligand_mpnn" \
        --seed 111 \
        --pdb_path "./inputs/1BC8.pdb" \
        --out_folder "./outputs/sc_default" \
        --pack_side_chains 1 \
        --number_of_packs_per_design 4 \
        --pack_with_ligand_context 1

returns the following error:

Packing side chains...
Traceback (most recent call last):
  File "/home/workspace/proteins/LigandMPNN/run.py", line 981, in <module>
    main(args)
  File "/home/workspace/proteins/LigandMPNN/run.py", line 517, in main
    sc_dict = pack_side_chains(
              ^^^^^^^^^^^^^^^^^
  File "/home/workspace/proteins/LigandMPNN/sc_utils.py", line 67, in pack_side_chains
    torsion_dict = make_torsion_features(feature_dict, repack_everything)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/workspace/proteins/LigandMPNN/sc_utils.py", line 212, in make_torsion_features
    xyz14_noised = feats.frames_and_literature_positions_to_atom14_pos(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/workspace/proteins/LigandMPNN/openfold/utils/feats.py", line 253, in frames_and_literature_positions_to_atom14_pos
    group_mask = nn.functional.one_hot(
                 ^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: one_hot is only applicable to index tensor.
dauparas commented 6 months ago

I am not getting this error running in the environment specified by requirements.txt ; I added .long() https://github.com/dauparas/LigandMPNN/commit/091ab1ff5fb4d13854cf6a7c41ec531e1d9d3e67 which might solve your problem.