### Install PoseCheck and Dependencies Source: https://github.com/cch1999/posecheck/blob/main/docs/source/index.rst Instructions for cloning the PoseCheck repository, installing it in editable mode, and setting up necessary dependencies like RDKit and reduce. ```bash git clone https://github.com/cch1999/posecheck.git cd posecheck pip install -e . pip install -r requirements.txt conda install -c mx reduce ``` -------------------------------- ### Install PoseCheck Package Source: https://github.com/cch1999/posecheck/blob/main/README.md This command installs the PoseCheck package using pip. Ensure you have Python 3.9 or higher installed. This is the primary method for setting up PoseCheck in your environment. ```bash pip install posecheck ``` -------------------------------- ### PoseCheck API Usage Example Source: https://github.com/cch1999/posecheck/blob/main/docs/source/index.rst Demonstrates how to initialize the PoseCheck object, load protein and ligand structures from files or RDKit molecules, and perform quality checks such as clash detection, strain energy calculation, and interaction analysis. ```python from posecheck import PoseCheck # Initialize the PoseCheck object pc = PoseCheck() # Load a protein from a PDB file (will run reduce in the background) pc.load_protein_from_pdb("data/examples/1a2g.pdb") # Load ligands from an SDF file pc.load_ligands_from_sdf("data/examples/1a2g_ligand.sdf") # Alternatively, load RDKit molecules directly # pc.load_ligands_from_mols([rdmol]) # Check for clashes clashes = pc.calculate_clashes() print(f"Number of clashes in example molecule: {clashes[0]}") # Check for strain strain = pc.calculate_strain_energy() print(f"Strain energy of example molecule: {strain[0]}") # Check for interactions interactions = pc.calculate_interactions() print(f"Interactions of example molecule: {interactions}") ``` -------------------------------- ### PoseCheck: Install and Run All Quality Checks (Python) Source: https://context7.com/cch1999/posecheck/llms.txt Installs the PoseCheck library via pip and demonstrates basic usage. It loads a protein from a PDB file and ligands from an SDF file, then runs all quality checks at once, printing clash counts, strain energy, and interaction fingerprints. ```python # Install via pip # pip install posecheck from posecheck import PoseCheck # Initialize PoseCheck pc = PoseCheck() # Load protein structure (automatically adds hydrogens using reduce) pc.load_protein_from_pdb("data/examples/1a2g.pdb") # Load ligand(s) from SDF file pc.load_ligands_from_sdf("data/examples/1a2g_ligand.sdf") # Run all quality checks at once results = pc.run() print(f"Clashes: {results['clashes']}") print(f"Strain energy: {results['strain']}") print(f"Interactions:\n{results['interactions']}") ``` -------------------------------- ### PoseCheck: Load Ligands from Multiple Sources (Python) Source: https://context7.com/cch1999/posecheck/llms.txt Demonstrates various methods for loading ligand molecules into PoseCheck. Supports loading from SDF, PDBQT files, RDKit Mol objects, and auto-detects file types based on extension, ensuring flexibility in input data. ```python from posecheck import PoseCheck from rdkit import Chem import datamol as dm pc = PoseCheck() pc.load_protein_from_pdb("protein.pdb") # Method 1: Load from SDF file (automatically adds hydrogens) pc.load_ligands_from_sdf("ligands.sdf") # Method 2: Load from PDBQT file (common docking output format) pc.load_ligands_from_pdbqt("docked_pose.pdbqt") # Method 3: Load from RDKit Mol objects mol1 = Chem.MolFromSmiles("CCO") mol2 = Chem.MolFromSmiles("c1ccccc1") pc.load_ligands_from_mols([mol1, mol2], add_hs=True) # Method 4: Auto-detect file type pc.load_ligands("ligand.sdf") # Detects .sdf extension pc.load_ligands("ligand.pdbqt") # Detects .pdbqt extension # Run analysis on loaded ligands results = pc.run() print(f"Analyzed {len(results['clashes'])} ligands") ``` -------------------------------- ### Pre-process Proteins for Performance Source: https://context7.com/cch1999/posecheck/llms.txt Illustrates an optimization technique for analyzing multiple ligand sets against the same protein target. By pre-loading and caching the protein structure, subsequent analyses with different ligands become significantly faster, avoiding redundant processing. This is beneficial for large-scale evaluations. ```python from posecheck import PoseCheck from posecheck.utils.loading import load_protein_from_pdb # Tip: Pre-process proteins if analyzing many ligands against the same target # This avoids repeatedly running reduce on the same protein # Pre-load and cache protein cached_protein = load_protein_from_pdb("protein.pdb") # Analyze multiple ligand sets efficiently ligand_sets = ["set1.sdf", "set2.sdf", "set3.sdf"] for lig_path in ligand_sets: pc = PoseCheck() pc.protein = cached_protein # Directly set pre-processed protein pc.load_ligands_from_sdf(lig_path) results = pc.run() print(f"{lig_path}: {results['clashes'][0]} clashes, {results['strain'][0]:.2f} strain") # This approach saves significant time when: # - Benchmarking multiple generative models # - Evaluating large virtual screening libraries # - Running repeated analyses during model development ``` -------------------------------- ### Validate Docked Pose with PoseCheck (Python) Source: https://context7.com/cch1999/posecheck/llms.txt This snippet shows how to initialize PoseCheck, load a protein and ligand, run the validation, and access the results for clashes and strain. It requires the PoseCheck library and assumes protein.pdb and a redocked ligand molecule are available. ```python from posecheck import PoseCheck # Assuming 'redocked' is a dictionary containing ligand information # and 'protein.pdb' is the path to your protein structure file. pc = PoseCheck() pc.load_protein_from_pdb("protein.pdb") pc.load_ligands_from_mols([redocked['mols'][0]]) validation = pc.run() print(f"Clashes: {validation['clashes']}") print(f"Strain: {validation['strain']}") ``` -------------------------------- ### Direct Use of PoseCheck Utility Functions Source: https://context7.com/cch1999/posecheck/llms.txt Demonstrates advanced usage by directly importing and utilizing individual utility functions from the PoseCheck library. This allows for fine-grained control over loading structures, checking for radicals, calculating clashes with custom tolerances, determining strain energy with specific parameters, and generating interaction fingerprints. ```python from posecheck.utils.loading import load_protein_from_pdb, load_mols_from_sdf from posecheck.utils.clashes import count_clashes from posecheck.utils.strain import calculate_strain_energy from posecheck.utils.interactions import generate_interaction_df from posecheck.utils.chem import rmsd, has_radicals, remove_radicals # Load structures directly protein = load_protein_from_pdb("protein.pdb", reduce_path="reduce") ligands = load_mols_from_sdf("ligands.sdf", add_hs=True) # Check for radicals before clash detection if has_radicals(ligands[0]): print("Removing radicals from ligand...") ligands[0] = remove_radicals(ligands[0]) # Calculate clashes with custom tolerance for lig in ligands: clash_count = count_clashes(protein, lig, tollerance=0.3) print(f"Clashes (0.3Å tolerance): {clash_count}") # Calculate strain with custom parameters strain = calculate_strain_energy( ligands[0], maxDispl=0.15, # Maximum atom displacement num_confs=100 # Number of conformers to sample ) print(f"Strain energy: {strain:.2f} kcal/mol") # Generate detailed interaction fingerprints interactions = generate_interaction_df(protein, ligands) print(f"Interaction matrix shape: {interactions.shape}") ``` -------------------------------- ### Integration with Docking Software (SMINA) Source: https://context7.com/cch1999/posecheck/llms.txt Shows how to integrate PoseCheck with external docking software, specifically SMINA. It covers initializing the SMINA engine, setting the receptor and docking box parameters, scoring, minimizing, and redocking a ligand. This allows for seamless incorporation of docking simulations within PoseCheck workflows. ```python from posecheck import PoseCheck from posecheck.utils.docking import SMINA # Initialize docking engine docker = SMINA(executable="path/to/smina.static") # Set receptor and docking box docker.set_receptor( receptor_path="receptor.pdbqt", centre="pocket", # Auto-detect pocket center size=25 # Box size in Angstroms ) # Load ligand and perform operations from rdkit import Chem mol = Chem.MolFromSmiles("CCO") docker.set_ligand_from_mol(mol) # Score a pose score_result = docker.score_pose() print(f"Docking score: {score_result}") # Minimize a pose minimized = docker.minimize_pose() print(f"Minimized energy: {minimized}") # Redock ligand redocked = docker.redock() print(f"Redocked poses: {len(redocked['mols'])}") # Clean up temporary files docker.clear_ligand() ``` -------------------------------- ### Load Protein Manually in Python Source: https://github.com/cch1999/posecheck/blob/main/README.md This Python snippet shows an optimization tip for PoseCheck users. If you frequently process many PDB files, you can pre-process proteins using `posecheck.utils.loading.load_protein_from_pdb` and then assign the loaded protein object directly to `pc.protein`. This avoids redundant processing by the `reduce` program. ```python import posecheck.utils.loading # Pre-process protein prot = posecheck.utils.loading.load_protein_from_pdb(pdb_path) # Assign pre-processed protein to PoseCheck object pc.protein = prot ``` -------------------------------- ### Batch Process Multiple Protein-Ligand Complexes Source: https://context7.com/cch1999/posecheck/llms.txt Evaluates multiple protein-ligand complexes in a batch process using the PoseCheck library. It calculates clashes, strain energy, and interactions for each complex, returning the results as a Pandas DataFrame. This function is useful for high-throughput screening and benchmarking. ```python from posecheck import PoseCheck import pandas as pd def evaluate_docking_results(protein_paths, ligand_paths): """Evaluate multiple protein-ligand complexes""" results = [] for i, (prot_path, lig_path) in enumerate(zip(protein_paths, ligand_paths)): pc = PoseCheck() pc.load_protein_from_pdb(prot_path) pc.load_ligands_from_sdf(lig_path) # Run all checks clashes = pc.calculate_clashes() strain = pc.calculate_strain_energy() interactions = pc.calculate_interactions() results.append({ 'complex_id': i, 'protein': prot_path, 'ligand': lig_path, 'clashes': clashes[0] if clashes else None, 'strain': strain[0] if strain else None, 'num_interactions': len(interactions.columns) if interactions is not None else 0 }) return pd.DataFrame(results) # Run evaluation protein_list = ["1a2g.pdb", "1b3h.pdb", "2c4j.pdb"] ligand_list = ["1a2g_lig.sdf", "1b3h_lig.sdf", "2c4j_lig.sdf"] results_df = evaluate_docking_results(protein_list, ligand_list) print(results_df) # Filter for high-quality poses good_poses = results_df[ (results_df['clashes'] == 0) & (results_df['strain'] < 25) & (results_df['num_interactions'] > 5) ] print(f"\n{len(good_poses)} high-quality poses found") ``` -------------------------------- ### PoseCheck Citation in BibTeX Source: https://github.com/cch1999/posecheck/blob/main/README.md This is the BibTeX entry for citing the PoseCheck paper. It includes author information, title, journal (arXiv preprint), and publication year. Use this in your LaTeX documents to properly reference the PoseCheck project. ```bibtex @article{harris2023benchmarking, title={Benchmarking Generated Poses: How Rational is Structure-based Drug Design with Generative Models?}, author={Harris, Charles and Didi, Kieran and Jamasb, Arian R and Joshi, Chaitanya K and Mathis, Simon V and Lio, Pietro and Blundell, Tom}, journal={arXiv preprint arXiv:2308.07413}, year={2023} } ``` -------------------------------- ### PoseCheck: Calculate RMSD Between Poses (Python) Source: https://context7.com/cch1999/posecheck/llms.txt Calculates the Root Mean Square Deviation (RMSD) between a generated ligand pose and a reference pose. This requires loading both poses, typically from SDF files, using PoseCheck's utility functions. ```python from posecheck import PoseCheck from posecheck.utils.loading import load_mols_from_sdf pc = PoseCheck() # Load generated pose and reference pose generated_pose = load_mols_from_sdf("generated.sdf")[0] reference_pose = load_mols_from_sdf("crystal_ligand.sdf")[0] ``` -------------------------------- ### PoseCheck: Calculate Ligand Strain Energy (Python) Source: https://context7.com/cch1999/posecheck/llms.txt Calculates the internal strain energy of a ligand conformation. The function compares the energy of the provided conformation against locally relaxed and globally minimized conformers, reporting results in kcal/mol. ```python from posecheck import PoseCheck pc = PoseCheck() # Load ligands (can load from SDF, PDBQT, or RDKit molecules) pc.load_ligands_from_sdf("ligands.sdf") # Calculate strain energy for each ligand # Compares locally relaxed energy vs globally minimized conformers strain_energies = pc.calculate_strain_energy() for i, strain in enumerate(strain_energies): print(f"Ligand {i}: Strain energy = {strain:.2f} kcal/mol") if strain > 50: print(f" WARNING: High strain - pose may be unrealistic") elif strain < 10: print(f" GOOD: Low strain - energetically favorable") ``` -------------------------------- ### PoseCheck: Calculate Steric Clashes (Python) Source: https://context7.com/cch1999/posecheck/llms.txt Calculates the number of steric clashes between protein and ligand atoms. This snippet shows how to initialize PoseCheck with a custom clash tolerance and iterate through results to report clash counts for each ligand. ```python from posecheck import PoseCheck # Initialize with custom clash tolerance (default: 0.5 Angstroms) pc = PoseCheck(clash_tolerance=0.4) # Load protein and ligand pc.load_protein_from_pdb("protein.pdb") pc.load_ligands_from_sdf("ligands.sdf") # Calculate number of steric clashes # Returns list of clash counts for each ligand clashes = pc.calculate_clashes() for i, clash_count in enumerate(clashes): if clash_count > 0: print(f"Ligand {i}: {clash_count} clashes detected") else: print(f"Ligand {i}: No clashes - good pose!") ``` -------------------------------- ### PoseCheck: Analyze Protein-Ligand Interactions (Python) Source: https://context7.com/cch1999/posecheck/llms.txt Analyzes molecular interactions between a protein and its bound ligand(s). This function calculates interaction fingerprints, providing a DataFrame that details types of interactions (e.g., hydrogen bonds, hydrophobic contacts) per residue. ```python from posecheck import PoseCheck import pandas as pd pc = PoseCheck() # Load protein and ligands pc.load_protein_from_pdb("protein.pdb") pc.load_ligands_from_sdf("generated_poses.sdf") # Calculate interaction fingerprints # Returns DataFrame with interaction types per residue interactions_df = pc.calculate_interactions() print(interactions_df.head()) # Shows columns for each residue and interaction type: # - Hydrophobic contacts # - Hydrogen bonds (donor/acceptor) # - Salt bridges # - Pi-stacking interactions # - Halogen bonds # Count total interactions per ligand ligand_count = interactions_df.index.get_level_values(0).nunique() print(f"\nAnalyzed {ligand_count} ligand poses") # Analyze specific interaction types h_bonds = interactions_df.filter(like='HBDonor').sum(axis=1) print(f"\nHydrogen bonds per ligand:\n{h_bonds}") ``` -------------------------------- ### Calculate RMSD Between Two Poses Source: https://context7.com/cch1999/posecheck/llms.txt Calculates the Root Mean Square Deviation (RMSD) between a generated pose and a reference pose. It then categorizes the pose quality based on the calculated RMSD value. This is useful for assessing the accuracy of pose prediction models. ```python from posecheck import PoseCheck # Assume generated_pose and reference_pose are defined Pose objects # Example Placeholder: class MockPose: def __init__(self, coords): self.coords = coords def create_mock_pose(num_atoms=10): import numpy as np return MockPose(np.random.rand(num_atoms, 3) * 10) generated_pose = create_mock_pose() reference_pose = create_mock_pose() # Mock PoseCheck class for demonstration if not available class MockPoseCheck: def calculate_rmsd(self, pose1, pose2): # Simple mock RMSD calculation (e.g., average distance) if len(pose1.coords) != len(pose2.coords): return float('inf') return np.mean(np.linalg.norm(pose1.coords - pose2.coords, axis=1)) pc = MockPoseCheck() # Replace with actual PoseCheck() if available rmsd_value = pc.calculate_rmsd(generated_pose, reference_pose) print(f"RMSD between generated and reference: {rmsd_value:.2f} Å") if rmsd_value < 2.0: print("Excellent pose prediction!") elif rmsd_value < 3.0: print("Good pose prediction") else: print("Poor pose prediction - consider refinement") # Expected output for identical poses: # RMSD between generated and reference: 0.00 Å # Excellent pose prediction! ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.