pysimm.system¶
Module Contents¶
Classes¶
pysimm.system.Particle |
|
pysimm.system.ParticleType |
|
pysimm.system.Bond |
|
pysimm.system.BondType |
|
pysimm.system.Angle |
|
pysimm.system.AngleType |
|
pysimm.system.Dihedral |
|
pysimm.system.DihedralType |
|
pysimm.system.Improper |
|
pysimm.system.ImproperType |
|
pysimm.system.Dimension |
|
pysimm.system.System |
|
pysimm.system.Molecule |
Functions¶
|
pysimm.system.read_yaml |
|
pysimm.system.read_xyz |
|
pysimm.system.read_chemdoodle_json |
|
pysimm.system.read_lammps |
|
pysimm.system.read_pubchem_smiles |
|
pysimm.system.read_pubchem_smiles |
|
pysimm.system.read_cml |
|
pysimm.system.read_mol |
|
pysimm.system.read_mol2 |
|
pysimm.system.read_prepc |
|
pysimm.system.read_ac |
|
pysimm.system.read_pdb |
|
|
|
pysimm.system.get_types |
pysimm.system.distance_to_origin |
|
|
pysimm.system.replicate |
Attributes¶
- class pysimm.system.Particle(**kwargs)[source]¶
Bases:
pysimm.utils.Itempysimm.system.Particle
Objects inheriting from
Itemcan contain arbitrary data. Keyword arguments are assigned as attributes. Attributes usually used are given below.- x¶
x coordinate
- y¶
y coordinate
- z¶
z coordinate
- charge¶
partial charge
- type¶
ParticleTypeobject reference
- delete_bonding(self, s)[source]¶
pysimm.system.Particle.delete_bonding
Iterates through s.bonds, s.angles, s.dihedrals, and s.impropers and removes those which contain this
Particle.- Parameters
s –
Systemobject from which bonding objects will be removed- Returns
None
- translate(self, dx, dy, dz)[source]¶
pysimm.system.Particle.translate
Shifts Particle position by dx, dy, dz.
- Parameters
dx – distance to shift in x direction
dy – distance to shift in y direction
dz – distance to shift in z direction
- Returns
None
- __sub__(self, other)[source]¶
pysimm.system.Particle.__sub__
Implements subtraction between
Particleobjects to calculate distance.- Parameters
other –
Particleobject- Returns
distance calculated by
distance(). This does not consider pbc
- class pysimm.system.ParticleType(**kwargs)[source]¶
Bases:
pysimm.utils.Itempysimm.system.ParticleType
Objects inheriting from
Itemcan contain arbitrary data. Keyword arguments are assigned as attributes. Attributes usually used are given below.- sigma¶
LJ sigma value (Angstrom)
- epsilon¶
LJ epsilon value (kcal/mol)
- elem¶
element abbreviation, i.e. ‘H’ for Hydrogen, ‘Cl’ for Chlorine
- name¶
force field particle type name
- form(self, style='lj_12-6', d_range=None)[source]¶
pysimm.system.ParticleType.form
Returns data to plot functional form for the potential energy with the given style.
- Parameters
style – string for pair style of ParticleType (lj_12-6, lj_9-6, buck)
- Returns
x, y for plotting functional form (energy vs distance)
- write_lammps(self, style='lj')[source]¶
pysimm.system.ParticleType.write_lammps
Formats a string to define particle type coefficients for a LAMMPS data file given the provided style.
- Parameters
style – string for pair style of ParticleType (lj, class2, mass, buck)
- Returns
LAMMPS formatted string with pair coefficients
- class pysimm.system.Bond(**kwargs)[source]¶
Bases:
pysimm.utils.Itempysimm.system.Bond
Bond between particle a and b
a–b
Objects inheriting from
Itemcan contain arbitrary data. Keyword arguments are assigned as attributes. Attributes usually used are given below.- type¶
BondType object reference
- class pysimm.system.BondType(**kwargs)[source]¶
Bases:
pysimm.utils.Itempysimm.system.BondType
Objects inheriting from
Itemcan contain arbitrary data. Keyword arguments are assigned as attributes. Attributes usually used are given below.- k¶
harmonic bond force constant (kcal/mol/A^2)
- r0¶
bond equilibrium distance (Angstrom)
- name¶
force field bond type name
- write_lammps(self, style='harmonic')[source]¶
pysimm.system.BondType.write_lammps
Formats a string to define bond type coefficients for a LAMMPS data file given the provided style.
- Parameters
style – string for pair style of BondType (harmonic, class2)
- Returns
LAMMPS formatted string with bond coefficients
- class pysimm.system.Angle(**kwargs)[source]¶
Bases:
pysimm.utils.Itempysimm.system.Angle
Angle between particles a, b, and c
a–b–c
Objects inheriting from
Itemcan contain arbitrary data. Keyword arguments are assigned as attributes. Attributes usually used are given below.- type¶
AngleType object reference
- class pysimm.system.AngleType(**kwargs)[source]¶
Bases:
pysimm.utils.Itempysimm.system.AngleType
Objects inheriting from
Itemcan contain arbitrary data. Keyword arguments are assigned as attributes. Attributes usually used are given below.- k¶
harmonic angle bend force constant (kcal/mol/radian^2)
- theta0¶
angle equilibrium value (degrees)
- name¶
force field angle type name
- write_lammps(self, style='harmonic', cross_term=None)[source]¶
pysimm.system.AngleType.write_lammps
Formats a string to define angle type coefficients for a LAMMPS data file given the provided style.
- Parameters
style – string for pair style of AngleType (harmonic, class2, charmm)
cross_term – type of class2 cross term to write (default=None) - BondBond - BondAngle
- Returns
LAMMPS formatted string with angle coefficients
- form(self, style='harmonic', d_range=None)[source]¶
pysimm.system.AngleType.form
Returns data to plot functional form for the potential energy with the given style.
- Parameters
style – string for pair style of AngleType (harmonic, class2, charmm)
- Returns
x, y for plotting functional form (energy vs angle)
- class pysimm.system.Dihedral(**kwargs)[source]¶
Bases:
pysimm.utils.Itempysimm.system.Dihedral
Dihedral between particles a, b, c, and d
a–b–c–d
Objects inheriting from
Itemcan contain arbitrary data. Keyword arguments are assigned as attributes. Attributes usually used are given below.- type¶
DihedralTypeobject reference
- class pysimm.system.DihedralType(**kwargs)[source]¶
Bases:
pysimm.utils.Itempysimm.system.DihedralType
Objects inheriting from
Itemcan contain arbitrary data. Keyword arguments are assigned as attributes. Attributes usually used are given below.- k¶
dihedral energy barrier (kcal/mol)
- d¶
minimum (+1 or -1)
- n¶
multiplicity (integer >= 0)
- name¶
force field dihedral type name
- write_lammps(self, style='harmonic', cross_term=None)[source]¶
pysimm.system.DihedralType.write_lammps
Formats a string to define dihedral type coefficients for a LAMMPS data file given the provided style.
- Parameters
style – string for pair style of DihedralType (harmonic, class2, fourier)
cross_term – type of class2 cross term to write (default=None) - MiddleBond - EndBond - Angle - AngleAngle - BondBond13
- Returns
LAMMPS formatted string with dihedral coefficients
- form(self, style='harmonic', d_range=None)[source]¶
pysimm.system.DihedralType.form
Returns data to plot functional form for the potential energy with the given style.
- Parameters
style – string for pair style of DihedralType (harmonic, class2, fourier)
- Returns
x, y for plotting functional form (energy vs angle)
- class pysimm.system.Improper(**kwargs)[source]¶
Bases:
pysimm.utils.Itempysimm.system.Improper
Improper dihedral around particle a, bonded to b, c, and d
Objects inheriting from
Itemcan contain arbitrary data. Keyword arguments are assigned as attributes. Attributes usually used are given below.- type¶
ImproperTypeobject reference
- class pysimm.system.ImproperType(**kwargs)[source]¶
Bases:
pysimm.utils.Itempysimm.system.ImproperType
Objects inheriting from
Itemcan contain arbitrary data. Keyword arguments are assigned as attributes. Attributes usually used are given below.- k¶
improper energy barrier (kcal/mol)
- x0¶
equilibrium value (degrees)
- name¶
force field improper type name
- write_lammps(self, style='harmonic', cross_term=None)[source]¶
pysimm.system.ImproperType.write_lammps
Formats a string to define improper type coefficients for a LAMMPS data file given the provided style.
- Parameters
style – string for pair style of ImproperType (harmonic, class2, cvff)
cross_term – type of class2 cross term to write (default=None) - AngleAngle
- Returns
LAMMPS formatted string with dihedral coefficients
- form(self, style='harmonic', d_range=None)[source]¶
pysimm.system.ImproperType.form
Returns data to plot functional form for the potential energy with the given style.
- Parameters
style – string for pair style of ImproperType (harmonic, cvff)
- Returns
x, y for plotting functional form (energy vs angle)
- class pysimm.system.Dimension(**kwargs)[source]¶
Bases:
pysimm.utils.Itempysimm.system.Dimension
Objects inheriting from
Itemcan contain arbitrary data. Keyword arguments are assigned as attributes. Attributes usually used are given below.- xlo¶
minimum value in x dimension
- xhi¶
maximum value in x dimension
- ylo¶
minimum value in y dimension
- yhi¶
maximum value in y dimension
- zlo¶
minimum value in z dimension
- zhi¶
maximum value in z dimension
- class pysimm.system.System(**kwargs)[source]¶
Bases:
objectpysimm.system.System
Object representation of molecular system. Contains information required for molecular simulation.
- dim¶
Dimension object reference
- particles¶
ItemContainerfor Particle organization
- particle_types¶
ItemContainerfor ParticleType organization
- bonds¶
ItemContainerfor Bond organization
- bond_types¶
ItemContainerfor BondType organization
- angles¶
ItemContainerfor Angle organization
- angle_types¶
ItemContainerfor AngleType organization
- dihedrals¶
ItemContainerfor Dihedral organization
- dihedral_types¶
ItemContainerfor DihedralType organization
- impropers¶
ItemContainerfor Improper organization
- improper_types¶
ItemContainerfor ImproperType organization
- molecules¶
ItemContainerfor Molecule organization
- copy(self, rotate_x=None, rotate_y=None, rotate_z=None, dx=0, dy=0, dz=0)[source]¶
pysimm.system.System.copy
Create duplicate
Systemobject. Default behavior does not modify particle positions.- Parameters
rotate_x – rotate duplicate system around x axis by this value (radians)
rotate_y – rotate duplicate system around y axis by this value (radians)
rotate_z – rotate duplicate system around z axis by this value (radians)
dx – translate duplicate system in x dimension by this value (Angstrom)
dy – translate duplicate system in y dimension by this value (Angstrom)
dz – translate duplicate system in z dimension by this value (Angstrom)
- add(self, other, **kwargs)[source]¶
pysimm.system.System.add
Add other
Systemto this. Optionally remove duplicate types (default behavior).- Parameters
other –
Systemobject to addunique_types (optional) – Remove duplicate types and reassign references to existing types (True)
change_dim (optional) – Update
Dimensionobject so thatParticleobjects do not exist outside ofDimensionextremes (True)update_properties (optional) – Update system-wide mass, volume, density, center of gravity, and velocity properties (True)
- distance(self, p1, p2)[source]¶
pysimm.system.System.distance
Calculate distance between two particles considering pbc.
- wrap(self)[source]¶
pysimm.system.System.wrap
Wrap
Particleimages into box defined byDimensionobject. Ensure particles are contained within simulation box.- Parameters
None –
- Returns
None
- unwrap(self)[source]¶
pysimm.system.System.unwrap()
Unwraps
Particleimages such that no bonds cross box edges.- Parameters
None –
- Returns
None
- quality(self, tolerance=0.1)[source]¶
pysimm.system.System.quality
Attemps to assess quality of
Systembased on bond lengths in unwrapped system.- Parameters
tolerance – fractional value of equilibrium bond length that is acceptable
- Returns
number of bonds in system outside tolerance
- shift_to_origin(self)[source]¶
pysimm.system.System.shift_to_origin
Shifts simulation box to begin at origin. i.e. xlo=ylo=zlo=0
- Parameters
None –
- Returns
None
- set_charge(self)[source]¶
pysimm.system.System.set_charge
Sets total charge of all
Particleobjects in System.particles- Parameters
None –
- Returns
None
- zero_charge(self)[source]¶
pysimm.system.System.zero_charge
Enforces total
Systemcharge to be 0.0 by subtracting excess charge from last particle- Parameters
None –
- Returns
None
- check_items(self)[source]¶
pysimm.system.System.check_items
Checks particles, bonds, angles, dihedrals, impropers, and molecules containers and raises exception if the length of items in the container does not equal the count property
- Parameters
None –
- Returns
None
- update_ff_types_from_ac(self, ff, acname)[source]¶
pysimm.system.System.update_ff_types_from_ac
Updates
ParticleTypeobjects in system using type names given in antechamber (ac) file. Retrieves type from System if possible, then searches force field provided by ff.- Parameters
ff – forcefield to search for Type objects
acname – ac filename containing type names
- Returns
None
- update_particle_types_from_forcefield(self, f)[source]¶
pysimm.system.System.update_types_from_forcefield
Updates
ParticleTypedata fromForcefieldobject f based onParticleType.name- Parameters
f –
Forcefieldobject reference- Returns
None
- make_linker_types(self)[source]¶
pysimm.system.System.make_linker_types
Identifies linker particles and creates duplicate
Particle.linker attribute. NewParticleTypename is prepended with [H or T]L@ to designate head or tail linker- Parameters
None –
- Returns
None
- remove_linker_types(self)[source]¶
pysimm.system.System.remove_linker_types
Reassigns
Particle.type references to originalParticleTypeobjects without linker prepend- Parameters
None –
- Returns
None
- read_lammps_dump(self, fname)[source]¶
pysimm.system.System.read_lammps_dump
Updates particle positions and box size from LAMMPS dump file. Assumes following format for each atom line:
tag charge xcoord ycoord zcoord xvelocity yvelocity zvelocity
- Parameters
fname – LAMMPS dump file
- Returns
None
- read_lammpstrj(self, trj, frame=1)[source]¶
pysimm.system.System.read_lammpstrj
Updates particle positions and box size from LAMMPS trajectory file at given frame.
Assumes one of following formats for each atom line:
tag xcoord ycoord zcoord
OR
tag type_id xcoord ycoord zcoord
OR
tag type_id xcoord ycoord zcoord ximage yimage zimage
- Parameters
trj – LAMMPS trajectory file
frame – sequential frame number (not LAMMPS timestep) default=1
- Returns
None
- read_xyz(self, xyz, frame=1, quiet=False)[source]¶
pysimm.system.System.read_xyz
Updates particle positions and box size from xyz file at given frame
- Parameters
xyz – xyz trajectory file
frame – sequential frame number default=1
quiet – True to print status default=False
- Returns
None
- update_types(self, ptypes, btypes, atypes, dtypes, itypes)[source]¶
pysimm.system.System.update_types
Updates type objects from a given list of types.
- Parameters
ptypes – list of
ParticleTypeobjects from which to updatebtypes – list of
BondTypeobjects from which to updateatypes – list of
AngleTypeobjects from which to updatedtypes – list of
DihedralTypeobjects from which to updateitypes – list of
ImproperTypeobjects from which to update
- read_type_names(self, types_file)[source]¶
pysimm.system.System.read_type_names
Update
ParticleTypenames from file.- Parameters
types_file – type dictionary file name
- Returns
None
- remove_spare_bonding(self, update_tags=True)[source]¶
pysimm.system.System.remove_spare_bonding
Removes bonds, angles, dihedrals and impropers that reference particles not in
System.particles- Parameters
update_tags – True to update all tags after removal of bonding items default=True
- update_tags(self)[source]¶
pysimm.system.System.update_tags
Update Item tags in
ItemContainerobjects to preserve continuous tags. Removes all objects and then reinserts them.- Args:
None
- Returns:
None
- set_references(self)[source]¶
pysimm.system.System.set_references
Set object references when
Systeminformation read from text file. For example, if bond type value 2 is read from file, setBond.type to bond_types[2]- Parameters
None –
- Returns
None
- objectify(self)[source]¶
pysimm.system.System.objectify
Set references for
Bond,Angle,Dihedral,Improperobjects. For example, if read from file that bond #1 is between particle 1 and 2 setBond.a to particles[1], etc.- Parameters
None –
- Returns
None
- add_particle_bonding(self)[source]¶
pysimm.system.System.add_particle_bonding
Update
Particleobjects such thatParticle.bonded_to contains otherParticleobjects invloved in bonding- Parameters
None –
- Returns
None
- set_excluded_particles(self, bonds=True, angles=True, dihedrals=True)[source]¶
pysimm.system.System.set_excluded_particles
Updates
Particleobject such thatParticle.excluded_particles contains otherParticleobjects involved in 1-2, 1-3, and/or 1-4 interactions- Parameters
bonds – exclude particles involved in 1-2 interactions
angles – exclude particles involved in 1-3 interactions
dihedrals – exclude particles involved in 1-4 interactions
- set_atomic_numbers(self)[source]¶
pysimm.system.System.set_atomic_numbers
Updates
ParticleTypeobjects with atomic number based onParticleType.elem- Parameters
None –
- Returns
None
- add_particle_bonded_to(self, p, p0, f=None, sep=1.5)[source]¶
pysimm.system.System.add_particle_bonded_to
Add new
ParticletoSystembonded to p0 and automatically update new forcefield types- Parameters
p – new
Particleobject to be addedp0 – original
Particleobject inSystemto which p will be bondedf –
Forcefieldobject from which new force field types will be retrieved
- Returns
new Particle being added to system for convenient reference
- add_particle(self, p)[source]¶
pysimm.system.System.add_particle
- Parameters
p – new
Particleobject to be added- Returns
None
- rotate(self, around=None, theta_x=0, theta_y=0, theta_z=0, rot_matrix=None)[source]¶
pysimm.system.System.rotate
* REQUIRES NUMPY *
Rotates entire system around given
Particleby user defined angles- Parameters
around –
Particlearound whichSystemwill be rotated default=Nonetheta_x – angle around which system will be rotated on x axis
theta_y – angle around which system will be rotated on y axis
theta_z – angle around which system will be rotated on z axis
rot_matrix – rotation matrix to use for rotation
- Returns
None
- make_new_bonds(self, p1=None, p2=None, f=None, angles=True, dihedrals=True, impropers=True)[source]¶
pysimm.system.System.make_new_bonds
Makes new bond between two particles and updates new force field types
- Parameters
p1 –
Particleobject involved in new bondp2 –
Particleobject involved in new bondf –
Forcefieldobject from which new force field types will be retrievedangles – True to update new angles default=True
dihedrals – True to update new dihedrals default=True
impropers – True to update new impropers default=True
- Returns
None
- add_bond(self, a=None, b=None, f=None)[source]¶
pysimm.system.System.add_bond
Add
Bondto system between two particles- Parameters
f –
Forcefieldobject from which new force field type will be retrieved
- Returns
None
- add_angle(self, a=None, b=None, c=None, f=None)[source]¶
pysimm.system.System.add_angle
Add
Angleto system between three particles
- add_dihedral(self, a=None, b=None, c=None, d=None, f=None)[source]¶
pysimm.system.System.add_dihedral
Add
Dihedralto system between four particles
- add_improper(self, a=None, b=None, c=None, d=None, f=None)[source]¶
pysimm.system.System.add_improper
Add
Improperto system between four particles
- check_forcefield(self)[source]¶
pysimm.system.System.check_forcefield
Iterates through particles and prints the following:
tag type name type element type description bonded elements
- Parameters
None –
- Returns
None
- apply_forcefield(self, f, charges='default', set_box=True, box_padding=10, update_ptypes=False, skip_ptypes=False)[source]¶
pysimm.system.System.apply_forcefield
Applies force field data to
Systembased on typing rules defined inForcefieldobject f- Parameters
f –
Forcefieldobject from which new force field type will be retrievedcharges – type of charges to be applied default=’default’
set_box – Update simulation box information based on particle positions default=True
box_padding – Add padding to simulation box if updating dimensions default=10 (Angstroms)
update_ptypes – If True, update particle types based on current
ParticleTypenames default=Falseskip_ptypes – if True, do not change particle types
- Returns
None
- apply_charges(self, f, charges='default')[source]¶
pysimm.system.System.apply_charges
Applies charges derived using method provided by user. Defaults to ‘default’. Calls
assign_charges()method of forcefield object provided.- Parameters
f –
Forcefieldobjectcharges – type of charges to be applied default=’default’
- Returns
None
- write_lammps_mol(self, out_data)[source]¶
pysimm.system.System.write_lammps_mol
Write
Systemdata formatted as LAMMPS molecule template- Parameters
out_data – where to write data, file name or ‘string’
- Returns
None or string if data file if out_data=’string’
- write_lammps(self, out_data, **kwargs)[source]¶
pysimm.system.System.write_lammps
Write
Systemdata formatted for LAMMPS- Parameters
out_data – where to write data, file name or ‘string’
- Returns
None or string if data file if out_data=’string’
- write_xyz(self, outfile='data.xyz', **kwargs)[source]¶
pysimm.system.System.write_xyz
Write
Systemdata in xyz format- Parameters
outfile – where to write data, file name or ‘string’
- Returns
None or string of data file if out_data=’string’
- write_chemdoodle_json(self, outfile, **kwargs)[source]¶
pysimm.system.System.write_chemdoodle_json
Write
Systemdata in chemdoodle json format- Parameters
outfile – where to write data, file name or ‘string’
- Returns
None or string of data file if out_data=’string’
- write_mol(self, outfile='data.mol')[source]¶
pysimm.system.System.write_mol
Write
Systemdata in mol format- Parameters
outfile – where to write data, file name or ‘string’
- Returns
None or string of data file if out_data=’string’
- write_pdb(self, outfile='data.pdb', type_names=True)[source]¶
pysimm.system.System.write_pdb
Write
Systemdata in pdb format- Parameters
outfile – where to write data, file name or ‘string’
- Returns
None or string of data file if out_data=’string’
- write_yaml(self, file_)[source]¶
pysimm.system.System.write_yaml
Write
Systemdata in yaml format- Parameters
outfile – file name to write data
- Returns
None
- write_cssr(self, outfile='data.cssr', **kwargs)[source]¶
pysimm.system.System.write_cssr
Write
Systemdata in cssr format file format: line, format, contents 1: 38X, 3F8.3 : - length of the three cell parameters (a, b, and c) in angstroms. 2: 21X, 3F8.3, 4X, ‘SPGR =’, I3, 1X, A11 : - a, b, g in degrees, space group number, space group name. 3: 2I4, 1X, A60 : - Number of atoms stored, coordinate system flag (0=fractional, 1=orthogonal coordinates in Angstrom), first title. 4: A53 : - A line of text that can be used to describe the file. 5-: I4, 1X, A4, 2X, 3(F9.5.1X), 8I4, 1X, F7.3 : - Atom serial number, atom name, x, y, z coordinates, bonding connectivities (max 8), charge. Note: The atom name is a concatenation of the element symbol and the atom serial number.- Parameters
outfile – where to write data, file name or ‘string’
frac – 0 for using fractional coordinates
aname – 0 for using element as atom name; else using atom type name
- Returns
None or string of data file if out_data=’string’
- consolidate_types(self)[source]¶
pysimm.system.System.consolidate_types
Removes duplicate types and reassigns references
- Parameters
None –
- Returns
None
- set_cog(self)[source]¶
pysimm.system.System.set_cog
Calculate center of gravity of
Systemand assign toSystem.cog- Parameters
None –
- Returns
None
- shift_particles(self, shiftx, shifty, shiftz)[source]¶
pysimm.system.System.shift_particles
Shifts all particles by shiftx, shifty, shiftz. Recalculates cog.
- Parameters
shiftx – distance to shift particles in x direction
shifty – distance to shift particles in y direction
shiftz – distance to shift particles in z direction
- Returns
None
- center(self, what='particles', at=[0, 0, 0], move_both=True)[source]¶
pysimm.system.System.center
Centers particles center of geometry or simulation box at given coordinate. A vector is defined based on the current coordinate for the center of either the particles or the simulation box and the “at” parameter. This shift vector is applied to the entity defined by the “what” parameter. Optionally, both the particles and the box can be shifted by the same vector.
- Parameters
what – what is being centered: “particles” or “box”
at – new coordinate for center of particles or box
move_both – if True, determines vector for shift defined by “what” and “at” parameters, and applies shift to both particles and box. If false, only shift what is defined by “what” parameter.
- Returns
None
- center_system(self)[source]¶
pysimm.system.System.center_system
DEPRECATED: Use
System.center(‘box’, [0, 0, 0], True) instead- Parameters
None –
- Returns
None
- center_at_origin(self)[source]¶
pysimm.system.System.center_at_origin
DEPRECATED: Use
System.center(‘particles’, [0, 0, 0], True) instead- Parameters
None –
- Returns
None
- set_mass(self)[source]¶
pysimm.system.System.set_mass
Set total mass of particles in
System- Parameters
None –
- Returns
None
- set_volume(self)[source]¶
pysimm.system.System.set_volume
Set volume of
Systembased on Dimension- Parameters
None –
- Returns
None
- set_density(self)[source]¶
pysimm.system.System.set_density
Calculate density of
Systemfrom mass and volume- Parameters
None –
- Returns
None
- set_velocity(self)[source]¶
pysimm.system.System.set_velocity
Calculate total velocity of particles in
System- Parameters
None –
- Returns
None
- zero_velocity(self)[source]¶
pysimm.system.System.zero_velocity
Enforce zero shift velocity in
System- Parameters
None –
- Returns
None
- set_box(self, padding=0.0, center=True)[source]¶
pysimm.system.System.set_box
Update
System.dim with user defined padding. Used to construct a simulation box if it doesn’t exist, or adjust the size of the simulation box following system modifications.- Parameters
padding – add padding to all sides of box (Angstrom)
center – if True, place center of box at origin default=True
- Returns
None
- set_mm_dist(self, molecules=None)[source]¶
pysimm.system.System.set_mm_dist
Calculate molecular mass distribution (mainly for polymer systems). Sets
System.mw,System.mn, andSystem.disperisty- Parameters
molecules –
ItemContainerof molecules to calculate distributions defaul=’all’- Returns
None
- set_frac_free_volume(self, v_void=None)[source]¶
pysimm.system.System.set_frac_free_volume
Calculates fractional free volume from void volume and bulk density
- Parameters
v_void – void volume if not defined in
System.void_volume default=None- Returns
None
- visualize(self, vis_exec='vmd', **kwargs)[source]¶
pysimm.system.System.visualize
Visualize system in third party software with given executable. Software must accept pdb or xyz as first command line argument.
- Parameters
vis_exec – executable to launch visualization software default=’vmd’
unwrap (optional) – if True, unwrap
Systemfirst default=Noneformat (optional) – set format default=’xyz’
- Returns
None
- class pysimm.system.Molecule(**kwargs)[source]¶
Bases:
Systempysimm.system.Molecule
Very similar to
System, but requires less information
- pysimm.system.read_yaml(file_, **kwargs)[source]¶
pysimm.system.read_yaml
Interprets yaml file and creates
Systemobject- Parameters
file – yaml file name
- Returns
Systemobject
- pysimm.system.read_xyz(file_, **kwargs)[source]¶
pysimm.system.read_xyz
Interprets xyz file and creates
Systemobject- Parameters
file – xyz file name
quiet (optional) – if False, print status
- Returns
Systemobject
- pysimm.system.read_chemdoodle_json(file_, **kwargs)[source]¶
pysimm.system.read_chemdoodle_json
Interprets ChemDoodle JSON (Java Script Object Notation) file and creates
Systemobject- Parameters
file – json file name
quiet (optional) – if False, print status
- Returns
Systemobject
- pysimm.system.read_lammps(data_file, **kwargs)[source]¶
pysimm.system.read_lammps
Interprets LAMMPS data file and creates
Systemobject- Parameters
data_file – LAMMPS data file name
quiet (optional) – if False, print status
atom_style (optional) – option to let user override (understands charge, molecular, full)
pair_style (optional) – option to let user override
bond_style (optional) – option to let user override
angle_style (optional) – option to let user override
dihedral_style (optional) – option to let user override
improper_style (optional) – option to let user override
set_types (optional) – if True, objectify default=True
name (optional) – provide name for system
- Returns
Systemobject
- pysimm.system.read_pubchem_smiles(smiles, quiet=False, type_with=None)[source]¶
pysimm.system.read_pubchem_smiles
Interface with pubchem restful API to create molecular system from SMILES format
- Parameters
smiles – smiles formatted string of molecule
type_with –
Forcefieldobject to type with default=None
- Returns
Systemobject
- pysimm.system.read_pubchem_cid(cid, type_with=None)[source]¶
pysimm.system.read_pubchem_smiles
Interface with pubchem restful API to create molecular system from SMILES format
- Parameters
smiles – smiles formatted string of molecule
type_with –
Forcefieldobject to type with default=None
- Returns
Systemobject
- pysimm.system.read_cml(cml_file, **kwargs)[source]¶
pysimm.system.read_cml
Interprets cml file and creates
Systemobject- Parameters
cml_file – cml file name
linkers (optional) – if True, use spinMultiplicity to determine linker default=None
- Returns
Systemobject
- pysimm.system.read_mol(mol_file, type_with=None, version='V2000')[source]¶
pysimm.system.read_mol
Interprets mol file and creates
Systemobject- Parameters
mol_file – mol file name
f (optional) –
Forcefieldobject to get data fromversion – version of mol file to expect default=’V2000’
- Returns
Systemobject
- pysimm.system.read_mol2(mol2_file, type_with=None)[source]¶
pysimm.system.read_mol2
Interprets .mol2 file and creates
Systemobject- Parameters
mol_file2 – a full name (including path) of a Tripos Mol2 text file
type_with (optional) –
Forcefieldobject to use for attempt to assighnsystem (forcefield parameters to the) –
- Returns
Systemobject
- pysimm.system.read_prepc(prec_file)[source]¶
pysimm.system.read_prepc
Interprets prepc file and creates
Systemobject- Parameters
prepc_file – ac file name
- Returns
Systemobject
- pysimm.system.read_ac(ac_file)[source]¶
pysimm.system.read_ac
Interprets ac file and creates
Systemobject- Parameters
ac_file – ac file name
- Returns
Systemobject
- pysimm.system.read_pdb(pdb_file, str_file=None, **kwargs)[source]¶
pysimm.system.read_pdb
Interprets pdb file and creates
Systemobject- Parameters
pdb_file – pdb file name
- Keyword Arguments
str_file – (str) optional CHARMM topology (stream) file which can be used as source of charges and description
topology (of bonded) –
use_ptypes – (bool) flag to either use the forcefield atom type names from the .str file or not
- Returns
Systemobject
- pysimm.system.get_types(*arg, **kwargs)[source]¶
pysimm.system.get_types
Get unique type names from list of systems
- Parameters
write (optional) – if True, write types dictionary to filename
- Returns
(ptypes, btypes, atypes, dtypes, itypes) * for use with update_types *
- pysimm.system.distance_to_origin(p)[source]¶
pysimm.system.distance_to_origin
Calculates distance of particle to origin.
- Parameters
p – Particle object with x, y, and z attributes
- Returns
Distance of particle to origin
- pysimm.system.replicate(ref, nrep, s_=None, density=0.3, rand=True, print_insertions=True)[source]¶
pysimm.system.replicate
Replicates list of
Systemobjects into new (or exisintg)System. Can be random insertion.- Parameters
ref – reference :class:`~pysimm.system.System`(s) (this can be a list)
nrep – number of insertions to perform (can be list but must match length of ref)
s –
Systeminto which insertions will be performed default=Nonedensity – density of new
Systemdefault=0.3 (set to None to not change box)rand – if True, random insertion is performed
print_insertions – if True, update screen with number of insertions