Hi,
I (and ChatGPT) have been trying to make BioKinema work on my PC. I solved some problems with creating a functional environment and also using an sdf reference file to help with a better definition of the ligand.
I am testing BioKinema inference on a protein–custom ligand complex that also contains a Ca2+ ion in the ligand-binding pocket. If the ions just fly away, it is not just problematic for my receptor but also for all GPCRs that have a Sodium ion important for controlling the active/inactive state of those receptors. I had to modify inference.sh, inference.py and dataset.py to get through but I still have a problem with the Ca2+ ion that gets ejected from the binding site. Here is a resume, from ChatGPT, of the problem I got, solved and still have:
System
- OS: Linux
- GPU: NVIDIA RTX 4060 Ti
- PyTorch: 2.4.1+cu121
- CUDA toolkit/nvcc: 12.1
- Input: protein–ligand–Ca2+ complex in PDB format
- Ligand: custom small molecule residue
MOL
- Ligand SDF: same docked/minimized ligand pose, with explicit hydrogens
Command
bash inference.sh \
--input_file Positives-THIQ_HA42-2_complex-minimized-hydrated_nowater.pdb \
--ligand_sdf Positives-THIQ_HA42-2_ligand-minimized.sdf \
--dump_dir output/Positives-THIQ_HA42-2_sdfchem
Note: --ligand_sdf is a local patch/workaround; the current public inference interface appears to accept only PDB/CIF input.
Issue 1: PDB/CIF input is insufficient for custom ligand chemistry
The current inference workflow appears to use only the PDB/CIF file. For a custom ligand, this is fragile because PDB/CIF does not reliably preserve bond order, aromaticity, formal charge, protonation state, or full ligand chemistry.
Without an SDF reference ligand, the ligand valence check failed. I locally patched InferenceDataset to accept a ligand SDF and use it as the authoritative ligand bond graph while keeping the complex PDB as the coordinate source.
This seems like an important feature for custom ligand workflows:
complex PDB/CIF: protein/ligand/ion coordinates
ligand SDF or ligand SMILES: ligand chemistry / bond graph / bond orders
Issue 2: ligand hydrogens are stripped internally
The input PDB and SDF both contained the same protonated ligand with explicit hydrogens. However, during BioKinema/Protenix preprocessing, the ligand was represented internally as heavy atoms only.
Observed diagnostic after patching:
Using SDF heavy-atom connectivity for ligand subset:
atom_array_ligand_like=43, selected_complex_atoms=42, sdf_all=84, sdf_heavy=42
So the input ligand had 84 atoms in the SDF, but the internal ligand representation used 42 heavy atoms.
This may be expected, but it would be helpful if this behavior were documented, especially for protonated ligands and charge-dependent interactions.
Issue 3: Ca2+ was treated as ligand-like during preprocessing
The internal ligand-like atom mask contained 43 atoms, while the SDF ligand heavy-atom graph contained 42 atoms. The extra atom was Ca:
Excluding non-SDF ligand-like atoms from the ligand mask before valence checking:
indices=[2283], elements=['CA']
This caused problems for ligand valence checking until Ca was excluded from the ligand mask.
Could ion/cofactor atoms be handled separately from ligand atoms during inference preprocessing?
Issue 4: Ca2+ is ejected from the binding pocket in generated trajectory
Although the Ca2+ ion is present in the input structure and ion-related categories are detected (intra_ions, ions_prot, ions_ligand), the generated trajectory ejects the Ca2+ ion from the binding pocket from the beginning of the trajectory.
This suggests the ion is parsed, but not treated as a constrained/coordinated metal center. For ion-dependent binding sites, this makes it difficult to interpret the generated trajectory physically.
Would it be possible to:
preserve/freeze specified ions or cofactors during inference?
add support for metal coordination constraints?
document whether metal ions are expected to be modeled reliably?
Issue 5: possible time_interval configuration issue
The terminal output printed:
coarse_interval: 2
time_interval: False
If time_interval is used as a temporal feature, False may behave like zero. Could this be checked? Should inference default to a numeric time interval, or derive it from coarse_interval?
Additional minor observations
First run compiles the DeepSpeed Evoformer attention extension, which took ~200 seconds.
The log showed TORCH_CUDA_ARCH_LIST is not set, even though the extension compiled for the visible GPU.
The run succeeded after the ligand SDF workaround:
Repaired ligand connectivity from SDF: 42 ligand atoms, 47 ligand bonds
[Rank 0] Positives-THIQ_HA42-2_sdfchem_0 succeeded.
Request
Could BioKinema support an official inference workflow for custom ligands, for example:
python runner/inference.py \
--input_file complex.pdb \
--ligand_sdf ligand.sdf \
--dump_dir output
or alternatively provide guidance for generating a proper CCD/mmCIF ligand definition?
Also, could you clarify the intended behavior for metal ions such as Ca2+ during trajectory generation?
Hi,
I (and ChatGPT) have been trying to make BioKinema work on my PC. I solved some problems with creating a functional environment and also using an sdf reference file to help with a better definition of the ligand.
I am testing BioKinema inference on a protein–custom ligand complex that also contains a Ca2+ ion in the ligand-binding pocket. If the ions just fly away, it is not just problematic for my receptor but also for all GPCRs that have a Sodium ion important for controlling the active/inactive state of those receptors. I had to modify inference.sh, inference.py and dataset.py to get through but I still have a problem with the Ca2+ ion that gets ejected from the binding site. Here is a resume, from ChatGPT, of the problem I got, solved and still have:
System
MOLCommand
bash inference.sh \ --input_file Positives-THIQ_HA42-2_complex-minimized-hydrated_nowater.pdb \ --ligand_sdf Positives-THIQ_HA42-2_ligand-minimized.sdf \ --dump_dir output/Positives-THIQ_HA42-2_sdfchem Note: --ligand_sdf is a local patch/workaround; the current public inference interface appears to accept only PDB/CIF input. Issue 1: PDB/CIF input is insufficient for custom ligand chemistry The current inference workflow appears to use only the PDB/CIF file. For a custom ligand, this is fragile because PDB/CIF does not reliably preserve bond order, aromaticity, formal charge, protonation state, or full ligand chemistry. Without an SDF reference ligand, the ligand valence check failed. I locally patched InferenceDataset to accept a ligand SDF and use it as the authoritative ligand bond graph while keeping the complex PDB as the coordinate source. This seems like an important feature for custom ligand workflows: complex PDB/CIF: protein/ligand/ion coordinates ligand SDF or ligand SMILES: ligand chemistry / bond graph / bond orders Issue 2: ligand hydrogens are stripped internally The input PDB and SDF both contained the same protonated ligand with explicit hydrogens. However, during BioKinema/Protenix preprocessing, the ligand was represented internally as heavy atoms only. Observed diagnostic after patching: Using SDF heavy-atom connectivity for ligand subset: atom_array_ligand_like=43, selected_complex_atoms=42, sdf_all=84, sdf_heavy=42 So the input ligand had 84 atoms in the SDF, but the internal ligand representation used 42 heavy atoms. This may be expected, but it would be helpful if this behavior were documented, especially for protonated ligands and charge-dependent interactions. Issue 3: Ca2+ was treated as ligand-like during preprocessing The internal ligand-like atom mask contained 43 atoms, while the SDF ligand heavy-atom graph contained 42 atoms. The extra atom was Ca: Excluding non-SDF ligand-like atoms from the ligand mask before valence checking: indices=[2283], elements=['CA'] This caused problems for ligand valence checking until Ca was excluded from the ligand mask. Could ion/cofactor atoms be handled separately from ligand atoms during inference preprocessing? Issue 4: Ca2+ is ejected from the binding pocket in generated trajectory Although the Ca2+ ion is present in the input structure and ion-related categories are detected (intra_ions, ions_prot, ions_ligand), the generated trajectory ejects the Ca2+ ion from the binding pocket from the beginning of the trajectory. This suggests the ion is parsed, but not treated as a constrained/coordinated metal center. For ion-dependent binding sites, this makes it difficult to interpret the generated trajectory physically. Would it be possible to: preserve/freeze specified ions or cofactors during inference? add support for metal coordination constraints? document whether metal ions are expected to be modeled reliably? Issue 5: possible time_interval configuration issue The terminal output printed: coarse_interval: 2 time_interval: False If time_interval is used as a temporal feature, False may behave like zero. Could this be checked? Should inference default to a numeric time interval, or derive it from coarse_interval? Additional minor observations First run compiles the DeepSpeed Evoformer attention extension, which took ~200 seconds. The log showed TORCH_CUDA_ARCH_LIST is not set, even though the extension compiled for the visible GPU. The run succeeded after the ligand SDF workaround: Repaired ligand connectivity from SDF: 42 ligand atoms, 47 ligand bonds [Rank 0] Positives-THIQ_HA42-2_sdfchem_0 succeeded. Request Could BioKinema support an official inference workflow for custom ligands, for example: python runner/inference.py \ --input_file complex.pdb \ --ligand_sdf ligand.sdf \ --dump_dir output or alternatively provide guidance for generating a proper CCD/mmCIF ligand definition? Also, could you clarify the intended behavior for metal ions such as Ca2+ during trajectory generation?