schrodinger.application.matsci.clusterstruct module

Functions to aid in pulling dimers or clusters of nearest neighbors from a larger structure. Also functions for replacing atoms in neighboring molecules with partial charges for Jaguar calculations.

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.application.matsci.clusterstruct.Neighbor(home_atom, neighbor_atom, dsq)

Bases: tuple

__contains__(key, /)

Return key in self.

__len__()

Return len(self).

count(value, /)

Return number of occurrences of value.

dsq

Alias for field number 2

home_atom

Alias for field number 0

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

neighbor_atom

Alias for field number 1

class schrodinger.application.matsci.clusterstruct.SpeciesData(smiles=None, group_name=None)[source]

Bases: object

Tracks information about each chemically distinct molecule in a system

__init__(smiles=None, group_name=None)[source]

Create a SpeciesData instance

Parameters
  • smiles (str or None) – The unique smiles string for this species

  • group_name (str or None) – The user-facing name of the species

addMember(stindex, molnumber)[source]

Add a new member of this species

Parameters
  • stindex (int) – The structure index this member comes from. It is up to the calling code to generate and make use of this value.

  • molnumber (int) – The molecule number in the structure that is a member of this species

isMember(stindex, molnumber)[source]

Check if a molecule is a member of this species

Parameters
  • stindex (int) – The structure index this molecule comes from.

  • molnumber (int) – The molecule number that is being checked

addCharges(struct, prop='r_j_ESP_Charges')[source]

Add atomic charge information to this SpeciesData object (does not actually add the charges as properties to structures). The element and charge for every atom are stored as a tuple in the charges list. The element is stored to help ensure that any future structure the charges are applied to has the same atom ordering as struct.

Parameters
  • struct (schrodinger.structure.Structure) – The structure of this species. Used to determine the element of each atom and the charge of each atom.

  • prop (str) – The property name to use to obtain charges from each atom in struct

getSampleIndices()[source]

Get the st and mol indices of a sample

Return type

tuple

Returns

Tuple of (st_index, mol_index)

getSampleStructure(struct_iterator)[source]

Get a sample structure for this species

Parameters

struct_iterator (iterable) – An iterable of schrodinger.structure.Structure objects used to create this SpeciesData object

Return type

schrodinger.structure.Structure

Returns

A structure object representing a molecule of this species

schrodinger.application.matsci.clusterstruct.create_pbc(struct)[source]

Create an infrastructure PBC

Parameters

struct (schrodinger.structure.Structure) – The input structure, should have the Chorus box properties set

Return type

schrodinger.infra.structure.PBC

Returns

The infrastructure PBC created from the Chorus box properties

Raises

ValueError – If the Chorus box properties are not set

schrodinger.application.matsci.clusterstruct.create_distance_cell(struct, distance, pbc=None)[source]

Create an infrastructure Distance Cell. If struct has the Chorus box properties, the Distance Cell will be PBC-aware.

Parameters
  • struct (schrodinger.structure.Structure) – The input structure, may have the Chorus box properties

  • distance (float) – The cutoff for finding nearest neighbor atoms

  • pbc (schrodinger.infra.structure.PBC) – The infrastructure PBC for this structure. If not provided, an attempt will be made to create one from the Chorus box properties set on the structure - if this attempt fails, a non-PBC DistanceCell will be created.

Return type

schrodinger.infra.structure.DistanceCell, pbc

Returns

An infrastructure Distance Cell that accounts for the PBC, and the pbc used to create it. If no pbc was used, pbc=None. If the pbc was passed in, the same pbc is passed out unchanged. The distance cell has a size property that gives the distance it was created with.

schrodinger.application.matsci.clusterstruct.get_extracted_atom_index(atom_indexes, index)[source]

Get the index of the atom that has atom.index = index in a new structure that would be created by extracting the atoms in atom_indexes

Parameters
  • atom_indexes (list of int) – The atom indexes that will be extracted to form a new structure

  • index (int) – The atom index of the atom of interest

Return type

int or None

Returns

The new index of the atom in the extracted structure, or None if index is not found in atom_indexes

class schrodinger.application.matsci.clusterstruct.Dimer(stindex, mol1, mol2, neighbor_info, pbc=None)[source]

Bases: object

Class to hold and process a pair of neighboring molecules.

__init__(stindex, mol1, mol2, neighbor_info, pbc=None)[source]

Create a Dimer object

Parameters
  • stindex (int) – The index of the structure this dimer comes from

  • mol1 (int) – The molecule number in the structure of the first molecule in this dimer

  • mol2 (int) – The molecule number in the structure of the second molecule in this dimer

  • neighbor_info (Neighbor) – The Neighbor information for this dimer

  • pbc (schrodinger.infra.structure.PBC) – The PBC object to use for this dimer, if any

evaluateSpeciesCriterion(crit_species, crit, species)[source]

Check whether this dimer meets the species criterion - sets the meets_species_criterion property.

Parameters
  • crit_species (SpeciesData or None) – The species the criterion applies to. Use None if there are no criteria - the dimer will be marked as meeting all criteria

  • crit (str) – The criterion - should be one of the constants NO_MOLS, ONE_ONLY_MOL, AT_LEAST_ONE_MOL, TWO_MOLS

  • species (dict) – The dictionary containing information for all species. Keys are unique SMILES strings for a species, values are SpeciesData for the species with that SMILES string.

getPairStructure(struct)[source]

Create the dimer structure

Parameters

struct (schrodinger.structure.Structure) – The structure containing the dimer molecules

Return type

schrodinger.structure.Structure

Returns

The structure object for the dimer

getClusterStructure(struct, cell=None, distance=None, heavy_only=False, by_com=False)[source]

Get a structure that is the dimer surrounded by all nearest neighbor molecules. The dimer and all molecules are positioned at their nearest neighbor images to the original position of the first molecule in the dimer.

Parameters
  • struct (schrodinger.structure.Structure) – The structure containing this Dimer and all neighbor molecules

  • cell (schrodinger.infra.structure.DistanceCell) – The DistanceCell to use when finding nearest neighbors. If not given, will be calculated based on struct and distance. Either cell or distance must be given.

  • distance (float) – The distance to use when creating a new distance cell if needed. Either cell or distance must be given.

  • heavy_only (bool) – Use only heavy atom distances when finding the cluster

  • by_com (bool) – If True, use center of masses when determining distance

Return type

schrodinger.structure.Structure

Returns

The structure of the dimer with nearest neighbor molecules. The dimer molecules appear first in the cluster.

getPeriodicPairStructure(struct)[source]

Create a dimer structure for a pair of molecules that takes into account the periodic boundary condition.

If | represents a cell boundary, and …. represents some long distance, imagine two molecules X and Y on opposite sides of the cell.

Y|X….Y|X

We need to extract coordinates for Y that represent the Y|X case, not the X….Y case.

Parameters

struct (schrodinger.structure.Structure) – The structure containing the dimer molecules

Return type

schrodinger.structure.Structure

Returns

The structure object for the dimer

getNonPeriodicPairStructure(struct)[source]

Create a dimer structure for a pair of molecules in a non-periodic system

Parameters

struct (schrodinger.structure.Structure) – The structure containing the dimer molecules

Return type

schrodinger.structure.Structure

Returns

The structure object for the dimer

class schrodinger.application.matsci.clusterstruct.ComInfo(tracker, struct, cell)

Bases: tuple

__contains__(key, /)

Return key in self.

__len__()

Return len(self).

cell

Alias for field number 2

count(value, /)

Return number of occurrences of value.

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

struct

Alias for field number 1

tracker

Alias for field number 0

class schrodinger.application.matsci.clusterstruct.COMTracker(atom_struct)[source]

Bases: object

When using the center of mass to measure between molecules, we do the following:

  • Create a new structure without any atoms except for a single atom at

each molecule’s center of mass (a “COM structure”) - Use this COM structure for all measurements/clustering - Once the dimers/clusters have been determined using the center of mass atoms, use the positions of the center of mass atoms to place the original molecules at the new center of mass positions.

The key to the COM structure is that center of mass atoms have the same atom index as the molecule index of the molecule in the atom structure they represent, and their position indicates the new position of the of the corresponding atomistic molecule.

This class manages the COM structure and various manipulations

ORIGINAL_MOLNUM_PROP = 'i_matsci_original_molecule_number'
__init__(atom_struct)[source]

Create a COMTracker object

Parameters

atom_struct (schrodinger.structure.Structure) – The atom structure that the COM structure will mimic

addCOMAtoms()[source]

Add an atom to the COM structure at the center of mass of each molecule in the atom structure

createMimic(struct)[source]

Create an empty structure object with the same title and properties as struct

Parameters

struct (schrodinger.structure.Structure) – The structure to create a mimic of

Return type

schrodinger.structure.Structure

Returns

An empty structure with the same title and properties as the input structure

convertCOMToAtomCluster(com_cluster)[source]

Given a structure with center of mass atoms, create a new structure with the original molecules located at their corresponding center of mass

Parameters

com_cluster (schrodinger.structure.Structure) – The COM structure to create atomistic structure of

Return type

schrodinger.structure.Structure

Returns

An atomistic structure with molecules located at the same positions as the center of mass atoms in com_cluster

schrodinger.application.matsci.clusterstruct.create_center_of_mass_info(struct, distance)[source]

Create information needed for clustering by center of mass

Parameters
  • struct (structure.Structure) – The atomistic structure to use to find center of masses

  • distance (float) – The distance for the distance cell to create

Return type

ComInfo

Returns

Center of mass info - a tracker, structure and distance cell

schrodinger.application.matsci.clusterstruct.find_atoms_closest_to_atoms(struct, atoms, cell, only_greater=False, heavy_only=False)[source]

Find all the atoms that are within a certain distance of the provided atoms, returning information about those atoms.

Parameters
  • struct (schrodinger.structure.Structure) – The structure object containing the atoms to search

  • atoms (list of int or schrodinger.structure._StructureAtom) – The list of atoms to find atoms near. Can be atom objects or integer indexes. If this list contains hydrogen atoms, they will still be used even if heavy_only=True.

  • cell (schrodinger.infra.structure.DistanceCell) – The distance cell to use for finding nearby atoms

  • only_greater (bool) – Whether to only find nearby atoms in molecules with indexes greater than the molecule they are close to

  • heavy_only (bool) – Return only heavy atoms that are close to the given atoms. This parameter only affects atoms found, it has no effect on the list of atoms provided in the atoms parameter.

Return type

dict

Returns

Dictionary with keys that are molecule numbers and values that are a list of Neighbor objects for each atom in that molecule that is nearby one of the atoms in the atoms list. Atoms that are nearby multiple atoms in the atoms list will appear multiple times, once for each atom it is nearby.

schrodinger.application.matsci.clusterstruct.find_molecules_closest_to_atoms(struct, atoms, cell, only_greater=False, heavy_only=False, by_com=False)[source]

Find all the molecules that are within a certain distance of the provided atoms, returning information about those molecules

Parameters
  • struct (schrodinger.structure.Structure) – The structure object containing the atoms to search

  • atoms (list of int or schrodinger.structure._StructureAtom) – The list of atoms to find molecules near. Can be atom objects or integer indexes. This list of atoms is not affected by the heavy_only paramter, it may contain H atoms and those atoms will be used.

  • cell (schrodinger.infra.structure.DistanceCell) – The distance cell to use for finding nearby molecules

  • only_greater (bool) – Whether to only find nearby molecules with indexes greather than the molecule they are close to

  • heavy_only (bool) – Use only heavy atoms when finding close molecules. This only affects the found molecules and has no effect on the provided atom list in atoms

  • by_com (bool or ComInfo) – If True, create the info needed to find neighbors by center of mass instead of atom distance. If ComInfo, this is the pre-calculated data to use for center of mass distance. If False, do not find neighbors by center of mass. heavy_only is ignored if by_com is not False.

Return type

dict

Returns

Dictionary with keys that are molecule numbers and values are Neighbor objects for the atom in that molecule that is closest to one of the atoms in the atoms list

schrodinger.application.matsci.clusterstruct.get_dimers_with_molecule(struct, molecule, cell, pbc=None, only_greater=False, struct_index=0, heavy_only=False, by_com=False)[source]

Get a Dimer object for every molecule within a given distance of the provided molecule

Parameters
  • struct (schrodinger.structure.Structure) – The structure object containing the molecules to search

  • molecule (schrodinger.structure._Molecule) – The molecule to find dimers of

  • cell (schrodinger.infra.structure.DistanceCell) – The distance cell to use for finding nearby molecules

  • pbc (schrodinger.infra.structure.PBC) – The PBC object used to create the distance cell

  • only_greater (bool) – Whether to only find Dimers with molecules that have indexes greather than the provided molecule

  • struct_index (int) – An index for the structure that is providing these dimers. This is passed to the Dimer class and can be used by calling routines to track Dimers from different structures.

  • heavy_only (bool) – Use only heavy atoms when determining dimers

  • by_com (bool or ComInfo) – If True, create the info needed to find neighbors by center of mass instead of atom distance. If ComInfo, this is the pre-calculated data to use for center of mass distance. If False, do not find neighbors by center of mass. heavy_only is ignored if by_com is not False.

Return type

list of Dimer

Returns

A Dimer object for each dimer that molecule forms

schrodinger.application.matsci.clusterstruct.get_dimers_in_structure(struct, cell=None, pbc=None, distance=None, struct_index=0, heavy_only=False, by_com=False)[source]

Get a Dimer object for every dimer in struct

Parameters
  • struct (schrodinger.structure.Structure) – The structure object containing the dimers to find

  • cell (schrodinger.infra.structure.DistanceCell) – The distance cell to use for finding dimers

  • pbc (schrodinger.infra.structure.PBC) – The PBC object used to create the distance cell

  • distance (float) – The distance to use in creating a distance cell if none is provided

  • struct_index (int) – An index for the structure that is providing these dimers. This is passed to the Dimer class and can be used by calling routines to track Dimers from different structures.

  • heavy_only (bool) – Use only heavy atoms when determining dimers

  • by_com (bool or ComInfo) – If True, create the info needed to find neighbors by center of mass instead of atom distance. If ComInfo, this is the pre-calculated data to use for center of mass distance. If False, do not find neighbors by center of mass. heavy_only is ignored if by_com is not False.

Return type

list of Dimer

Returns

A Dimer object for each dimer that molecule forms

Raises

RuntimeError – If neither cell nor distance are provided

schrodinger.application.matsci.clusterstruct.move_atoms_next_to_atom(pbc, struct1, home_atom, struct2, neighbor_atom, moving_indexes=None)[source]

Move a structure to be at the PBC image that is closest to home_atom. The atoms in the structure are moved as a single group so that they maintain their coordinates relative to each other.

Note

The difference between the method in this function and the pbc.getNearestImages() method for finding atom locations is that this function is guaranteed to move all atoms with the same vector. getNearestImages() is not and can potentially split groups of atoms into different images.

Parameters
schrodinger.application.matsci.clusterstruct.contract_by_molecule(struct, pbc=None, anchors=None)[source]

Contract each molecule in a structure so that all the atoms within a given molecule are at the same PBC image. In this case, “same PBC image” means that the molecule has chemically correct coordinates even if the PBC is removed. Thus, it will turn |-- --| into | –|– where | = pbc wall, - = atoms

If no PBC exists, no action will be taken.

Algorithm: Starting at an arbitrary atom (or the anchor atom if provided, #1, contract (move to nearest image) all atoms bound to #1. Keep a list of all atoms contracted. Pick an atom that has been contracted and repeat, adding its neighbors to the list of contracted atoms. Continue until the list of contracted atoms has been exhausted. If all atoms in the structure have been contracted, then work is complete. If some atoms in the structure have not been contracted, this means that there is more than one molecule. Pick an arbitrary new uncontracted atom and return to the top of the Algorithm. Repeat this outer loop until all atoms have been contracted. This algorithm ensures that atoms are always being moved next to an atom they are bonded to rather than an atom that is nearby due to the PBC. It does NOT in any way move molecules near each other except by coincidence.

Parameters
  • struct (schrodinger.structure.Structure) – The structure to modify

  • pbc (schrodinger.infra.structure.PBC) – The PBC to use in determining images

  • anchors (list) – List of atom indexes that should not be moved and that all other atoms should be contracted towards. Note that the use of anchors means that not all atoms will be moved to the same image if more than one anchor comes from the same molecule and the anchors are not in the same image.

Raises

IndexError – If an anchor index is not an atom index in struct

schrodinger.application.matsci.clusterstruct.contract_structure(struct, pbc=None, cell=None, distance=10.0, contract_on_atoms=None, also_keep_stationary=False)[source]

Contract a structure so that the entire structure has chemically sensible coordinates even if the PBC is removed - i.e. it uses only a single PBC image and would be suitable for a Jaguar calculation for instance. This involves two steps: 1) contracting each molecule so that the molecule itself is in a single image and then 2) contracting all molecules together so that they are all in the same image. In step 2 molecules close to a core set of atoms will be moved in such a way that preserves their closest possible approach to the core atoms. For computational speed optimization, molecules outside the specified cell/distance will be moved so that an arbitrary atom in the molecule is as close as possible to an arbitrary atom in the core. To avoid this, pass in a cell or distance that uses a large-enough distance that all molecules will fall inside that distance.

Parameters
  • struct (schrodinger.structure.Structure) – The structure to modify

  • pbc (schrodinger.infra.structure.PBC) – The PBC to use in determining images

  • cell (schrodinger.infra.structure.DistanceCell) – The distance cell to use for finding closest approaches

  • distance (float) – The distance to use for finding closest approaches if cell is not provided

  • contract_on_atoms (list of int) – List of atom indexes that form the core that all other molecules will be contracted towards in step 2. If not provided, the first molecule will be used. Note that these molecules might still move as part of the Step 1 process.

  • also_keep_stationary (bool) – If contract_on_atoms is provided, setting this flag to True will ensure that these atoms do not move during the Step 1 contraction by molecule.

schrodinger.application.matsci.clusterstruct.create_dimer_structures(struct, atoms, pbc=None, nearest_neighbors=None, cell=None, distance=None)[source]

Create structures for each dimer that the atoms in the atoms list form

Parameters
  • struct (schrodinger.structure.Structure) – The structure containing the dimers

  • atoms (list of int) – The atom indexes to find dimers for

  • pbc (schrodinger.infra.structure.PBC) – The PBC to use in determining images

  • nearest_neighbors (dict) – Dictionary with keys that are molecule numbers and values are Neighbor objects for the atom in that molecule that is closest to one of the atoms in the atoms list. Such a dictionary is provided by find_molecules_closest_to_atoms.

  • cell (schrodinger.infra.structure.DistanceCell) – The distance cell to use for finding dimers. Either distance or cell must be provided if nearest_neighbors is not provided.

  • distance (float) – The intermolecular distance to use for finding dimers if cell is not provided. Either distance or cell must be provided if nearest_neighbors is not provided.

Return type

list

Returns

A list of schrodinger.structure.Structure objects, one for each dimer found

Raises

RuntimeError – If none of nearest_neighbors, cell nor distance are provided

schrodinger.application.matsci.clusterstruct.create_nearest_neighbor_cluster(struct, atoms, cell, pbc=None, heavy_only=False, by_com=False)[source]

Return a structure that has the given atoms surrounded by their nearest neighbor molecules

Parameters
  • struct (schrodinger.structure.Structure) – The input structure

  • atoms (list of int) – The atom indexes that will form the center of the cluster

  • cell (schrodinger.infra.structure.DistanceCell) – The DistanceCell to use when finding nearest neighbors

  • pbc (schrodinger.infra.structure.PBC) – The PBC to use when finding nearest images if one should be used

  • heavy_only (bool) – Use only heavy atom distances when finding the cluster

  • by_com (bool or ComInfo) – If True, create the info needed to find neighbors by center of mass instead of atom distance. If ComInfo, this is the pre-calculated data to use for center of mass distance. If False, do not find neighbors by center of mass. heavy_only is ignored if by_com is not False.

Return type

schrodinger.structure.Structure

Returns

A cluster that has the given atoms at the center and all nearest neighbors surrounding them. The given atoms appear first in the structure.

schrodinger.application.matsci.clusterstruct.create_non_pbc_cluster(struct, molnumbers)[source]

Create a cluster of the given molecules

Parameters
  • struct (schrodinger.structure.Structure) – The structure to extract molecules from

  • molnumbers (list of int) – The molecule numbers of the molecules to extract

Return type

schrodinger.structure.Structure

Returns

A cluster of molecules

schrodinger.application.matsci.clusterstruct.get_all_atoms_marked_as_neighbors(struct)[source]

Return a list of all atom objects in struct that are marked as neighbors

Parameters

struct (schrodinger.structure.Structure) – The structure to extract atoms from

Return type

list

Returns

A list of all atom objects marked with the NEIGHBOR_ATOM_PROP property

schrodinger.application.matsci.clusterstruct.add_neighbor_charges_to_jaginput(struct, qprop, jfile)[source]

Add point charges that represent neighboring atoms to an existing jaguar input file. A point charge will be written for every atom that has the NEIGHBOR_ATOM_PROP set to True. The charges are added in a &pointch section.

Parameters
  • struct (schrodinger.structure.Structure) – The structure to extract charges from

  • qprop (str) – The atom property to use as for the charge values. If qprop is ESP_ARGPARSE_VALUE, ESP_CHARGE_PROP will be used instead. This allows restart jobs to use previously-computed charges without recomputing them.

  • jfile (str) – The path to the Jaguar input file

schrodinger.application.matsci.clusterstruct.set_neighbor_atoms_basis_set(struct, basis, jfile)[source]

Set all atoms marked as neighbors with the NEIGHBOR_ATOM_PROP property to use the provided basis set. The basis set is specified in an &atomic section.

Parameters
  • struct (schrodinger.structure.Structure) – The structure to extract charges from

  • basis (str) – The basis set to use for neighbor atoms

  • jfile (str) – The path to the Jaguar input file

schrodinger.application.matsci.clusterstruct.find_species(structs, naming_function=None)[source]

Find all chemically distinct species in the given structures, as determined via unique SMILES strings or unique names.

If naming_function is supplied, species are grouped using names, unless the function returns None, in which case the code falls back to using SMILES.

Parameters
  • structs (list of schrodinger.structure.Structure) – The structures to find species in

  • naming_function (callable or None) – The function to call to get a name for each molecule. Should take a structure._Molecule object as argument and return a string

Return type

dict

Returns

Keys are unique SMILES strings or group names for species, values are SpeciesData objects for that species

schrodinger.application.matsci.clusterstruct.get_species_display_names(species)[source]

Create a dictionary mapping the display name of species to the species

Parameters

species (iterable) – The species to get display names for

Return type

dict

Returns

dictionary containing species display names and species objects

schrodinger.application.matsci.clusterstruct.get_example_mol_tag(species_data)[source]

Get an additional tag that gets an example molecule number for this species

Parameters

species_data (SpeciesData) – The data for this species

Return type

str

Returns

The tag for this species

schrodinger.application.matsci.clusterstruct.get_base_esp_jobname()[source]

Get the base name that will be used for esp jobs

Return type

str

Returns

The base name for esp jobs

schrodinger.application.matsci.clusterstruct.compute_esp_charges(structs, basis, species=None, tpp=None, logger=None, quiet=False, opt=False)[source]

Compute ESP charges for a representative example of each species found in structs.

Parameters
  • structs (list of schrodinger.structure.Structure) – The structures to find species in to compute the charges of

  • basis (str or None) – The basis set to use when computing charges. None will use the default Jaguar basis set.

  • species (dict) – Keys are unique SMILES strings, values are SpeciesData objects for the species with that SMILES string. If not provided, will be computed.

  • tpp (int) – The number of threads per Jaguar job. If not provided, -TPP will not be included in the Jaguar command - the job will run serially.

  • logger (logging.Logger) – The logger to use, if any. If not provided and quiet=False, messages will be printed to the terminal

  • quiet (bool) – If True, do not print or log any messages.

  • opt (bool) – Whether to perform a geometry optimization before computing charges

Return type

dict, list

Returns

Dict is the species - either those provided or those computed. List is the names of jobs that failed.

schrodinger.application.matsci.clusterstruct.populate_with_charges(structs, species, prop='r_matsci_ESP_Charges')[source]

For every molecule in structs, add an atom property that contains the previously computed charges for the species it belongs to.

This method expects the list of structs to be the same as the list that species was computed from.

Parameters
  • structs (list of schrodinger.structure.Structure) – The structures to find species in to compute the charges of

  • species (dict) – Keys are unique SMILES strings, values are SpeciesData objects for the species with that SMILES string.

  • prop (str) – The atom property to set with the new charge

Raises

RuntimeError – If things don’t match up, such as structs being shorter than expected, there being a different number of molecules in a given structure, the atoms not being in expected order in a molecule, or a molecule having a different number of atoms than expected.

schrodinger.application.matsci.clusterstruct.compute_and_populate_charges(structs, basis, tpp=None, logger=None, quiet=False, species=None, opt=False)[source]

Determine the unique chemical species of each molecule in structs, compute the ESP charges with Jaguar for each species and then apply those charges as atom properties to each atom in structs.

Parameters
  • structs (list of schrodinger.structure.Structure) – The structures to find species in to compute the charges of

  • basis (str or None) – The basis set to use when computing charges. None will use the default Jaguar basis set.

  • tpp (int) – The number of threads per Jaguar job

  • logger (logging.Logger) – The logger to use, if any. If not provided and quiet=False, messages will be printed to the terminal

  • quiet (bool) – If True, do not print or log any messages.

  • species (dict) – Keys are unique SMILES strings, values are SpeciesData objects for the species with that SMILES string. If not passed in, will be determined automatically. Must correspond to the structures in structs.

  • opt (bool) – Whether to perform a geometry optimization before computing charges

Return type

dict, list, str

Returns

Dict is the species computed. List is the names of ESP jobs that failed. str is any error message that occurred during the assignment of computed ESP charges to atoms in structs. If quiet=False, the names of failed jobs and msg will have already been logged.

schrodinger.application.matsci.clusterstruct.get_cluster_atom_ids(distance_cell, xyz)[source]

Get ids of atoms surrounding xyz coordinate

Parameters
Return type

list

Returns

List of atom ids