### Install PeptideBuilder Source: https://context7.com/clauswilke/peptidebuilder/llms.txt Install the library using pip. ```bash pip install PeptideBuilder ``` -------------------------------- ### Initialize Structure Source: https://context7.com/clauswilke/peptidebuilder/llms.txt Create a new Biopython structure object starting with a single amino acid residue. ```python import PeptideBuilder from PeptideBuilder import Geometry # Initialize with single-letter code (uses default geometry) structure = PeptideBuilder.initialize_res("A") # Initialize with custom geometry for helix geo = Geometry.geometry("G") geo.phi = -60 geo.psi_im1 = -40 structure = PeptideBuilder.initialize_res(geo) # Access the structure model = structure[0] # First model chain = model["A"] # Chain A residue = list(chain)[0] # First residue print(f"Residue: {residue.get_resname()}") # GLY ``` -------------------------------- ### Get Amino Acid Geometry Source: https://context7.com/clauswilke/peptidebuilder/llms.txt Retrieve and customize default bond lengths, angles, and dihedral angles for specific amino acids. ```python from PeptideBuilder import Geometry # Get geometry for Alanine ala_geo = Geometry.geometry("A") print(f"CA-N length: {ala_geo.CA_N_length}") # 1.46 Angstroms print(f"CA-C length: {ala_geo.CA_C_length}") # 1.52 Angstroms print(f"N-CA-C angle: {ala_geo.N_CA_C_angle}") # 111.068 degrees print(f"phi: {ala_geo.phi}") # -120 degrees (default) print(f"psi_im1: {ala_geo.psi_im1}") # 140 degrees (default) # Customize backbone angles for alpha-helix conformation helix_geo = Geometry.geometry("G") helix_geo.phi = -60 helix_geo.psi_im1 = -40 print(f"Modified phi: {helix_geo.phi}") # -60 degrees ``` -------------------------------- ### Build and Save an Alpha-Helix Peptide Source: https://context7.com/clauswilke/peptidebuilder/llms.txt Demonstrates building an alpha-helix peptide using geometry objects for precise control and saving the structure to a PDB file. It also includes verification of the sequence and analysis of the loaded structure. ```python from PeptideBuilder import Geometry import PeptideBuilder from Bio.PDB import PDBIO, PDBParser from Bio.PDB.Polypeptide import PPBuilder # Build an alpha-helix peptide sequence = "AAAAAKAAAA" # 10 residues with lysine in middle # Method 1: Using geometry objects for precise control geo = Geometry.geometry(sequence[0]) geo.phi = -57 geo.psi_im1 = -47 structure = PeptideBuilder.initialize_res(geo) for aa in sequence[1:]: geo = Geometry.geometry(aa) geo.phi = -57 geo.psi_im1 = -47 PeptideBuilder.add_residue(structure, geo) # Add terminal oxygen PeptideBuilder.add_terminal_OXT(structure) # Save structure io = PDBIO() io.set_structure(structure) io.save("alpha_helix.pdb") # Verify the sequence ppb = PPBuilder() for pp in ppb.build_peptides(structure): print(f"Sequence: {pp.get_sequence()}") # AAAAAKAAAA # Read back and analyze parser = PDBParser(QUIET=True) loaded = parser.get_structure("helix", "alpha_helix.pdb") for model in loaded: for chain in model: print(f"Chain {chain.id}: {len(list(chain))}") ``` -------------------------------- ### Access Amino Acid Geometry Classes Source: https://context7.com/clauswilke/peptidebuilder/llms.txt Demonstrates how to access specific amino acid geometry classes and retrieve default bond lengths, angles, and dihedral parameters. ```python from PeptideBuilder import Geometry # Access specific geometry classes directly gly = Geometry.GlyGeo() ala = Geometry.AlaGeo() phe = Geometry.PheGeo() # Print all geometric parameters print(gly) # Shows all bond lengths and angles # Common backbone parameters (all amino acids) print(f"Peptide bond length: {ala.peptide_bond}") # 1.33 A print(f"CA-C-N angle: {ala.CA_C_N_angle}") # 116.64 degrees print(f"C-N-CA angle: {ala.C_N_CA_angle}") # 121.38 degrees print(f"C=O length: {ala.C_O_length}") # 1.23 A # Side chain parameters (amino acid specific) print(f"Ala CA-CB length: {ala.CA_CB_length}") # 1.52 A print(f"Phe CB-CG length: {phe.CB_CG_length}") # 1.50 A ``` -------------------------------- ### Build Extended Structure Source: https://context7.com/clauswilke/peptidebuilder/llms.txt Generate a complete peptide structure in an extended conformation from a sequence and save it to a PDB file. ```python import PeptideBuilder from Bio.PDB import PDBIO # Build a 10-residue peptide structure = PeptideBuilder.make_extended_structure("ACDEFGHIKL") # Build a longer sequence sequence = "MVLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSFPTTKTYFPHFDLSH" structure = PeptideBuilder.make_extended_structure(sequence) # Save to PDB file io = PDBIO() io.set_structure(structure) io.save("extended_peptide.pdb") ``` -------------------------------- ### Build Peptide from Geometry Objects Source: https://context7.com/clauswilke/peptidebuilder/llms.txt Constructs a peptide structure by providing a list of pre-configured Geometry objects, allowing for fine-grained control over individual residue parameters. ```python import PeptideBuilder from PeptideBuilder import Geometry from Bio.PDB import PDBIO # Create geometry objects with custom parameters geos = [] for i, aa in enumerate("GAVLIFYWM"): geo = Geometry.geometry(aa) geo.phi = -60 + i * 2 # Gradually change phi geo.psi_im1 = -45 - i # Gradually change psi geos.append(geo) structure = PeptideBuilder.make_structure_from_geos(geos) # Example: Build with specific rotamers geos = [] for aa in "AAALLL": geo = Geometry.geometry(aa) geo.phi = -60 geo.psi_im1 = -45 if hasattr(geo, 'inputRotamers'): geo.inputRotamers([-60, 180, 60]) # Set side chain rotamers geos.append(geo) structure = PeptideBuilder.make_structure_from_geos(geos) io = PDBIO() io.set_structure(structure) io.save("from_geos.pdb") ``` -------------------------------- ### Build Peptide with Specified Backbone Angles Source: https://context7.com/clauswilke/peptidebuilder/llms.txt Constructs a peptide structure using lists of phi, psi, and optionally omega dihedral angles. The first residue uses default angles, so lists should contain n-1 values for a sequence of length n. ```python import PeptideBuilder from Bio.PDB import PDBIO # Build a helix with specified angles sequence = "AAAAAAAAAAAA" # 12 alanines phi_angles = [-60] * 11 # 11 phi angles (for residues 2-12) psi_angles = [-45] * 11 # 11 psi angles structure = PeptideBuilder.make_structure(sequence, phi_angles, psi_angles) # Build with varying backbone angles (transition helix to sheet) sequence = "GAVLIFYWMCST" phi_list = [-60, -60, -60, -60, -60, -120, -120, -120, -120, -120, -120] psi_list = [-45, -45, -45, -45, -45, 140, 140, 140, 140, 140, 140] structure = PeptideBuilder.make_structure(sequence, phi_list, psi_list) # Include omega angles (cis-proline example) sequence = "AGPGAG" phi_list = [-60, -60, -60, -60, -60] psi_list = [-45, -45, -45, -45, -45] omega_list = [180, 180, 0, 180, 180] # cis peptide bond before proline structure = PeptideBuilder.make_structure(sequence, phi_list, psi_list, omega_list) io = PDBIO() io.set_structure(structure) io.save("custom_backbone.pdb") ``` -------------------------------- ### Set Side Chain Rotamers Source: https://context7.com/clauswilke/peptidebuilder/llms.txt Configures side chain conformations using the inputRotamers method on geometry objects. The number of required angles depends on the specific amino acid. ```python from PeptideBuilder import Geometry import PeptideBuilder from Bio.PDB import PDBIO # Serine: 1 rotamer (chi1) ser = Geometry.SerGeo() ser.inputRotamers([-60]) # gauche- conformation # Leucine: 3 rotamers (chi1, chi2_1, chi2_2) leu = Geometry.LeuGeo() leu.inputRotamers([180, 60, -60]) # Arginine: 6 rotamers for the long side chain arg = Geometry.ArgGeo() arg.inputRotamers([-60, 180, 180, 180, 0, 180]) # Build structure with custom rotamers geo = Geometry.PheGeo() geo.phi = -60 geo.psi_im1 = -45 geo.inputRotamers([-60, 90]) # chi1, chi2 for aromatic ring structure = PeptideBuilder.initialize_res(geo) io = PDBIO() io.set_structure(structure) io.save("phe_rotamer.pdb") ``` -------------------------------- ### Generate Random Rotamers for Amino Acids Source: https://context7.com/clauswilke/peptidebuilder/llms.txt Generates random side chain conformations for amino acids that support this feature. Useful for exploring conformational space. ```python from PeptideBuilder import Geometry import PeptideBuilder # Generate random rotamers for supported amino acids leu = Geometry.LeuGeo() leu.generateRandomRotamers() print(f"Random Leu chi1: {leu.N_CA_CB_CG_diangle}") arg = Geometry.ArgGeo() arg.generateRandomRotamers() glu = Geometry.GluGeo() glu.generateRandomRotamers() met = Geometry.MetGeo() met.generateRandomRotamers() # Build structure with random conformations geos = [] for _ in range(10): geo = Geometry.LeuGeo() geo.phi = -60 geo.psi_im1 = -45 geo.generateRandomRotamers() geos.append(geo) structure = PeptideBuilder.make_structure_from_geos(geos) ``` -------------------------------- ### Add Residue to Structure Source: https://context7.com/clauswilke/peptidebuilder/llms.txt Append amino acid residues to an existing structure using either default or custom geometric parameters. ```python import PeptideBuilder from PeptideBuilder import Geometry # Build a short peptide with default extended conformation structure = PeptideBuilder.initialize_res("A") PeptideBuilder.add_residue(structure, "G") PeptideBuilder.add_residue(structure, "V") PeptideBuilder.add_residue(structure, "L") # Build an alpha-helix by specifying backbone angles structure = PeptideBuilder.initialize_res("A") for aa in "GAVLI": PeptideBuilder.add_residue(structure, aa, phi=-60, psi_im1=-40) # Build with custom geometry objects for fine control structure = PeptideBuilder.initialize_res("M") for aa in "YHELIX": geo = Geometry.geometry(aa) geo.phi = -57 geo.psi_im1 = -47 geo.omega = 180.0 PeptideBuilder.add_residue(structure, geo) # The omega angle must be >= -360 to be applied (default: 180) structure = PeptideBuilder.initialize_res("P") PeptideBuilder.add_residue(structure, "G", phi=-60, psi_im1=-40, omega=175) ``` -------------------------------- ### Add Terminal Oxygen Atom Source: https://context7.com/clauswilke/peptidebuilder/llms.txt Appends a terminal oxygen atom (OXT) to the C-terminus of a peptide structure. This should be performed after the full chain has been constructed. ```python import PeptideBuilder from Bio.PDB import PDBIO # Build complete peptide with terminal oxygen structure = PeptideBuilder.make_extended_structure("ACDEFGHIKLMNPQRSTVWY") PeptideBuilder.add_terminal_OXT(structure) # Custom C-OXT bond length (default is 1.23 Angstroms) structure = PeptideBuilder.make_extended_structure("GAVLI") PeptideBuilder.add_terminal_OXT(structure, C_OXT_length=1.25) io = PDBIO() io.set_structure(structure) io.save("complete_peptide.pdb") ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.