Package schrodinger :: Package application :: Package matsci :: Package genetic_optimization :: Module genetic_optimization
[hide private]
[frames] | no frames]

Module genetic_optimization

Classes and functions for the genetic optimization module.

Copyright Schrodinger, LLC. All rights reserved.

Classes [hide private]
  Property
Manage a property to be used in a genetic optimization.
  StructureGenome
Manage a genome.
  Initialize
  Crossover
  Mutation
  EvolveCallbacks
Class to manage evolve callbacks.
  Terminators
Class to manage the termination of the genetic optimization.
  Failure
Manage a failure.
  CheckInput
Manage checking user input.
  GeneticOptimization
Manage the genetic optimization.
  Evaluator
Manage the evaluators.
Functions [hide private]
 
_pickle_method(method)
 
_unpickle_method(func_name, obj, cls)
 
set_title_to_stoichiometry(astructure)
Set the structure title to be the stoichiometry of the structure.
int
get_num_simple_bonds(astructure)
Return the number of simple bonds in the provided structure.
int, int, float
max_pair_vdw_distance(astructure)
Find the largest atom-atom VDW distance in a structure.
schrodinger.structure.Structure
combine_two_structures(astructure, bstructure, offset=10.0)
Combine two structure objects into a single structure object using somewhat arbitrary placement.
list
get_element_mutator_indicies(astructure)
Return a list of atom indicies that can be mutated by the elemental mutator.
list
get_isoelectronic_mutator_indicies(astructure)
Return a list of atom indicies that can be mutated by the isoelectronic mutator.
str
get_loggable_float(afloat, num_decimal='%.2f', field_width=10)
Return a float as a string with the specified format.
str
get_history_file_name(input_file_name)
Get the history file name from the input file name.
list
apply_uniform_operator_weights(operators)
Set the operator weights uniformly.
Variables [hide private]
  __doc__ = ...
  _version = '$Revision 0.0 $'
  BOND_CROSSOVER = 'bond'
hash(x)
  CROSSOVER_CHOICES = ['bond']
  DEFAULT_CROSSOVERS = ['bond']
  ELEMENTAL_MUTATOR = 'elemental'
  FRAGMENT_MUTATOR = 'fragment'
  ISOELECTRONIC_MUTATOR = 'isoelectronic'
  MUTATOR_CHOICES = ['elemental', 'fragment', 'isoelectronic']
  DEFAULT_MUTATORS = ['fragment', 'isoelectronic']
  GENERATIONS = 25
  POPULATION = 10
  CROSSOVER_RATE = 90.0
  MUTATION_RATE = 2.0
  RANK_SELECTION = 'rank'
  ROULETTE_WHEEL_SELECTION = 'roulette_wheel'
  TOURNAMENT_SELECTION = 'tournament'
  TOURNAMENT_SELECTION_WITH_ROULETTE = 'tournament_with_roulette'
  UNIFORM_SELECTION = 'uniform'
  SELECTION_DICT = {RANK_SELECTION: Selectors.GRankSelector, ROU...
  SELECTION_CHOICES = ['rank', 'roulette_wheel', 'tournament', '...
  DEFAULT_SELECTION = 'roulette_wheel'
  TOURNAMENT_SIZE = 2
  UNPRODUCTIVE_TERM = 'unproductive'
  FIRST_PROPERTY_TERM = 'first_property'
  ALL_PROPERTIES_TERM = 'all_properties'
  MAX_GENERATIONS_TERM = 'max_generations'
  TERM_CHOICES = ['unproductive', 'first_property', 'all_propert...
  DEFAULT_TERMS = ['unproductive', 'all_properties']
  NUM_UNPRODUCTIVE = 10
  LINEAR_SCALING = 'linear'
  POWER_LAW_SCALING = 'power_law'
  EXPONENTIAL_SCALING = 'exponential'
  SATURATED_SCALING = 'saturated'
  SIGMA_TRUNCATION_SCALING = 'sigma_truncation'
  BOLTZMANN_SCALING = 'boltzmann'
  SCALING_DICT = {LINEAR_SCALING: Scaling.LinearScaling, POWER_L...
  SCALING_CHOICES = ['linear', 'power_law', 'exponential', 'satu...
  DEFAULT_SCALING = 'sigma_truncation'
  ALLOWS_NEGATIVE_SCORES = ['exponential', 'saturated', 'sigma_t...
  ELITISM = 1
  RANDOM_SEED = None
hash(x)
  NO_MINIMIZE = False
hash(x)
  NUM_RET_STRUCTURES = 1
  MOLECULE_HISTORY = False
hash(x)
  MOLECULE_HISTORY_FILE = 'history.mae'
  INDIVIDUAL_KEY = 'i_matsci_individual_index'
  GENERATION_KEY = 'i_matsci_generation'
  RAW_SCORE_KEY = 'r_matsci_raw_score'
  FIT_SCORE_KEY = 'r_matsci_fit_score'
  LOCALHOST = 'localhost'
hash(x)
  TPP_GA = 1
  TPP_EVAL = 1
  TPP_STR = '-TPP'
  DEFAULT_EVAL_KWARGS = {}
  ORGANIC = 'organic'
  N_HETEROCYCLES = 'N-heterocycles'
  O_HETEROCYCLES = 'O-heterocycles'
  S_HETEROCYCLES = 'S-heterocycles'
  MIXED_HETEROCYCLES = 'Mixed-heterocycles'
  COMBIGLIDE_DEFAULT = 'combiglide_default'
  OPTOELECTRONICS = 'optoelectronics'
  ALL = 'all'
  MMSHARE_MAIN_DATA = u'/nfs/builds/objects/OB/2014-3/Linux-x86_...
  FRAGMENT_LIBS = {'Mixed-heterocycles': u'/nfs/builds/objects/O...
  FRAGMENT_LIBS_DEFAULT = ['all']
  ENTRY_NAME_KEY = 's_m_entry_name'
  GROW_NAME_KEY = 's_m_grow_name'
  PDB_ATOM_NAME_KEY = 's_m_pdb_atom_name'
  PDB_RES_NAME_KEY = 's_m_pdb_residue_name'
  CROSSOVER_PARENTS_KEY = 's_matsci_crossover_parents'
  CROSSOVER_APPLIED_KEY = 's_matsci_crossover_applied'
  MUTATION_PARENT_KEY = 's_matsci_mutation_parent'
  MUTATION_APPLIED_KEY = 's_matsci_mutation_applied'
  EVALUATOR_JOBS_DIR = 'evaluator_jobs'
  GENER_SUBDIR = 'generation_'
  NUM_DECIMAL = '%.2f'
  FIELD_WIDTH = 10
  MAIN_ELEMENT_COLUMNS = [['C', 'Si'], ['N', 'P'], ['O', 'S'], [...
  TRANS_METAL_ELEMENT_COLUMNS = [['Ti', 'Zr', 'Hf'], ['V', 'Nb',...
  PERIODIC_TABLE_COLUMNS = [['C', 'Si'], ['N', 'P'], ['O', 'S'],...
  INFINITE_SCORE = 1000000000
  GOOD_SCORE = 10000000
  BAD_SCORE = -10000000
  FRAG_MAX_UNPRODUCTIVE = 3
hash(x)
  __package__ = 'schrodinger.application.matsci.genetic_optimiza...
Function Details [hide private]

set_title_to_stoichiometry(astructure)

 

Set the structure title to be the stoichiometry of the structure.

Parameters:
  • astructure (schrodinger.structure.Structure) - the structure

get_num_simple_bonds(astructure)

 

Return the number of simple bonds in the provided structure. The definition of a simple bond follows from that used in the reaction channel module and is an acyclic single order bond that may involve a hydrogen atom.

Parameters:
  • astructure (schrodinger.structure.Structure) - the structure for which to get the number of simple bonds
Returns: int
the number of simple bonds

max_pair_vdw_distance(astructure)

 

Find the largest atom-atom VDW distance in a structure.

Parameters:
  • astructure (schrodinger.structure.Structure) - the structure
Returns: int, int, float
atom1, atom2, maxdistance, atom1 and atom2 are the first and second atom indicies and maxdistance is the largest distance. If input structure is a single atom then just return that atom index twice followed by twice its VDW radius, i.e. the atomic diameter.

combine_two_structures(astructure, bstructure, offset=10.0)

 

Combine two structure objects into a single structure object using somewhat arbitrary placement.

Parameters:
  • astructure (schrodinger.structure.Structure) - the first of the structures to be combined
  • bstructure (schrodinger.structure.Structure) - the second of the structures to be combined
  • offset (float) - the final distance between the structures will be the sum of the molecular VDW radii plus this offset in Angstrom
Returns: schrodinger.structure.Structure
the combined structure object

get_element_mutator_indicies(astructure)

 

Return a list of atom indicies that can be mutated by the elemental mutator.

Parameters:
  • astructure (schrodinger.structure.Structure) - the structure to be mutated
Returns: list
mutatable indicies

get_isoelectronic_mutator_indicies(astructure)

 

Return a list of atom indicies that can be mutated by the isoelectronic mutator.

Parameters:
  • astructure (schrodinger.structure.Structure) - the structure to be mutated
Returns: list
mutatable indicies

get_loggable_float(afloat, num_decimal='%.2f', field_width=10)

 

Return a float as a string with the specified format.

Parameters:
  • afloat (float) - a float to convert to a string
  • num_decimal (str) - the format of the string representation
  • field_width (int) - the field width of the final string
Returns: str
the float as a string

get_history_file_name(input_file_name)

 

Get the history file name from the input file name.

Parameters:
  • input_file_name (str) - name of input file
Returns: str
history_file_name, name of history file

apply_uniform_operator_weights(operators)

 

Set the operator weights uniformly.

Parameters:
  • operators (list) - a list of two-element tuples, each tuple contains first an operator function and second a weight
Returns: list
list of two-element tuples of operators and uniform weights

Variables Details [hide private]

__doc__

Value:
"""
Classes and functions for the genetic optimization module.

Copyright Schrodinger, LLC.  All rights reserved."""

SELECTION_DICT

Value:
{RANK_SELECTION: Selectors.GRankSelector, ROULETTE_WHEEL_SELECTION: Se\
lectors.GRouletteWheel, TOURNAMENT_SELECTION: Selectors.GTournamentSel\
ectorAlternative, TOURNAMENT_SELECTION_WITH_ROULETTE: Selectors.GTourn\
amentSelector, UNIFORM_SELECTION: Selectors.GUniformSelector}

SELECTION_CHOICES

Value:
['rank',
 'roulette_wheel',
 'tournament',
 'tournament_with_roulette',
 'uniform']

TERM_CHOICES

Value:
['unproductive',
 'first_property',
 'all_properties',
 'max_generations']

SCALING_DICT

Value:
{LINEAR_SCALING: Scaling.LinearScaling, POWER_LAW_SCALING: Scaling.Pow\
erLawScaling, EXPONENTIAL_SCALING: Scaling.ExponentialScaling, SATURAT\
ED_SCALING: Scaling.SaturatedScaling, SIGMA_TRUNCATION_SCALING: Scalin\
g.SigmaTruncScaling, BOLTZMANN_SCALING: Scaling.BoltzmannScaling}

SCALING_CHOICES

Value:
['linear',
 'power_law',
 'exponential',
 'saturated',
 'sigma_truncation',
 'boltzmann']

ALLOWS_NEGATIVE_SCORES

Value:
['exponential', 'saturated', 'sigma_truncation', 'boltzmann']

MMSHARE_MAIN_DATA

Value:
u'/nfs/builds/objects/OB/2014-3/Linux-x86_64/build09/mmshare-v2.7/data\
'

FRAGMENT_LIBS

Value:
{'Mixed-heterocycles': u'/nfs/builds/objects/OB/2014-3/Linux-x86_64/bu\
ild09/mmshare-v2.7/data/res/Mixed-heterocycles.bld',
 'N-heterocycles': u'/nfs/builds/objects/OB/2014-3/Linux-x86_64/build0\
9/mmshare-v2.7/data/res/N-heterocycles.bld',
 'O-heterocycles': u'/nfs/builds/objects/OB/2014-3/Linux-x86_64/build0\
9/mmshare-v2.7/data/res/O-heterocycles.bld',
 'S-heterocycles': u'/nfs/builds/objects/OB/2014-3/Linux-x86_64/build0\
9/mmshare-v2.7/data/res/S-heterocycles.bld',
...

MAIN_ELEMENT_COLUMNS

Value:
[['C', 'Si'], ['N', 'P'], ['O', 'S'], ['H', 'F', 'Cl', 'Br', 'I']]

TRANS_METAL_ELEMENT_COLUMNS

Value:
[['Ti', 'Zr', 'Hf'],
 ['V', 'Nb', 'Ta'],
 ['Cr', 'Mo', 'W'],
 ['Mn', 'Tc', 'Re'],
 ['Fe', 'Ru', 'Os'],
 ['Co', 'Rh', 'Ir'],
 ['Ni', 'Pd', 'Pt'],
 ['Cu', 'Ag', 'Au'],
...

PERIODIC_TABLE_COLUMNS

Value:
[['C', 'Si'],
 ['N', 'P'],
 ['O', 'S'],
 ['H', 'F', 'Cl', 'Br', 'I'],
 ['Ti', 'Zr', 'Hf'],
 ['V', 'Nb', 'Ta'],
 ['Cr', 'Mo', 'W'],
 ['Mn', 'Tc', 'Re'],
...

__package__

Value:
'schrodinger.application.matsci.genetic_optimization'