The example below builds a small model from primary sequence alone, and makes it alpha-helical.

# Example for Model.build_sequence(), secondary_structure.Alpha()

from modeller import *
from modeller.optimizers import ConjugateGradients

# Set up environment
e = Environ()'${LIB}/top_heav.lib')'${LIB}/par.lib')

# Build an extended chain model from primary sequence, and write it out
m = Model(e)

# Make stereochemical restraints on all atoms
allatoms = Selection(m)
m.restraints.make(allatoms, restraint_type='STEREO', spline_on_site=False)

# Constrain all residues to be alpha-helical
# (Could also use m.residue_range() rather than m.residues here.)

# Get an optimized structure with CG, and write it out
cg = ConjugateGradients()
cg.optimize(allatoms, max_iterations=100)