Product Specific Modules¶
MacroModel¶
The macromodel package helps to set up and run MacroModel tasks. To use this module productively, you should be familiar with the MacroModel Reference Manual. As a starting point, see the documentation for the ComUtil and SbcUtil classes.
A few examples of simplified scripts follow.
Set up and run a Monte Carlo multiple minimum conformation search job with non-default options:
import sys
import schrodinger.application.macromodel.utils as mmodutils
from schrodinger.job import jobcontrol
mcu = mmodutils.ComUtil(ffld='mmffs')
# Use extended torsion sampling.
mcu.AUTO[8] = 3
# Write the com file for a Monte Carlo multiple minimum conformation
# search. (To actually run this script, you need to set
# input_structure_file.)
com_file = mcu.mcmm(input_structure_file)
cmd_args = mcu.getLaunchCommand(com_file)
job = jobcontrol.launch_job(cmd_args)
job.wait()
print(f"MCMM job status: {job.Status}")
mcmm_output_file = job.StructureOutputFile
Set up and run a geometry minimization with restraints defined by an Atom
Selection Language expression. This is specified within a MacroModel
substructure file with the ASL2
code.
import schrodinger.application.macromodel.utils as mmodutils
from schrodinger.job import jobcontrol
mcu = mmodutils.ComUtil(subs=True)
# Write the com file for a geometry optimization.
# (To run this script, you should set input_structure_file. For the
# script to do something interesting, the input structure file should
# have more than one molecule. :-)
com_file = mcu.mini(input_structure_file)
# Set up the MacroModel substructure file.
sbu = mmodutils.SbcUtil()
# Specify the force constant for Cartesian restraints.
sbu.ASL2[1] = 200
# Specify the ASL identifying the restrained atoms.
sbu.ASL2[2] = 'mol.n 1'
sbu_args = [com_file, 'ASL2']
sbc_file = sbu.writeSbcFile(sbu_args)
cmd_args = mcu.getLaunchCommand(com_file)
job = jobcontrol.launch_job(cmd_args)
job.wait()
print(f"MINI job status: {job.Status}")
mini_output_file = job.StructureOutputFile
Set up and run a systematic pseudo-Monte Carlo conformation search,
dynamically assigning restraints to a ligand core (SUBS
and FXAT
):
import schrodinger.application.macromodel.utils as mmodutils
from schrodinger.structutils import analyze
from schrodinger import structure
from schrodinger.job import jobcontrol
mcu = mmodutils.ComUtil(subs=True)
# Write the com file for a systematic pseudo-Monte Carlo multiple
# minimum conformation search.
com_file = mcu.spmc(input_structure_file)
# Find the atoms to be restrained via ASL and SMARTS; anything in a
# 6-membered ring.
st = next(structure.StructureReader(input_structure_file))
core_pattern = 'SMARTS. "r6"'
core_atoms = analyze.evaluate_asl(st, f"withinbonds 1 {core_pattern}")
attachment_atoms = analyze.evaluate_asl(st, f"not withinbonds 1 {core_pattern}")
# Set up and write the substructure file with the restraints.
sbu = mmodutils.SbcUtil()
sbc_args = [com_file]
sbc_args.extend(sbu.setSubs(attachment_atoms))
sbc_args.extend(sbu.setFixed(core_atoms))
sbu.writeSbcFile(sbc_args)
cmd_args = mcu.getLaunchCommand(com_file)
job = jobcontrol.launch_job(cmd_args)
job.wait()
print(f"SPMC job status: {job.Status}")
spmc_output_file = job.StructureOutputFile
Prime¶
The prime package contains modules for reading and writing Prime input files and preparing structure for use with Prime.
The protein package contains other modules for protein-related tasks, such as:
- The assignment module for optimizing hydroxyl, thiol and water orientiations, Chi-flips of asparagine, glutamine and histidine, and protonation states of aspartic acid, glutamic acid, and histidine.
- The captermini module for capping uncapped terminal residues.
- The findhets module for finding het (non-protein) compounds in structures.
- The rotamers module provides a rotamer library that can be applied to protein sidechains.
- The
adjust_residue_numbering_panel.py
script in $SCHRODINGER/mmshare-vX.Y/python/common
contains an example of protein structure alignment. The script also renumbers protein residues based on the alignment.
In addition, the schrodinger.structutils.build module contains a useful
mutate
function.
Here is an example of residue mutation and rotamer-library sampling:
from schrodinger.structutils import build
from schrodinger.protein import rotamers
residue = st.residue[index_of_residue_to_mutate]
# Here, mut_type is the three-letter code for the new residue.
build.mutate(st, residue.atom[1], mut_type)
rotamer_lib = rotamers.Rotamers( st, residue.atom[1] )
for rotamer in rotamer_lib.rotamers:
rotamer.apply()
# Operate on the new structure - compute energy, analyze or write
# the structure.
The prepwizard module also contains useful functions for manipulating protein structures. For example, to fill missing loops in a protein structure, based on a FASTA file sequence:
import schrodinger.application.prepwizard as pw
filled_st = pw.fill_missing_loops(input_st, fasta_file, prime_jobname)