-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Description
Hi
I tried to use the protein helper function and found this.
I have two options for reading protein with a protein helper. Both work for fingerprint calculation and 2D visualization, yielding identical results. However, I can only visualize the results from "option 1" in a 3D plot. The other will lead to an error "unkekulize mol".
The test data is here: https://github.com/yuyuan871111/GSoC2025_Hbond_PM/tree/main/test_data/5da9__1__1.A_1.B__1.E_1.F
# prolif version
pip install git+https://github.com/chemosim-lab/ProLIF.git@gsoc_implicit_hbondimport os
import prolif as plf
from prolif import sdf_supplier
from prolif.io.protein_helper import ProteinHelper
from prolif.molecule import Molecule
from rdkit import Chem
protein_helper = ProteinHelper(
templates=[
{
"MSE": {"SMILES": "C[Se]CC[CH](N)C=O"},
}
]
)
test_case_dir = "./test_data/5da9__1__1.A_1.B__1.E_1.F"
# Option 1 for reading protein:
protein_mol = Molecule.from_rdkit(
Chem.MolFromPDBFile(
f"{test_case_dir}/receptor_protonated.pdb",
sanitize=False,
removeHs=False,
proximityBonding=True,
)
)
protein_mol = protein_helper.standardize_protein(protein_mol)
# Option 2 for reading protein:
protein_mol = protein_helper.standardize_protein(
f"{test_case_dir}/receptor_protonated.pdb"
)
# ligand
ligands = []
for ligand_sdf in os.listdir(test_case_dir): # noqa: PTH208
if ligand_sdf.endswith("_protonated.sdf"):
ligands.extend(sdf_supplier(f"{test_case_dir}/{ligand_sdf}"))
ligand = ligands[0]
fp = plf.Fingerprint(["HBDonor", "HBAcceptor"], count=True)
fp.run_from_iterable([ligand], protein_mol, progress=False)
df = fp.to_dataframe().Tview = fp.plot_lignetwork(ligand, kind="frame", frame=0, display_all=False)
viewview = fp.plot_3d(ligand, protein_mol, frame=0, display_all=True)
viewMetadata
Metadata
Assignees
Labels
No labels



