zrqiao / NeuralPLexer

NeuralPLexer: State-specific protein-ligand complex structure prediction with a multi-scale deep generative model
https://doi.org/10.1038/s42256-024-00792-z
BSD 3-Clause Clear License
266 stars 70 forks source link

Bad Coformer ID when using smiles strings #43

Open EvanKomp opened 5 months ago

EvanKomp commented 5 months ago

Description

Ran:

neuralplexer-inference --task=batched_structure_sampling \
                       --input-receptor $INPUT_SEQ \
                       --input-ligand $INPUT_SMILES \
                       --use-template  --input-template $INPUT_PDB \
                       --out-path ./outs \
                       --model-checkpoint /projects/proteinml/datasets/neuralplexer/neuralplexermodels_downstream_datasets_predictions/models/complex_structure_prediction.ckpt \
                       --n-samples 4 \
                       --chunk-size 1 \
                       --num-steps=40 \
                       --cuda \
                       --sampler=langevin_simulated_annealing

Raised:

Traceback (most recent call last):
  File "/projects/proteinml/.links/miniconda3/envs/neuralplexer_dev/bin/neuralplexer-inference", line 33, in <module>
    sys.exit(load_entry_point('neuralplexer', 'console_scripts', 'neuralplexer-inference')())
  File "/kfs2/projects/proteinml/repos/NeuralPLexer/neuralplexer/inference.py", line 672, in main
    multi_pose_sampling(
  File "/kfs2/projects/proteinml/repos/NeuralPLexer/neuralplexer/inference.py", line 169, in multi_pose_sampling
    np_sample, mol = featurize_protein_and_ligands(
  File "/kfs2/projects/proteinml/repos/NeuralPLexer/neuralplexer/data/pipeline.py", line 908, in featurize_protein_and_ligands
    lig_sample, mol_ref = process_mol_file(
  File "/kfs2/projects/proteinml/repos/NeuralPLexer/neuralplexer/data/pipeline.py", line 120, in process_mol_file
    conf_xyz = np.array(mol.GetConformer().GetPositions())
ValueError: Bad Conformer Id

This is expected, as an RDKit mol from smiles has no conformers. Adding

Chem.rdDepictor.Compute2DCoords(mol)

Directly before the conformation generation solves the issue.

ejmeitz commented 5 months ago

Also had this issue.