schrodinger.application.matsci.packmol module

Utilities for working with packmol.

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.application.matsci.packmol.PDBdata(pdbname, pdbres, resnum, chain_name, order)

Bases: tuple

chain_name

Alias for field number 3

order

Alias for field number 4

pdbname

Alias for field number 0

pdbres

Alias for field number 1

resnum

Alias for field number 2

class schrodinger.application.matsci.packmol.SurfactantInfo(st, name, packing_pct, number, layer, hydrophilic_idxs, hydrophobic_idxs, cion_st, cion_name)

Bases: tuple

cion_name

Alias for field number 8

cion_st

Alias for field number 7

hydrophilic_idxs

Alias for field number 5

hydrophobic_idxs

Alias for field number 6

layer

Alias for field number 4

name

Alias for field number 1

number

Alias for field number 3

packing_pct

Alias for field number 2

st

Alias for field number 0

class schrodinger.application.matsci.packmol.SolventInfo(st, name, packing_pct, number, layer)

Bases: tuple

layer

Alias for field number 4

name

Alias for field number 1

number

Alias for field number 3

packing_pct

Alias for field number 2

st

Alias for field number 0

class schrodinger.application.matsci.packmol.PackmolKw

Bases: StrEnum

Enum to hold packmol keywords.

OUTPUT = 'output'
FILETYPE = 'filetype'
COMMENT = '#'
STRUCTURE = 'structure'
NUMBER = 'number'
END = 'end'
ATOMS = 'atoms'
RADIUS = 'radius'
INSIDE = 'inside'
BOX = 'box'
FIXED = 'fixed'
SIDEMAX = 'sidemax'
FSCALE = 'fscale'
SHORT_RADIUS = 'short_radius'
SHORT_RADIUS_SCALE = 'short_radius_scale'
PBC = 'pbc'
schrodinger.application.matsci.packmol.get_cuboid_vol(st)

Return the cuboid volume of the given structure.

Parameters:

st (schrodinger.structure.Structure) – the structure

Return type:

float

Returns:

the cuboid volume in Ang.^3

schrodinger.application.matsci.packmol.get_idxs(idxs_str)

Return integer indices from the given string of indices.

Parameters:

idxs_str (str) – the string of indices

Return type:

tuple

Returns:

the integer indices

schrodinger.application.matsci.packmol.get_class_map()

Return the class map.

Return type:

dict

Returns:

the class map

schrodinger.application.matsci.packmol.get_pdb_data(pdbname, pdbres, resnum=None, chain_name=None, order=None)

Return a PDBdata.

Parameters:
  • pdbname (str) – the PDB atom name

  • pdbres (str) – the PDB residue name

  • resnum (int or None) – the PDB residue number if needed

  • chain_name (str or None) – the PDB chain name if needed

  • order (int or None) – a bond order to be used when bonding to the atom corresponding to this object

Return type:

PDBdata

Returns:

the PDB data

schrodinger.application.matsci.packmol.get_cg_radii_lines(st, override_radius=None)

Return the coarse-grained radii body.

Parameters:
  • st (Structure) – the structure

  • override_radius (float) – Optional constant radius in angstroms to use instead of atom radii

Return type:

list[str]

Returns:

list of the coarse-grain radii body lines

schrodinger.application.matsci.packmol.get_atom_radii_lines(st, allow_ring_spears=False, penalty_factor_ring_spears=10, radius_factor_ring_spears=1, tolerance=2, batch_size=5)

Return the atom radii body.

Parameters:
  • st (Structure) – the structure

  • allow_ring_spears (bool) – if True then allow ring-spears

  • penalty_factor_ring_spears (float) – the penalty factor for ring-spears

  • radius_factor_ring_spears (float) – the radius factor for ring-spears

  • tolerance (float) – the distance tolerance in Angstrom

  • batch_size (int) – the number of atom indices per atom block

Return type:

list[str]

Returns:

list of the atom radii body lines

class schrodinger.application.matsci.packmol.StdInJob(cmd, subdir=None, log_name=None, name=None)

Bases: LoggingSubprocessJob

Manage a subprocess job with stdin and that sends stdout to a log file.

doCommand(*args, **kwargs)

See parent class for documentation.

postCommand()

See parent class for documentation.

schrodinger.application.matsci.packmol.get_valid_forced_out_fn(out_fn)

Return the valid forced Packmol output file name corresponding to the given Packmol output file name.

Parameters:

out_fn (str) – the Packmol output file name

Return type:

str

Returns:

the valid forced Packmol output file name

schrodinger.application.matsci.packmol.write_valid_forced_out_file(out_fn)

For the given Packmol output file name create a copy of the corresponding forced Packmol output file that has a valid file name.

Parameters:

out_fn (str) – the Packmol output file name

schrodinger.application.matsci.packmol.get_packmol_output_structures(out_fn)

For the given Packmol output file name return the Packmol output structures.

Parameters:

out_fn (str) – the Packmol output file name

Return type:

[schrodinger.structure.Structure, schrodinger.structure.Structure] or [schrodinger.structure.Structure, None]

Returns:

the first item is the Packmol output structure, the second item is the forced Packmol output structure if it exists

schrodinger.application.matsci.packmol.run(input_files, max_failures=None)

Run.

Parameters:
  • input_files (list) – packmol input files

  • max_failures (int) – Total number of allowed subjob failures before JobDJ exits. See schrodinger.job.queue.py::JobDJ for more docs.

Return type:

dict

Returns:

keys are input files, values are structure output files

class schrodinger.application.matsci.packmol.PDBWriter(filename, reorder_by_sequence=False, first_occ=False, translate_pdb_resnames=True)

Bases: PDBWriter

write(ct)

See parent class for documentation.

schrodinger.application.matsci.packmol.set_unique_pdb_atom_names(st)

Set unique PDB atom names on the given structure.

Parameters:

st (Structure) – the structure

schrodinger.application.matsci.packmol.has_imperfect_packing(log_fn)

Return True if the given packmol log file name indicates a solution with imperfect packing.

Parameters:

log_fn (str) – the packmol log file name

Return type:

bool

Returns:

True if there is imperfect packing

schrodinger.application.matsci.packmol.set_pbc(st, a_len, b_len, c_len, expand_pbc=False, logger=None)

Set the PBC on the given structure.

Parameters:
  • st (schrodinger.structure.Structure) – the structure on which to set the PBC

  • a_len (float) – the PBC length of the a-vector in Ang.

  • b_len (float) – the PBC length of the b-vector in Ang.

  • c_len (float) – the PBC length of the c-vector in Ang.

  • expand_pbc (bool) – if True then expand the PBC due to packmol imperfect packing

  • logger (logging.Logger or None) – output logger or None if there isn’t one

schrodinger.application.matsci.packmol.add_atom_properties(pdb_st, mae_structs, props=('b_matsci_hydrophilic', 'b_matsci_hydrophobic', 'b_matsci_polymer_head_atom', 'b_matsci_polymer_tail_atom', 's_matsci_orig_pdbres'))

Transfer the given properties from the mae structures to the structure created from pdb

Parameters:
  • pdb_st (Structure) – the structure created from the pdb file

  • mae_structs (list(Structure)) – the structures created from the mae files

  • props (list(str)) – the properties to transfer

schrodinger.application.matsci.packmol.check_ring_spears(sts, logger=None)

Check for ring-spears.

Parameters:
  • sts (dict) – keys are input files, values are schrodinger.structure.Structure

  • logger (logging.Logger or None) – output logger or None if there isn’t one

Raises:

RuntimeError – if there is a problem

Return type:

dict, dict

Returns:

the first and second are w/o and w/ ring-spears, respectively, keys are input files, values are schrodinger.structure.Structure

schrodinger.application.matsci.packmol.add_ring_spear_dummies(st, logger=None)

Return a copy of the given structure with dummy atoms added to the rings for the purposes of preventing ring-spears.

Parameters:
Return type:

schrodinger.structure.Structure

Returns:

the structure with the dummy atoms added

schrodinger.application.matsci.packmol.remove_ring_spear_dummies(st)

Return a copy of the given structure with ring-spear dummy atoms removed from the rings.

Parameters:

st (schrodinger.structure.Structure) – the structure

Return type:

schrodinger.structure.Structure

Returns:

the structure with the dummy atoms removed

schrodinger.application.matsci.packmol.get_cells(input_files, sts, allow_ring_spears=False, prefer_forced=False, logger=None)

Return cells.

Parameters:
  • input_files (dict) – keys are packmol input files, values are tuples of the 3 box lengths (Angstrom) defining the PBC

  • sts (dict) – keys are file names (referenced in the given packmol input files), values are schrodinger.structure.Structure

  • allow_ring_spears (bool) – if True then allow ring-spears

  • prefer_forced (bool) – if True and a forced Packmol output file can be found choose it as the representative Packmol output file otherwise choose the standard Packmol output file as the representative

  • logger (logging.Logger or None) – output logger or None if there isn’t one

Raises:

RuntimeError – if there is a problem

Return type:

dict, dict

Returns:

the first and second are all (good and bad) and just bad cells, respectively, keys are input files, values are schrodinger.structure.Structure

schrodinger.application.matsci.packmol.write_desmond_cells(input_files, sts, force_field=None, water_force_field='SPC', cg_ff_loc_type='local', allow_ring_spears=False, prefer_forced=False, enable_metal_force_field=False, logger=None)

Write Desmond cells.

Parameters:
  • input_files (dict) – keys are packmol input files, values are tuples of the 3 box lengths (Angstrom) defining the PBC

  • sts (dict) – keys are file names (referenced in the given packmol input files), values are schrodinger.structure.Structure

  • force_field (str) – name of FF to apply

  • water_force_field (str) – name of the water force field to apply, options are available in desmondutils

  • cg_ff_loc_type (str) – specifies the location to which to look for coarse-grained force field files, one of parserutils.INSTALLED_CG_FF_LOCATION_TYPE or parserutils.LOCAL_CG_FF_LOCATION_TYPE

  • allow_ring_spears (bool) – if True then allow ring-spears

  • prefer_forced (bool) – if True and a forced Packmol output file can be found choose it as the representative Packmol output file otherwise choose the standard Packmol output file as the representative

  • enable_metal_force_field (bool) – whether to use the metal force field for metal atoms

  • logger (logging.Logger or None) – output logger or None if there isn’t one

Raises:

RuntimeError – if there is a problem with the input

Return type:

dict, dict

Returns:

the first and second are all (good and bad) and just bad output files, respectively, keys are input files, values are names of written Desmond *cms files

schrodinger.application.matsci.packmol.set_unique_pdb_res_names(st, start_idx=0)

Assign a synthetic unique PDB residue name to every residue of st, stashing each original pdbres on every atom of the residue in the ORIG_PDBRES_PROP atom property so that unset_unique_pdb_res_names can restore the originals after the round trip through Packmol. The given structure is modified in place.

Every residue is mangled regardless of whether its pdbres is unique within st, because cross-structure pdbres collisions (the same original name appearing in more than one input structure) would otherwise leak duplicate pdbres values into the combined Packmol output and break downstream bond reconstruction, atom-property transfer, and residue re-numbering. Mangling everything and threading start_idx across successive calls guarantees that every residue in the combined output has a unique pdbres for the duration of the round trip.

Raises:

RuntimeError – if there is a problem with the input

Parameters:
  • st (Structure) – the structure

  • start_idx (int) – the synthetic index to assign to the first residue of st. Pass the return value of the prior call when processing more than one structure so synthetic names are globally unique across every structure that will be combined by Packmol.

Return type:

int

Returns:

the next synthetic index to use; pass it as start_idx to the next call.

schrodinger.application.matsci.packmol.unset_unique_pdb_res_names(st)

Restore the original PDB residue names previously stashed by set_unique_pdb_res_names. For each residue carrying ORIG_PDBRES_PROP on its atoms, the original pdbres is read off the first atom and reassigned to the residue, then the property is removed from every atom of the residue. Residues without the property are left untouched. The given structure is modified in place.

Parameters:

st (Structure) – the structure

schrodinger.application.matsci.packmol.group_infos_by_layer(infos)

Group the given information objects into a dictionary keyed by layer.

Parameters:

infos (list[SurfactantInfo] or list[SolventInfo]) – contains surfactant or solvent infos

Return type:

dict

Returns:

the information objects keyed by layer

schrodinger.application.matsci.packmol.get_max_distance_btw_groups(st, idxs, jdxs)

Return the maximum distance (Angstrom) between the given groups of atom indices.

Parameters:
Return type:

float

Returns:

the maximum distance in Angstrom

exception schrodinger.application.matsci.packmol.PackmolInputFileException

Bases: Exception

class schrodinger.application.matsci.packmol.PackmolInputFile(tolerance=2, filetype='pdb', output_base_name='packmol', comment='', general_body='', allow_ring_spears=False, penalty_factor_ring_spears=10, radius_factor_ring_spears=1)

Bases: object

Manage a packmol input file.

IN_EXT = '.inp'
__init__(tolerance=2, filetype='pdb', output_base_name='packmol', comment='', general_body='', allow_ring_spears=False, penalty_factor_ring_spears=10, radius_factor_ring_spears=1)

Create an instance.

Parameters:
  • tolerance (float) – the distance tolerance in Angstrom

  • filetype (str) – the file type to use for all structure files, pdb, tinker, xyz, or moldy

  • output_base_name (str) – the base name to use for the packmol output structure file

  • comment (str) – a comment placed at the top of the the packmol input file, include preceeding ‘#’

  • general_body (str) – the general body, should contain newlines, this is for any additional top level parameters that do not have to do with structures

  • allow_ring_spears (bool) – if True then allow ring-spears

  • penalty_factor_ring_spears (float) – the penalty factor for ring-spears

  • radius_factor_ring_spears (float) – the radius factor for ring-spears

addStructureBody(base_name, body)

Add a structure body to the input file.

Parameters:
  • base_name (str) – the base name of the input structure file

  • body (str) – the body, should contain indentation and newlines

addStructureBodies()

Add structure bodies to the input file.

Raises:

PackmolInputFileException – if there is an issue with the input

getPBCBox()

Get the PBC box.

Return type:

list[float]

Returns:

the PBC box, 6 floats, start - end, in Angstrom

write(input_base_name='packmol')

Write the packmol input file.

Parameters:

input_base_name (str) – the base name to use for the packmol input file

Raises:

PackmolInputFileException – if there is an issue with the input

Return type:

str

Returns:

the packmol input file name

class schrodinger.application.matsci.packmol.StructuredLiquidInputFile(*args, **kwargs)

Bases: PackmolInputFile

Manage a structured liquid input file.

__init__(*args, **kwargs)

See parent class for documentation.

check()

Check cell lengths.

Raises:

PackmolInputFileException – if there is an issue with the input

prepare(cell_lengths, surfactant_infos, solvent_infos, layer_sep=1, packing_f=0.8, min_constraint_window_surfactant_idxs=25)

Prepare.

Parameters:
  • cell_lengths (tuple) – the cell lengths of the output structure file

  • surfactant_infos (list) – contains SurfactantInfo

  • solvent_infos (list) – contains SolventInfo

  • layer_sep (float) – the layer separation in Angstrom

  • packing_f (float) – a packing efficiency factor used to control the density of surfactant and solvent molecules

  • min_constraint_window_surfactant_idxs (float) – this is the minimum window length for constraining surfactant hydrophilic and hydrophobic indices as a percentage of the surfactant length, should be in (0, 50)

Raises:

PackmolInputFileException – if there is an issue with the input

getMaxDists(all_infos)

Return a dictionary of maximum distances (Ang.) among the structures in each layer of the given all_infos.

Parameters:

all_infos (dict) – keys are layers, values are lists containing either SurfactantInfo or SolventInfo

Return type:

dict

Returns:

keys are layers, values are maximum distances

getBoxSliceVol(cmin, cmax)

Return the box slice volume.

Parameters:
  • cmin (float) – the lower bound on the layer in Angstrom

  • cmax (float) – the upper bound on the layer in Angstrom

Return type:

float

Returns:

the box slice volume in Ang.^3

getSphereSliceVol(rmin, rmax)

Return the sphere slice volume.

Parameters:
  • rmin (float) – the lower bound on the layer in Angstrom

  • rmax (float) – the upper bound on the layer in Angstrom

Return type:

float

Returns:

the sphere slice volume in Ang.^3

getOutsideSphereVol(radius)

Return the box volume less the sphere volume.

Parameters:

radius (float) – the radius of the sphere in Angstrom

Return type:

float

Returns:

the box volume less the sphere volume in Ang.^3

getCylinderSliceVol(rmin, rmax, length)

Return the cylinder slice volume.

Parameters:
  • rmin (float) – the lower bound on the layer in Angstrom

  • rmax (float) – the upper bound on the layer in Angstrom

  • length (float) – the length of the cylinder in Angstrom

Return type:

float

Returns:

the cylinder slice volume in Ang.^3

getOutsideCylinderVol(radius, length)

Return the box volume less the cylinder volume.

Parameters:
  • radius (float) – the radius of the cylinder in Angstrom

  • length (float) – the length of the cylinder in Angstrom

Return type:

float

Returns:

the box volume less the cylinder volume in Ang.^3

getEllipsoidSliceVol(rmin, rmax)

Return the ellipsoid slice volume.

Parameters:
  • rmin (float) – the lower bound on the layer in Angstrom

  • rmax (float) – the upper bound on the layer in Angstrom

Return type:

float

Returns:

the ellipsoid slice volume in Ang.^3

getOutsideEllipsoidVol(radius)

Return the box volume less the ellipsoid volume.

Parameters:

radius (float) – the radius of the ellipsoid in Angstrom, this is half the length of the minor axis

Return type:

float

Returns:

the box volume less the ellipsoid volume in Ang.^3

getNumber(info, amin, amax)

Return the number of surfactant or solvent molecules to add for the given info.

Parameters:
  • info (SurfactantInfo or SolventInfo) – the info object for this layer

  • amin (float) – the lower bound on the layer in Angstrom

  • amax (float or None) – the upper bound on the layer in Angstrom or None if there isn’t one in which case the remaining outermost space of the cell will be used

Return type:

int

Returns:

the number of molecules

getLayerVolume(amin, amax, buffer_len=0)

Return the volume of this layer.

Parameters:
  • amin (float) – the lower bound on the layer in Angstrom

  • amax (float or None) – the upper bound on the layer in Angstrom or None if there isn’t one in which case the remaining outermost space of the cell will be used

  • buffer_len (float) – a buffer length in Angstrom

Return type:

int

Returns:

the volume in Ang.^3

getPBCBox()

See parent class for documentation.

addLayer(info, amin, amax, hydrophilic_at_max=False, number=None, add_cion=False)

Add a layer.

Parameters:
  • info (SurfactantInfo or SolventInfo) – the info object for this layer

  • amin (float) – the lower bound on the layer in Angstrom

  • amax (float or None) – the upper bound on the layer in Angstrom or None if there isn’t one in which case the remaining outermost space of the cell will be used

  • hydrophilic_at_max (bool) – if info is SurfactantInfo whether the hydrophilic atoms are to be located at the maximum

  • number (int or None) – the number of molecules to add, if None it will be determined

  • add_cion (bool) – if info is SurfactantInfo whether the layer is for the counter-ion

getTotalSurfactantThickness(layers_are_bilayers=True)

Return the total surfactant thickness in Angstrom.

Parameters:

layers_are_bilayers (bool) – whether layers are bilayers

Return type:

float

Returns:

the total surfactant thickness in Angstrom

getTotalCIonThickness()

Return the total counter-ion thickness in Angstrom.

Return type:

float

Returns:

the total counter-ion thickness in Angstrom

getTotalNonSurfactantThickness()

Return the total non-surfactant thickness in Angstrom.

Return type:

float

Returns:

the total non-surfactant thickness in Angstrom

addSurfactantBodies(start_dist, start_hydrophilic_at_max=False, layers=None, layers_are_bilayers=True)

Add surfactant bodies to the input file.

Parameters:
  • start_dist (float) – start adding surfactants at this distance in Angstrom

  • start_hydrophilic_at_max (bool) – specifies whether the hydrophilic atoms for the starting layer are to be located at the maximum

  • layers (list or None) – the surfactant layers to add, if None then all will be added

  • layers_are_bilayers (bool) – whether layers are bilayers

Return type:

float, bool

Returns:

surfactants stopped being added at this distance in Angstrom, whether the hydrophilic atoms for the final layer are located at the maximum

addCIonBodies(start_dist, stop_dist, layers=None, factor=1)

Add counter-ion bodies to the input file.

Parameters:
  • start_dist (float) – start adding counter-ions at this distance in Angstrom

  • stop_dist (float) – stop adding counter-ions at this distance in Angstrom

  • layers (list or None) – the counter-ion layers to add, if None then all will be added

  • factor (float) – multiplies the corresponding number of surfactant molecules to set the number of counter-ions in the given region

addSolventBodies(start_dist, stop_dist, layers=None, layer_sep=None)

Add solvent bodies to the input file.

Parameters:
  • start_dist (float) – start adding solvents at this distance in Angstrom

  • stop_dist (float) – stop adding solvents at this distance in Angstrom

  • layers (list or None) – the solvent layers to add, if None then all will be added

  • layer_sep (float) – the layer separation in Angstrom

getSurfactantLayers()

Return a list of surfactant layers.

Return type:

list

Returns:

the surfactant layers

getSolventLayers()

Return a list of solvent layers.

Return type:

list

Returns:

the solvent layers

getConstraintType(parameter)

Return the constraint type.

Parameters:

parameter (float) – the parameter in Angstrom

Return type:

str

Returns:

the constraint type

class schrodinger.application.matsci.packmol.MonolayerInputFile(*args, **kwargs)

Bases: StructuredLiquidInputFile

Manage a monolayer input file.

SURFACTANT_TOP_ATOM_CONSTRAINT = 'over'
SURFACTANT_BOTTOM_ATOM_CONSTRAINT = 'below'
CONSTRAINT_TYPE = 'plane 0 0 1 {parameter}'
getMinCellLengths()

Return the minimum cell lengths.

Return type:

tuple

Returns:

a triple containing float and/or None, float is a minimum cell length in Angstrom, None indicates that there is no minimum

check()

Check cell lengths.

Raises:

PackmolInputFileException – if there is an issue with the input

getVol(amin, amax)

Return the volume.

Parameters:
  • amin (float) – the lower bound on the layer in Angstrom

  • amax (float) – the upper bound on the layer in Angstrom

Return type:

float

Returns:

the volume in Ang.^3

getSurfactantConstraints(amin, amax)

Return the surfactant constraints.

Parameters:
  • amin (float) – the lower bound on the layer in Angstrom

  • amax (float) – the upper bound on the layer in Angstrom

Return type:

str

Returns:

the surfactant constraints

getSolventConstraints(amin, amax)

Return the solvent constraints.

Parameters:
  • amin (float) – the lower bound on the layer in Angstrom

  • amax (float) – the upper bound on the layer in Angstrom

Return type:

str

Returns:

the solvent constraints

addStructureBodies()

See parent class for documentation.

class schrodinger.application.matsci.packmol.BilayerInputFile(*args, **kwargs)

Bases: MonolayerInputFile

Manage a bilayer input file.

getMinCellLengths()

Return the minimum cell lengths.

Return type:

tuple

Returns:

a triple containing float and/or None, float is a minimum cell length in Angstrom, None indicates that there is no minimum

check()

Check cell lengths.

Raises:

PackmolInputFileException – if there is an issue with the input

addStructureBodies()

See parent class for documentation.

class schrodinger.application.matsci.packmol.MicelleInputFile(*args, **kwargs)

Bases: StructuredLiquidInputFile

Manage a micelle input file.

SURFACTANT_TOP_ATOM_CONSTRAINT = 'outside'
SURFACTANT_BOTTOM_ATOM_CONSTRAINT = 'inside'
CONSTRAINT_TYPE = 'sphere 0 0 0 {parameter}'
getMinCellLengths()

Return the minimum cell lengths.

Return type:

tuple

Returns:

a triple containing float and/or None, float is a minimum cell length in Angstrom, None indicates that there is no minimum

check()

Check cell lengths.

Raises:

PackmolInputFileException – if there is an issue with the input

getRadius()

Return the radius.

Return type:

float

Returns:

the radius in Ang.

getVol(amin, amax)

Return the volume.

Parameters:
  • amin (float) – the lower bound on the layer in Angstrom

  • amax (float) – the upper bound on the layer in Angstrom

Return type:

float

Returns:

the volume in Ang.^3

getOutsideVol()

Return the outside volume.

Return type:

float

Returns:

the outside volume in Ang.^3

getSurfactantConstraints(amin, amax)

Return the surfactant constraints.

Parameters:
  • amin (float) – the lower bound on the layer in Angstrom

  • amax (float) – the upper bound on the layer in Angstrom

Return type:

str

Returns:

the surfactant constraints

getSolventConstraints(amin, amax)

Return the solvent constraints.

Parameters:
  • amin (float) – the lower bound on the layer in Angstrom

  • amax (float) – the upper bound on the layer in Angstrom

Return type:

str

Returns:

the solvent constraints

getPBCBox()

See parent class for documentation.

addStructureBodies()

See parent class for documentation.

class schrodinger.application.matsci.packmol.LiposomeInputFile(*args, **kwargs)

Bases: MicelleInputFile

Manage a liposome input file.

prepare(*args, **kwargs)

See parent class for documentation.

Parameters:

radius (float) – the radius of the liposome in Ang.

getMinRadius()

Return the minimum radius.

Return type:

float

Returns:

the minimum radius in Angstrom

check()

Check cell lengths.

Raises:

PackmolInputFileException – if there is an issue with the input

getRadius()

Return the radius.

Return type:

float

Returns:

the radius in Ang.

getInnerRadius()

Return the inner radius.

Return type:

float

Returns:

the inner radius in Ang.

getSolventConstraints(amin, amax)

Return the solvent constraints.

Parameters:
  • amin (float) – the lower bound on the layer in Angstrom

  • amax (float or None) – the upper bound on the layer in Angstrom or None if there isn’t one in which case the remaining outermost space of the cell will be used

Return type:

str

Returns:

the constraints

addStructureBodies()

See parent class for documentation.

class schrodinger.application.matsci.packmol.WormlikeMicelleInputFile(*args, **kwargs)

Bases: MicelleInputFile

Manage a wormlike micelle input file.

CONSTRAINT_TYPE = 'cylinder 0 0 {bottom} 0 0 1 {parameter} {length}'
getMinCellLengths()

Return the minimum cell lengths.

Return type:

tuple

Returns:

a triple containing float and/or None, float is a minimum cell length in Angstrom, None indicates that there is no minimum

getVol(amin, amax)

Return the volume.

Parameters:
  • amin (float) – the lower bound on the layer in Angstrom

  • amax (float) – the upper bound on the layer in Angstrom

Return type:

float

Returns:

the volume in Ang.^3

getOutsideVol()

Return the outside volume.

Return type:

float

Returns:

the outside volume in Ang.^3

getConstraintType(parameter)

Return the constraint type.

Parameters:

parameter (float) – the parameter in Angstrom

Return type:

str

Returns:

the constraint type

class schrodinger.application.matsci.packmol.ElongatedMicelleInputFile(*args, **kwargs)

Bases: MicelleInputFile

Manage an elongated micelle input file.

CONSTRAINT_TYPE = 'ellipsoid 0 0 0 {parameter} {parameter} {parameter_p} 1'
prepare(*args, **kwargs)

See parent class for documentation.

Parameters:

factor (float) – the scale factor for the principal axis

getMinCellLengths()

Return the minimum cell lengths.

Return type:

tuple

Returns:

a triple containing float and/or None, float is a minimum cell length in Angstrom, None indicates that there is no minimum

getMajorRadius()

Return the major radius.

Return type:

float

Returns:

the major radius in Ang.

getVol(amin, amax)

Return the volume.

Parameters:
  • amin (float) – the lower bound on the layer in Angstrom

  • amax (float) – the upper bound on the layer in Angstrom

Return type:

float

Returns:

the volume in Ang.^3

getOutsideVol()

Return the outside volume.

Return type:

float

Returns:

the outside volume in Ang.^3

getConstraintType(parameter)

Return the constraint type.

Parameters:

parameter (float) – the parameter in Angstrom

Return type:

str

Returns:

the constraint type

schrodinger.application.matsci.packmol.get_writer(surfactant_infos, solvent_infos, base_name, seed, n_loop, cell_lengths, packing_f, model_type, allow_ring_spears, penalty_factor_ring_spears, radius_factor_ring_spears, **kwargs)

Get the writer.

Parameters:
  • surfactant_infos (list[SurfactantInfo]) – contains surfactant infos

  • solvent_infos (list[SolventInfo]) – contains solvent infos

  • base_name (str) – base name used for output file naming

  • seed (int) – seed for random

  • n_loop (int) – the number of packmol loops

  • cell_lengths (tuple[float]) – the cell lengths in Angstrom

  • packing_f (float) – the packing factor

  • model_type (str) – the model type, a key in the class map

  • allow_ring_spears (bool) – if True then allow ring-spears

  • penalty_factor_ring_spears (float) – the penalty factor for ring-spears

  • radius_factor_ring_spears (float) – the radius factor for ring-spears

Return type:

StructuredLiquidInputFile

Returns:

the writer

schrodinger.application.matsci.packmol.get_parser(description, packmol_input=True)

Get the command line argument parser.

Parameters:
  • description (str) – the description

  • packmol_input (bool) – whether the input is a packmol input file

Return type:

DriverParser

Returns:

command line argument parser

schrodinger.application.matsci.packmol.get_job_spec_from_args(argv, description, program_name='Structured Liquid', default_job_name='structured_liquid', packmol_input=True)

Return a JobSpecification.

Parameters:
  • argv (list) – command line arguments including the script name at [0]

  • description (str) – the description

  • program_name (str) – the program name

  • default_job_name (str) – the default job name

  • packmol_input (bool) – whether the input is a packmol input file

Return type:

JobSpecification

Returns:

the JobSpecification

schrodinger.application.matsci.packmol.main(description, *args, default_job_name='structured_liquid')

Main function used by drivers to run packmol.

Parameters:
  • description (str) – the parser description

  • default_job_name (str) – the default job name

schrodinger.application.matsci.packmol.get_surfactant_infos(slb_dict)

Return surfactant information from the given dictionary of structured liquid builder options. Maestro files referenced within must exist in the current working directory.

Parameters:

slb_dict (dict) – contains structured liquid builder options

Raises:

RuntimeError – if there is an issue

Return type:

list[SurfactantInfo], list[str]

Returns:

the surfactant information objects and any extra structure file flags

schrodinger.application.matsci.packmol.get_solvent_infos(slb_dict)

Return solvent information from the given dictionary of structured liquid builder options. Maestro files referenced within must exist in the current working directory.

Parameters:

slb_dict (dict) – contains structured liquid builder options

Raises:

RuntimeError – if there is an issue

Return type:

list[SolventInfo]

Returns:

the solvent information objects

schrodinger.application.matsci.packmol.write_packmol_input_file(slb_dict, box_lengths, allow_ring_spears=False, penalty_factor_ring_spears=10, radius_factor_ring_spears=1)

Write the packmol input file from the given dictionary of structured liquid builder options.

Parameters:
  • slb_dict (dict) – contains structured liquid builder options

  • box_lengths (tuple[float]) – the cell lengths in Angstrom

  • allow_ring_spears (bool) – if True then allow ring-spears

  • penalty_factor_ring_spears (float) – the penalty factor for ring-spears

  • radius_factor_ring_spears (float) – the radius factor for ring-spears

Raises:

RuntimeError – if there is an issue

Return type:

str, list[str]

Returns:

the packmol input file name and any extra structure file flags