from fragbuilder import Peptide

# Create a peptide object with the sequence
# glycine-leucine-glycine.
sequence = "GLG"
pep = Peptide(sequence)

# Define a list of angles.
angles = range(-180, 180, 60)

# Double loop over phi/psi angles in the desired range.
for psi in angles:
    for phi in angles:

        # Set the second (leucine) residue to (phi, psi).
        pep.set_bb_angles(2, [phi, psi])

        # Save each conformation.
        pep.write_xyz("pep_%04i_%04i.xyz" % (phi, psi))




Exemple #2
0
from fragbuilder import Peptide

# Make a GLG peptide object
sequence = "GLG"
pep = Peptide(sequence, nterm="neutral", cterm="charged")

print "SMILES:  ", pep.get_smiles()
print "Charge:  ", pep.get_charge()
print "Length:  ", pep.get_length()
print "Sequence:", pep.get_sequence()

# Set [PHI, PSI] angles for residues 1, 2 and 3
pep.set_bb_angles(1, [ -156.3,  142.3])
pep.set_bb_angles(2, [   48.8,   42.3])
pep.set_bb_angles(3, [   81.3,    0.2])

# Set and read chi angles for residue 2
pep.set_chi_angles(2, [  -50.6, -75.1])
print pep.get_bb_angles(2)

# Sample (and set) backbone angles for residue 2
print pep.sample_bb_angles(2)
print pep.get_bb_angles(2)

# Sample (and set) chi angles for residue 2
print pep.sample_chi_angles(2)
print pep.get_chi_angles(2)

# Write files
pep.write_xyz("pep.xyz")
pep.write_pdb("pep.pdb", QUIET=False)
from __future__ import print_function
from fragbuilder import Peptide

# Make a GLG peptide object
sequence = "GLG"
pep = Peptide(sequence, nterm="neutral", cterm="charged")

print("SMILES:  ", pep.get_smiles())
print("Charge:  ", pep.get_charge())
print("Length:  ", pep.get_length())
print("Sequence:", pep.get_sequence())

# Set [PHI, PSI] angles for residues 1, 2 and 3
pep.set_bb_angles(1, [ -156.3,  142.3])
pep.set_bb_angles(2, [   48.8,   42.3])
pep.set_bb_angles(3, [   81.3,    0.2])

# Set and read chi angles for residue 2
pep.set_chi_angles(2, [  -50.6, -75.1])
print(pep.get_bb_angles(2))

# Sample (and set) backbone angles for residue 2
print(pep.sample_bb_angles(2))
print(pep.get_bb_angles(2))

# Sample (and set) chi angles for residue 2
print(pep.sample_chi_angles(2))
print(pep.get_chi_angles(2))

# Write files
pep.write_xyz("pep.xyz")
Exemple #4
0
# Loop over residue numbers
for i in pdb.get_residue_numbers():

    # Ignore first and last few residues as omega,
    # phi, or psi may be undefined.
    if (i < 3) or (i > n - 2):
        continue

    # Determine sequence of the three-residues
    # peptide model and make a Peptide object
    pep_seq = seq[i - 2:i + 1]
    pep = Peptide(pep_seq)

    print(i, pep_seq)

    # Loop over preceding, central, and following residue.
    for j in [-1, 0, 1]:

        # Read backbone and chi angles from pdb object
        bb = pdb.get_bb_angles(i + j)
        chi = pdb.get_chi_angles(i + j)

        # Set matching angles in the Peptide object
        pep.set_bb_angles(2 + j, bb)
        pep.set_chi_angles(2 + j, chi)

    # Short optimization and save xyz file
    pep.regularize()
    pep.write_xyz("pep_%04i.xyz" % (i))