Skip to content

Instantly share code, notes, and snippets.

@andersx
Last active January 2, 2016 00:09
Show Gist options
  • Select an option

  • Save andersx/8221316 to your computer and use it in GitHub Desktop.

Select an option

Save andersx/8221316 to your computer and use it in GitHub Desktop.
make scan
from fragbuilder import Peptide
# Create a peptide object with the sequence
# glycine-glycine-glycine.
sequence = "GGG"
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])
# Print the energy of the peptide in this state.
# This is of course just an example.
print pep.get_energy()
# Save each conformation.
pep.write_xyz("pep_%04i_%04i.xyz" % (phi, psi))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment