Rosetta  2015.31
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions
molfile_to_params Namespace Reference

Classes

class  PreformattedDescFormatter
 

Functions

def any
 
def all
 
def memoize
 
def mark_fragments
 
def add_fields_to_atoms
 
def add_fields_to_bonds
 
def find_virtual_atoms
 
def check_bond_count
 
def check_aromaticity
 
def check_hydrogens
 
def assign_rosetta_types
 
def assign_mm_types
 
def assign_centroid_types
 
def setup_amino_acid
 
def assign_partial_charges
 
def assign_rotatable_bonds
 
def assign_rigid_ids
 
def fragment_ligand
 
def build_fragment_trees
 
def assign_internal_coords
 
def calc_internal_coords
 
def choose_neighbor_atom
 
def floyd_warshall
 
def dijkstra
 
def write_ligand_kinemage
 
def write_param_file
 
def write_ligand_pdb
 
def write_fragment_mol2
 
def write_all_files
 
def main
 

Function Documentation

def molfile_to_params.add_fields_to_atoms (   atoms)
Adds a bunch of member variable placeholders that we use.

Referenced by main().

def molfile_to_params.add_fields_to_bonds (   bonds)
Adds a bunch of member variable placeholders that we use.

Referenced by main().

def molfile_to_params.all (   itr)
def molfile_to_params.any (   itr)

Referenced by assign_rosetta_types().

def molfile_to_params.assign_centroid_types (   atoms)
Uses Nbb for donors, OCbb for acceptors, and CAbb for everything else (but H)

Referenced by main().

def molfile_to_params.assign_internal_coords (   molfile)
Sets up stubs/input_stubs and d,theta,phi for all atoms.

References calc_internal_coords(), and ObjexxFCL.len().

Referenced by main().

def molfile_to_params.assign_mm_types (   atoms,
  mm_as_virt 
)
For now, just fills in dummy values.

Referenced by main().

def molfile_to_params.assign_partial_charges (   atoms,
  net_charge = 0.0,
  recharge = False 
)
Assigns Rosetta standard partial charges, then
corrects them so they sum to the desired net charge.
Correction is distributed equally among all atoms.

If non-zero partial charges were already assigned, no change is made.

References ObjexxFCL.abs(), ObjexxFCL.len(), and sum().

Referenced by main().

def molfile_to_params.assign_rigid_ids (   atoms)
Groups atoms that are connected in rigid units, i.e. no rotatable bonds.

Referenced by main().

def molfile_to_params.assign_rosetta_types (   atoms)
Assigns Rosetta atom types.
Based on Rosetta++ ligand_ns.cc set_rosetta_atom_types().
This has been tested against the assignments produced by (Jens? Molecule.exe?)
for the Meiler and Baker 2006 cross docking test set;
cases where they disagree are usually due to weird
bond orders (probably mistakes) in the .mol files.

As I look through these rules, I see that they contain an ad-hoc attempt
at aromaticity perception.  Not sure how general this is, though.

References all(), any(), basic::options::OptionKeys::stepwise.enumerate, and sum().

Referenced by main().

def molfile_to_params.assign_rotatable_bonds (   bonds)
Rotatable bonds are single bonds outside of rings
with heavy atoms attached to both ends (i.e. not methyls) or non-C with one H.

References ObjexxFCL.len().

Referenced by main().

def molfile_to_params.build_fragment_trees (   molfile,
  options 
)
Assigns a root atom for each fragment and parents and children.

References choose_neighbor_atom(), and ObjexxFCL.len().

Referenced by main().

def molfile_to_params.calc_internal_coords (   child,
  input_stub1,
  input_stub2,
  input_stub3 
)
Returns (d, theta, phi) for a point given it's three input stub points.

Referenced by assign_internal_coords(), and write_param_file().

def molfile_to_params.check_aromaticity (   bonds)
Safety check for Kekule structures (alternating single/double bonds)
rather than bonds described explicitly as aromatic.

References ObjexxFCL.len().

Referenced by main().

def molfile_to_params.check_bond_count (   atoms)
Safety check for structures with stupid numbers of bonds to atoms, at Florian's request.

References ObjexxFCL.len(), and sum().

Referenced by main().

def molfile_to_params.check_hydrogens (   atoms)
Safety check for from PDB structures.
If you convert an X-ray structure of a ligand to a mol file, chances are it won't have hydrogens added.
This will probably mess up the parameters.

Referenced by main().

def molfile_to_params.choose_neighbor_atom (   molfile,
  frag_id,
  nbr_atom = None 
)
You may specify the desired nbr_atom manually if you just want to compute the nbr_dist.

References rosetta_py.utility.rankorder.argmin(), basic::options::OptionKeys::stepwise.enumerate, floyd_warshall(), ObjexxFCL.len(), and max().

Referenced by build_fragment_trees(), write_ligand_kinemage(), and write_param_file().

def molfile_to_params.dijkstra (   start,
  nodes,
  nbr,
  dist 
)
Computes the shortest path from start node to all others.
start - the node to start from
nodes - the set of all nodes (includes start)
nbr() - returns a list of a node's neighbors, nbr(n) = [n's neighbors]
dist() - returns distance between two nodes that are neighbors, dist(n,m)
Returns array of shortest distances to start in same order as input nodes.

References rosetta_py.utility.rankorder.argmin(), coordlib.dist(), and ObjexxFCL.len().

def molfile_to_params.find_virtual_atoms (   atoms)
Atoms whose names start with "V" are virtual, used in enzyme design, etc.

Referenced by main().

def molfile_to_params.floyd_warshall (   nodes,
  nbr,
  dist 
)
Computes the shortest path from each node to all others.
nodes - the set of all nodes
nbr() - returns a list of a node's neighbors, nbr(n) = [n's neighbors]
dist() - returns distance between two nodes that are neighbors, dist(n,m)
Returns 2D array of shortest distances in same order as input nodes.

References coordlib.dist(), ObjexxFCL.len(), and min().

Referenced by choose_neighbor_atom().

def molfile_to_params.fragment_ligand (   molfile)
Sets Atom.fragment_id, Atom.conn_bonds, and Bond.connection_id.
Returns number of fragments created, i.e. the largest valid fragment id.

References ObjexxFCL.len().

Referenced by main().

def molfile_to_params.main (   argv)
Converts a small molecule in an MDL Molfile with "M SPLT" and "M ROOT"
records into a series of .params residue definition files for Rosetta.
Also writes out the ligand conformation as PDB HETATMs.

If an SD file is given as input instead, the first entry is used for
generating topology / parameter files, and they all are used for
generating PDB-style coordinates in separate, numbered files.
These multiple files can optionally be concatenated into a single file,
which can then be specified with an additional PDB_ROTAMERS line in the
.params file to include the extra conformations as ligand rotamers.
Multiple models may also be supplied in MOL2 format, which does not support
M ROOT and M SPLT records but does allow for partial charges.
File type is deduced from the extension.

To divide a ligand into fragments by "breaking" bonds (optional):
M SPLT atom_no1 atom_no2

To specify a neighbor atom for a ligand fragment (optional):
M NBR atom_no

To specify a root atom for a ligand fragment (optional):
M ROOT atom_no

The "M" records (M SPLT, M NBR, M ROOT) can alternatively be specified in
a separate control file, which can be used with MOL2 format files.

Note that for ligands with multiple rotamers, Rosetta overlays the ligands
based on the neighbor atom (not the root atom), such that the position of the
neighbor atom and the orientation of the atoms bonded to the neighbor atom is
the same. When using ligand rotamers, it is recommended to confirm that the
neighbor atom falls in an appropriate position.

Expects that the input ligand has already had aromaticity "perceived",
i.e. that it contains aromatic bonds rather than alternating single and double
bonds (Kekule structure).

Optionally writes a kinemage graphics visualization of the atom tree,
neighbor atom selection, fragments, etc -- very helpful for debugging
and for visualizing exactly what was done to the ligand.

References add_fields_to_atoms(), add_fields_to_bonds(), assign_centroid_types(), assign_internal_coords(), assign_mm_types(), assign_partial_charges(), assign_rigid_ids(), assign_rosetta_types(), assign_rotatable_bonds(), build_fragment_trees(), check_aromaticity(), check_bond_count(), check_hydrogens(), rosetta_py.io.mdl_molfile.find_rings(), find_virtual_atoms(), fragment_ligand(), rosetta_py.io.mdl_molfile.gz_open(), ObjexxFCL.len(), basic::options::OptionKeys::in::file.list, mark_fragments(), rosetta_py.io.mdl_molfile.pdb_pad_atom_name(), rosetta_py.io.mdl_molfile.read_mdl_sdf(), rosetta_py.io.mdl_molfile.read_tripos_mol2(), setup_amino_acid(), rosetta_py.io.mdl_molfile.strip_H(), rosetta_py.io.mdl_molfile.uniquify_atom_names(), and write_all_files().

Referenced by toolbox.load_ligand.molfile2params_quick().

def molfile_to_params.mark_fragments (   molfile)
def molfile_to_params.memoize (   f)

References get_pdb.f.

def molfile_to_params.setup_amino_acid (   atoms,
  molfiles 
)
Tries to reconfigure the input as a (modified) amino acid type,
following the implicit Rosetta rules for these residues.

References all(), extract_scores_and_constraints.join, and rosetta_py.utility.rankorder.order().

Referenced by main().

def molfile_to_params.write_all_files (   m,
  molfiles,
  num_frags,
  options,
  suffix = "" 
)
def molfile_to_params.write_fragment_mol2 (   f,
  molfile,
  frag_id 
)
Writes a .mol2 file consisting only of atoms from a particular fragment.

References rosetta_py.io.mdl_molfile.write_tripos_mol2().

Referenced by write_all_files().

def molfile_to_params.write_ligand_kinemage (   f,
  molfile 
)
def molfile_to_params.write_ligand_pdb (   f,
  molfile_tmpl,
  molfile_xyz,
  resname,
  ctr = None,
  chain_id = 'X' 
)
Writes a PDB file with a series of residues representing one ligand conformation.
The topology (atom names, fragment divisions, etc) are taken from molfile_tmpl,
while the actual XYZ coordinates are taken from molfile_xyz.
resname provides the first two characters of the residue name.
f may be a file name or file handle.

References rosetta_py.io.mdl_molfile.gz_open(), rosetta_py.io.mdl_molfile.index_atoms(), ObjexxFCL.len(), and basic::options::OptionKeys::in::file.list.

Referenced by write_all_files().

def molfile_to_params.write_param_file (   f,
  molfile,
  name,
  frag_id,
  base_confs,
  max_confs,
  amino_acid = None,
  long_names = False,
  conformer_file = "" 
)
Writes a Molfile object to a file.
f may be a file name or file handle.
base_confs is the number of heavy-atom conformations generated by e.g. Omega
max_confs is the maximum number of conformations desired after adding proton rotation
    The total number of confs may still be larger than max_confs,
    but at least we'll skip -ex# extra sampling of proton chis.
conformer_file is either empty, or the name of the file which contains the conformers

References calc_internal_coords(), choose_neighbor_atom(), rosetta_py.io.mdl_molfile.gz_open(), ObjexxFCL.len(), and basic::options::OptionKeys::in::file.list.

Referenced by write_all_files().