mdfptools package¶
Subpackages¶
Submodules¶
mdfptools.Composer module¶
-
class
mdfptools.Composer.MDFP(mdfp_dict)[source]¶ Bases:
objectA MDFP object contains a set of features for a molecule, obtaining from a simulation or a set of simulations.
Methods
get_mdfp(self)- returns
-
__init__(self, mdfp_dict)[source]¶ - Parameters
fp_dict (dict) –
Keys are each of the type features a given Extractor obtains, e.g. “2d_count” are the 2D topological features obtained from molecule SMILES, “intra_lj” are the intra-molecular LJ energies obtained from simulation.
Values are the corresponding set of numerics, stored as lists.
-
class
mdfptools.Composer.BaseComposer[source]¶ Bases:
objectThe BaseComposer class containing functions that can be used by different composers for different types of simulations
Methods
run(smiles)- param smiles
SMILES string of the solute molecule
-
classmethod
_get_relevant_properties()[source]¶ Where the set of features to be included in the final MDFP are defined
-
classmethod
_get_2d_descriptors()[source]¶ Obtain those 2D topological features as described in the original publication.
-
classmethod
_get_statistical_moments(property_extractor, statistical_moments=[<function mean at 0x7f3b88a77730>, <function std at 0x7f3b88a778c8>, <function median at 0x7f3b8892d950>], **kwargs)[source]¶ Performs statistical weighting of the numerical properties (e.g. LJ and electrostatics energies) obtained from each frame of simulation.
- Parameters
property_extractor (mdfptools.Extractor) – The particular type of Extractor methodclass used to obtain the various properties from simulation.
statistical_moments (list) – The list of statistical weighting to be performed to each properties from all the frames. Default list of weighting are the mean, standard deviation and median.
-
__init__(self, /, *args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
class
mdfptools.Composer.SolutionComposer[source]¶ Bases:
mdfptools.Composer.BaseComposerComposer used to extract features from solution simulations, namely one copy of solute in water solvent. This generates fingerprint most akin to that from the original publication.
Methods
run(mdtraj_obj, parmed_obj[, smiles])- param mdtraj_obj
The simulated trajectory
-
classmethod
run(mdtraj_obj, parmed_obj, smiles=None, **kwargs)[source]¶ - Parameters
mdtraj_obj (mdtraj.trajectory) – The simulated trajectory
parmed_obj (parmed.structure) – Parmed object of the fully parameterised simulated system.
smiles (str) – SMILES string of the solute. If mdfptools.Parameteriser was used during parameterisation, then smiles is automatically obtained from the parmed_obj.
-
classmethod
_get_relevant_properties()[source]¶ Where the set of features to be included in the final MDFP are defined
-
__init__(self, /, *args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
classmethod
_get_2d_descriptors()¶ Obtain those 2D topological features as described in the original publication.
-
classmethod
_get_statistical_moments(property_extractor, statistical_moments=[<function mean at 0x7f3b88a77730>, <function std at 0x7f3b88a778c8>, <function median at 0x7f3b8892d950>], **kwargs)¶ Performs statistical weighting of the numerical properties (e.g. LJ and electrostatics energies) obtained from each frame of simulation.
- Parameters
property_extractor (mdfptools.Extractor) – The particular type of Extractor methodclass used to obtain the various properties from simulation.
statistical_moments (list) – The list of statistical weighting to be performed to each properties from all the frames. Default list of weighting are the mean, standard deviation and median.
-
class
mdfptools.Composer.LiquidComposer[source]¶ Bases:
mdfptools.Composer.BaseComposerComposer used to extract features from liquid simulations, namely a box containing replicates of the same molecule.
Methods
run(mdtraj_obj, parmed_obj[, smiles])- param mdtraj_obj
The simulated trajectory
-
classmethod
run(mdtraj_obj, parmed_obj, smiles=None, **kwargs)[source]¶ - Parameters
mdtraj_obj (mdtraj.trajectory) – The simulated trajectory
parmed_obj (parmed.structure) – Parmed object of the fully parameterised simulated system.
smiles (str) – SMILES string of one copy of the solute. If mdfptools.Parameteriser was used during parameterisation, then smiles is automatically obtained from the parmed_obj.
-
classmethod
_get_relevant_properties()[source]¶ Where the set of features to be included in the final MDFP are defined
-
__init__(self, /, *args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
classmethod
_get_2d_descriptors()¶ Obtain those 2D topological features as described in the original publication.
-
classmethod
_get_statistical_moments(property_extractor, statistical_moments=[<function mean at 0x7f3b88a77730>, <function std at 0x7f3b88a778c8>, <function median at 0x7f3b8892d950>], **kwargs)¶ Performs statistical weighting of the numerical properties (e.g. LJ and electrostatics energies) obtained from each frame of simulation.
- Parameters
property_extractor (mdfptools.Extractor) – The particular type of Extractor methodclass used to obtain the various properties from simulation.
statistical_moments (list) – The list of statistical weighting to be performed to each properties from all the frames. Default list of weighting are the mean, standard deviation and median.
-
class
mdfptools.Composer.SolutionLiquidComposer(solv_mdtraj_obj, solv_parmed_obj, liq_mdtraj_obj, liq_parmed_obj, smiles=None, **kwargs)[source]¶ Bases:
mdfptools.Composer.BaseComposerComposer used to extract features from pairs of solution and liquid simulations.
Methods
run(smiles)- param smiles
SMILES string of the solute molecule
-
classmethod
__init__(solv_mdtraj_obj, solv_parmed_obj, liq_mdtraj_obj, liq_parmed_obj, smiles=None, **kwargs)[source]¶ - Parameters
solv_mdtraj_obj (mdtraj.trajectory) – The simulated solution trajectory
solv_parmed_obj (parmed.structure) – Parmed object of the fully parameterised simulated solution system.
liq_mdtraj_obj (mdtraj.trajectory) – The simulated liquid trajectory
liq_parmed_obj (parmed.structure) – Parmed object of the fully parameterised simulated liquid system.
smiles (str) – SMILES string of one copy of the solute. If mdfptools.Parameteriser was used during parameterisation, then smiles is automatically obtained from the parmed_obj.
-
classmethod
_get_2d_descriptors()¶ Obtain those 2D topological features as described in the original publication.
-
classmethod
_get_statistical_moments(property_extractor, statistical_moments=[<function mean at 0x7f3b88a77730>, <function std at 0x7f3b88a778c8>, <function median at 0x7f3b8892d950>], **kwargs)¶ Performs statistical weighting of the numerical properties (e.g. LJ and electrostatics energies) obtained from each frame of simulation.
- Parameters
property_extractor (mdfptools.Extractor) – The particular type of Extractor methodclass used to obtain the various properties from simulation.
statistical_moments (list) – The list of statistical weighting to be performed to each properties from all the frames. Default list of weighting are the mean, standard deviation and median.
-
classmethod
run(smiles)¶ - Parameters
smiles (str) – SMILES string of the solute molecule
mdfptools.Extractor module¶
-
class
mdfptools.Extractor.BaseExtractor[source]¶ Bases:
objectWarning
The base class should not be used directly
Methods
extract_energies(mdtraj_obj, parmed_obj[, …])Extracting the various energetic components described in the original publication from each frame of simulation.
extract_rgyr(mdtraj_obj, \*\*kwargs)Extracting radius of gyration from each frame of simulation.
extract_sasa(mdtraj_obj, \*\*kwargs)Extracting solvent accessible surface area from each frame of simulation.
-
string_identifier= '!Should_Call_From_Inherited_Class'¶
-
classmethod
_extract_energies_helper(mdtraj_obj, parmed_obj, platform='CPU', **kwargs)[source]¶ Helper function for extracting the various energetic components described in the original publication from each frame of simulation. OpenMM.CustomNonbondedForces are used. Specifically, the reaction field defintion is taken from GROMOS96 manual.
- Parameters
mdtraj_obj (mdtraj.trajectory) – The simulated trajectory
parmed_obj (parmed.structure) – Parmed object of the fully parameterised simulated system.
platform (str) – The computing architecture to do the calculation, default to CPU, CUDA, OpenCL is also possible.
- Returns
context (Openmm.Context)
integrator (Openmm.Integrator)
-
classmethod
extract_energies(mdtraj_obj, parmed_obj, platform='CPU', **kwargs)[source]¶ Extracting the various energetic components described in the original publication from each frame of simulation.
- Parameters
mdtraj_obj (mdtraj.trajectory) – The simulated trajectory
parmed_obj (parmed.structure) – Parmed object of the fully parameterised simulated system.
platform (str) – The computing architecture to do the calculation, default to CPU, CUDA, OpenCL is also possible.
- Returns
df – Keys are each of the energetic type features. e.g. “intra_lj” are the intra-molecular LJ energies obtained from simulation.
Values are the corresponding set of numerics, stored as lists.
- Return type
dict
-
classmethod
extract_rgyr(mdtraj_obj, **kwargs)[source]¶ Extracting radius of gyration from each frame of simulation. Assumes the first residue in the system is the solute.
- Parameters
mdtraj_obj (mdtraj.trajectory) – The simulated trajectory
- Returns
df – Key is prefix_rgyr, where prefix changes depending on the type of Extractor class used. Values are the corresponding set of numerics, stored as lists.
- Return type
dict
-
classmethod
extract_sasa(mdtraj_obj, **kwargs)[source]¶ Extracting solvent accessible surface area from each frame of simulation. Assumes the first residue in the system is the solute.
- Parameters
mdtraj_obj (mdtraj.trajectory) – The simulated trajectory
- Returns
df – Key is prefix_sasa, where prefix changes depending on the type of Extractor class used. Values are the corresponding set of numerics, stored as lists.
- Return type
dict
-
__init__(self, /, *args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
-
class
mdfptools.Extractor.SolutionExtractor[source]¶ Bases:
mdfptools.Extractor.BaseExtractorExtraction from condensed phase simulation where the system is composed of one solute molecule surronded by solvents
- Parameters
string_identifier (str) – The string identifier tagged as prefix to all values extracted in this class.
Methods
extract_dipole(mdtraj_obj, parmed_obj, …)Extracting dipole moment from each frame of simulation.
extract_energies(mdtraj_obj, parmed_obj[, …])Extracting the various energetic components described in the original publication from each frame of simulation.
extract_rgyr(mdtraj_obj, \*\*kwargs)Extracting radius of gyration from each frame of simulation.
extract_sasa(mdtraj_obj, \*\*kwargs)Extracting solvent accessible surface area from each frame of simulation.
-
string_identifier= 'solution'¶
-
classmethod
_solute_solvent_split(topology)[source]¶ Distinguish solutes from solvents, used in
_extract_energies_helper()- The following is assumed:
there are only two type of residues
the residue that is lesser in number is the solute
- Parameters
topology (parmed.topology) –
- Returns
solute_atoms (set) – set of solute_atoms indices
solvent_atoms (set) – set of solvent_atoms indices
-
classmethod
_get_all_exception_atom_pairs(system, topology)[source]¶ Using the parametersied system to obtain the exception and exclusion pairs, used in
_extract_energies_helper(). This is inferred purely from the parameterised system and connectivity.- Parameters
system (OpenMM.System) –
topology (parmed.topology) –
- Returns
solute_1_4_pairs (set)
solvent_1_4_pairs (set)
solute_excluded_pairs (set)
solvent_excluded_pairs (set)
solute_self_pairs (set)
solvent_self_pairs (set)
-
classmethod
extract_dipole(mdtraj_obj, parmed_obj, **kwargs)[source]¶ Extracting dipole moment from each frame of simulation. Assumes the first residue in the system is the solute.
- Parameters
mdtraj_obj (mdtraj.trajectory) – The simulated trajectory
parmed_obj (parmed.structure) – Parmed object of the fully parameterised simulated system.
- Returns
df – Key is prefix_dipole_postfix, where prefix changes depending on the type of Extractor class used, postfix can be {x,y,z,magnitude}. Values are the corresponding set of numerics, stored as lists.
- Return type
dict
-
__init__(self, /, *args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
classmethod
_extract_energies_helper(mdtraj_obj, parmed_obj, platform='CPU', **kwargs)¶ Helper function for extracting the various energetic components described in the original publication from each frame of simulation. OpenMM.CustomNonbondedForces are used. Specifically, the reaction field defintion is taken from GROMOS96 manual.
- Parameters
mdtraj_obj (mdtraj.trajectory) – The simulated trajectory
parmed_obj (parmed.structure) – Parmed object of the fully parameterised simulated system.
platform (str) – The computing architecture to do the calculation, default to CPU, CUDA, OpenCL is also possible.
- Returns
context (Openmm.Context)
integrator (Openmm.Integrator)
-
classmethod
extract_energies(mdtraj_obj, parmed_obj, platform='CPU', **kwargs)¶ Extracting the various energetic components described in the original publication from each frame of simulation.
- Parameters
mdtraj_obj (mdtraj.trajectory) – The simulated trajectory
parmed_obj (parmed.structure) – Parmed object of the fully parameterised simulated system.
platform (str) – The computing architecture to do the calculation, default to CPU, CUDA, OpenCL is also possible.
- Returns
df – Keys are each of the energetic type features. e.g. “intra_lj” are the intra-molecular LJ energies obtained from simulation.
Values are the corresponding set of numerics, stored as lists.
- Return type
dict
-
classmethod
extract_rgyr(mdtraj_obj, **kwargs)¶ Extracting radius of gyration from each frame of simulation. Assumes the first residue in the system is the solute.
- Parameters
mdtraj_obj (mdtraj.trajectory) – The simulated trajectory
- Returns
df – Key is prefix_rgyr, where prefix changes depending on the type of Extractor class used. Values are the corresponding set of numerics, stored as lists.
- Return type
dict
-
classmethod
extract_sasa(mdtraj_obj, **kwargs)¶ Extracting solvent accessible surface area from each frame of simulation. Assumes the first residue in the system is the solute.
- Parameters
mdtraj_obj (mdtraj.trajectory) – The simulated trajectory
- Returns
df – Key is prefix_sasa, where prefix changes depending on the type of Extractor class used. Values are the corresponding set of numerics, stored as lists.
- Return type
dict
-
class
mdfptools.Extractor.TrialSolutionExtractor[source]¶ Bases:
mdfptools.Extractor.SolutionExtractorMethods
extract_dipole(mdtraj_obj, parmed_obj, …)Extracting dipole moment from each frame of simulation.
extract_energies(mdtraj_obj, parmed_obj[, …])Extracting the various energetic components described in the original publication from each frame of simulation.
extract_rgyr(mdtraj_obj, \*\*kwargs)Extracting radius of gyration from each frame of simulation.
extract_sasa(mdtraj_obj, \*\*kwargs)Extracting solvent accessible surface area from each frame of simulation.
-
string_identifier= 'TrialSolution'¶
-
classmethod
extract_energies(mdtraj_obj, parmed_obj, platform='CPU', **kwargs)[source]¶ Extracting the various energetic components described in the original publication from each frame of simulation.
- Parameters
mdtraj_obj (mdtraj.trajectory) – The simulated trajectory
parmed_obj (parmed.structure) – Parmed object of the fully parameterised simulated system.
platform (str) – The computing architecture to do the calculation, default to CPU, CUDA, OpenCL is also possible.
- Returns
df – Keys are each of the energetic type features. e.g. “intra_lj” are the intra-molecular LJ energies obtained from simulation.
Values are the corresponding set of numerics, stored as lists.
- Return type
dict
-
__init__(self, /, *args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
classmethod
_extract_energies_helper(mdtraj_obj, parmed_obj, platform='CPU', **kwargs)¶ Helper function for extracting the various energetic components described in the original publication from each frame of simulation. OpenMM.CustomNonbondedForces are used. Specifically, the reaction field defintion is taken from GROMOS96 manual.
- Parameters
mdtraj_obj (mdtraj.trajectory) – The simulated trajectory
parmed_obj (parmed.structure) – Parmed object of the fully parameterised simulated system.
platform (str) – The computing architecture to do the calculation, default to CPU, CUDA, OpenCL is also possible.
- Returns
context (Openmm.Context)
integrator (Openmm.Integrator)
-
classmethod
_get_all_exception_atom_pairs(system, topology)¶ Using the parametersied system to obtain the exception and exclusion pairs, used in
_extract_energies_helper(). This is inferred purely from the parameterised system and connectivity.- Parameters
system (OpenMM.System) –
topology (parmed.topology) –
- Returns
solute_1_4_pairs (set)
solvent_1_4_pairs (set)
solute_excluded_pairs (set)
solvent_excluded_pairs (set)
solute_self_pairs (set)
solvent_self_pairs (set)
-
classmethod
_solute_solvent_split(topology)¶ Distinguish solutes from solvents, used in
_extract_energies_helper()- The following is assumed:
there are only two type of residues
the residue that is lesser in number is the solute
- Parameters
topology (parmed.topology) –
- Returns
solute_atoms (set) – set of solute_atoms indices
solvent_atoms (set) – set of solvent_atoms indices
-
classmethod
extract_dipole(mdtraj_obj, parmed_obj, **kwargs)¶ Extracting dipole moment from each frame of simulation. Assumes the first residue in the system is the solute.
- Parameters
mdtraj_obj (mdtraj.trajectory) – The simulated trajectory
parmed_obj (parmed.structure) – Parmed object of the fully parameterised simulated system.
- Returns
df – Key is prefix_dipole_postfix, where prefix changes depending on the type of Extractor class used, postfix can be {x,y,z,magnitude}. Values are the corresponding set of numerics, stored as lists.
- Return type
dict
-
classmethod
extract_rgyr(mdtraj_obj, **kwargs)¶ Extracting radius of gyration from each frame of simulation. Assumes the first residue in the system is the solute.
- Parameters
mdtraj_obj (mdtraj.trajectory) – The simulated trajectory
- Returns
df – Key is prefix_rgyr, where prefix changes depending on the type of Extractor class used. Values are the corresponding set of numerics, stored as lists.
- Return type
dict
-
classmethod
extract_sasa(mdtraj_obj, **kwargs)¶ Extracting solvent accessible surface area from each frame of simulation. Assumes the first residue in the system is the solute.
- Parameters
mdtraj_obj (mdtraj.trajectory) – The simulated trajectory
- Returns
df – Key is prefix_sasa, where prefix changes depending on the type of Extractor class used. Values are the corresponding set of numerics, stored as lists.
- Return type
dict
-
-
class
mdfptools.Extractor.WaterExtractor[source]¶ Bases:
mdfptools.Extractor.SolutionExtractorSynonyms class as SolutionExtractor
- Parameters
string_identifier (str) – The string identifier tagged as prefix to all values extracted in this class.
Methods
extract_dipole(mdtraj_obj, parmed_obj, …)Extracting dipole moment from each frame of simulation.
extract_energies(mdtraj_obj, parmed_obj[, …])Extracting the various energetic components described in the original publication from each frame of simulation.
extract_rgyr(mdtraj_obj, \*\*kwargs)Extracting radius of gyration from each frame of simulation.
extract_sasa(mdtraj_obj, \*\*kwargs)Extracting solvent accessible surface area from each frame of simulation.
-
string_identifier= 'water'¶
-
__init__(self, /, *args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
classmethod
_extract_energies_helper(mdtraj_obj, parmed_obj, platform='CPU', **kwargs)¶ Helper function for extracting the various energetic components described in the original publication from each frame of simulation. OpenMM.CustomNonbondedForces are used. Specifically, the reaction field defintion is taken from GROMOS96 manual.
- Parameters
mdtraj_obj (mdtraj.trajectory) – The simulated trajectory
parmed_obj (parmed.structure) – Parmed object of the fully parameterised simulated system.
platform (str) – The computing architecture to do the calculation, default to CPU, CUDA, OpenCL is also possible.
- Returns
context (Openmm.Context)
integrator (Openmm.Integrator)
-
classmethod
_get_all_exception_atom_pairs(system, topology)¶ Using the parametersied system to obtain the exception and exclusion pairs, used in
_extract_energies_helper(). This is inferred purely from the parameterised system and connectivity.- Parameters
system (OpenMM.System) –
topology (parmed.topology) –
- Returns
solute_1_4_pairs (set)
solvent_1_4_pairs (set)
solute_excluded_pairs (set)
solvent_excluded_pairs (set)
solute_self_pairs (set)
solvent_self_pairs (set)
-
classmethod
_solute_solvent_split(topology)¶ Distinguish solutes from solvents, used in
_extract_energies_helper()- The following is assumed:
there are only two type of residues
the residue that is lesser in number is the solute
- Parameters
topology (parmed.topology) –
- Returns
solute_atoms (set) – set of solute_atoms indices
solvent_atoms (set) – set of solvent_atoms indices
-
classmethod
extract_dipole(mdtraj_obj, parmed_obj, **kwargs)¶ Extracting dipole moment from each frame of simulation. Assumes the first residue in the system is the solute.
- Parameters
mdtraj_obj (mdtraj.trajectory) – The simulated trajectory
parmed_obj (parmed.structure) – Parmed object of the fully parameterised simulated system.
- Returns
df – Key is prefix_dipole_postfix, where prefix changes depending on the type of Extractor class used, postfix can be {x,y,z,magnitude}. Values are the corresponding set of numerics, stored as lists.
- Return type
dict
-
classmethod
extract_energies(mdtraj_obj, parmed_obj, platform='CPU', **kwargs)¶ Extracting the various energetic components described in the original publication from each frame of simulation.
- Parameters
mdtraj_obj (mdtraj.trajectory) – The simulated trajectory
parmed_obj (parmed.structure) – Parmed object of the fully parameterised simulated system.
platform (str) – The computing architecture to do the calculation, default to CPU, CUDA, OpenCL is also possible.
- Returns
df – Keys are each of the energetic type features. e.g. “intra_lj” are the intra-molecular LJ energies obtained from simulation.
Values are the corresponding set of numerics, stored as lists.
- Return type
dict
-
classmethod
extract_rgyr(mdtraj_obj, **kwargs)¶ Extracting radius of gyration from each frame of simulation. Assumes the first residue in the system is the solute.
- Parameters
mdtraj_obj (mdtraj.trajectory) – The simulated trajectory
- Returns
df – Key is prefix_rgyr, where prefix changes depending on the type of Extractor class used. Values are the corresponding set of numerics, stored as lists.
- Return type
dict
-
classmethod
extract_sasa(mdtraj_obj, **kwargs)¶ Extracting solvent accessible surface area from each frame of simulation. Assumes the first residue in the system is the solute.
- Parameters
mdtraj_obj (mdtraj.trajectory) – The simulated trajectory
- Returns
df – Key is prefix_sasa, where prefix changes depending on the type of Extractor class used. Values are the corresponding set of numerics, stored as lists.
- Return type
dict
-
class
mdfptools.Extractor.LiquidExtractor[source]¶ Bases:
mdfptools.Extractor.BaseExtractorExtraction from condensed phase simulation where the system is composed of one kind of molecule only.
- Parameters
string_identifier (str) – The string identifier tagged as prefix to all values extracted in this class.
Methods
extract_dipole_magnitude(mdtraj_obj, …)Extracting dipole moment magnitude from each frame of simulation.
extract_energies(mdtraj_obj, parmed_obj[, …])Extracting the various energetic components described in the original publication from each frame of simulation.
extract_h_bonds(mdtraj_obj, \*\*kwargs)http://mdtraj.org/1.8.0/api/generated/mdtraj.baker_hubbard.html#mdtraj.baker_hubbar
extract_rgyr(mdtraj_obj, \*\*kwargs)Extracting radius of gyration from each frame of simulation.
extract_sasa(mdtraj_obj, \*\*kwargs)Extracting solvent accessible surface area from each frame of simulation.
-
string_identifier= 'liquid'¶
-
classmethod
extract_h_bonds(mdtraj_obj, **kwargs)[source]¶ http://mdtraj.org/1.8.0/api/generated/mdtraj.baker_hubbard.html#mdtraj.baker_hubbar
-
classmethod
extract_dipole_magnitude(mdtraj_obj, parmed_obj, **kwargs)[source]¶ Extracting dipole moment magnitude from each frame of simulation. Assumes the first residue in the system is the solute.
- Parameters
mdtraj_obj (mdtraj.trajectory) – The simulated trajectory
parmed_obj (parmed.structure) – Parmed object of the fully parameterised simulated system.
- Returns
df – Key is prefix_dipole_magnitude, where prefix changes depending on the type of Extractor class used. Values are the corresponding set of numerics, stored as lists.
- Return type
dict
-
__init__(self, /, *args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
classmethod
_extract_energies_helper(mdtraj_obj, parmed_obj, platform='CPU', **kwargs)¶ Helper function for extracting the various energetic components described in the original publication from each frame of simulation. OpenMM.CustomNonbondedForces are used. Specifically, the reaction field defintion is taken from GROMOS96 manual.
- Parameters
mdtraj_obj (mdtraj.trajectory) – The simulated trajectory
parmed_obj (parmed.structure) – Parmed object of the fully parameterised simulated system.
platform (str) – The computing architecture to do the calculation, default to CPU, CUDA, OpenCL is also possible.
- Returns
context (Openmm.Context)
integrator (Openmm.Integrator)
-
classmethod
_solute_solvent_split(topology)[source]¶ Distinguish solutes from solvents, used in
_extract_energies_helper()- The following is assumed:
the first residue is the ‘solute’ , else ‘solvent’
- Parameters
topology (parmed.topology) –
- Returns
solute_atoms (set) – set of solute_atoms indices
solvent_atoms (set) – set of solvent_atoms indices
-
classmethod
extract_energies(mdtraj_obj, parmed_obj, platform='CPU', **kwargs)¶ Extracting the various energetic components described in the original publication from each frame of simulation.
- Parameters
mdtraj_obj (mdtraj.trajectory) – The simulated trajectory
parmed_obj (parmed.structure) – Parmed object of the fully parameterised simulated system.
platform (str) – The computing architecture to do the calculation, default to CPU, CUDA, OpenCL is also possible.
- Returns
df – Keys are each of the energetic type features. e.g. “intra_lj” are the intra-molecular LJ energies obtained from simulation.
Values are the corresponding set of numerics, stored as lists.
- Return type
dict
-
classmethod
extract_rgyr(mdtraj_obj, **kwargs)¶ Extracting radius of gyration from each frame of simulation. Assumes the first residue in the system is the solute.
- Parameters
mdtraj_obj (mdtraj.trajectory) – The simulated trajectory
- Returns
df – Key is prefix_rgyr, where prefix changes depending on the type of Extractor class used. Values are the corresponding set of numerics, stored as lists.
- Return type
dict
-
classmethod
extract_sasa(mdtraj_obj, **kwargs)¶ Extracting solvent accessible surface area from each frame of simulation. Assumes the first residue in the system is the solute.
- Parameters
mdtraj_obj (mdtraj.trajectory) – The simulated trajectory
- Returns
df – Key is prefix_sasa, where prefix changes depending on the type of Extractor class used. Values are the corresponding set of numerics, stored as lists.
- Return type
dict
-
classmethod
_get_all_exception_atom_pairs(system, topology)[source]¶ Using the parametersied system to obtain the exception and exclusion pairs, used in
_extract_energies_helper(). This is inferred purely from the parameterised system and connectivity.- Parameters
system (OpenMM.System) –
topology (parmed.topology) –
- Returns
solute_1_4_pairs (set)
solvent_1_4_pairs (set)
solute_excluded_pairs (set)
solvent_excluded_pairs (set)
solute_self_pairs (set)
solvent_self_pairs (set)
mdfptools.Parameteriser module¶
-
class
mdfptools.Parameteriser.BaseParameteriser[source]¶ Bases:
objectWarning
The base class should not be used directly
- Attributes
- system_pmd
Methods
load_ddec_models([epsilon])Charging molecule using machine learned charge instead of the default AM1-BCC method.
Abstract method
run()Abstract method
save(file_name[, file_path])Save to file the parameterised system.
unload_ddec_models(\*\*kwargs)Unload the machine-learned charge model, which takes over 1 GB of memory.
Abstract method
Abstract method
-
system_pmd= None¶
-
classmethod
_rdkit_setter(smiles, **kwargs)[source]¶ Prepares an rdkit molecule with 3D coordinates.
- Parameters
smiles (str) – SMILES string of the solute moleulce
- Returns
mol
- Return type
rdkit.Chem.Mol
-
classmethod
load_ddec_models(epsilon=4, **kwargs)[source]¶ Charging molecule using machine learned charge instead of the default AM1-BCC method.
Requires first installing the mlddec(https://github.com/rinikerlab/mlddec) package. Parameters are availible for elements : {H,C,N,O,Cl,Br,F}.
- Parameters
epsilon (int) – Dielectric constant to be used, polarity of the resulting molecule varies, possible values are {4,78}.
-
classmethod
unload_ddec_models(**kwargs)[source]¶ Unload the machine-learned charge model, which takes over 1 GB of memory.
-
classmethod
_openeye_setter(smiles, **kwargs)[source]¶ Prepares an openeye molecule with 3D coordinates.
- Parameters
smiles (str) – SMILES string of the solute moleulce
- Returns
mol
- Return type
oechem.OEMol
-
classmethod
_openeye_parameteriser(mol, **kwargs)[source]¶ Creates a parameterised system from openeye molecule
- Parameters
mol (oechem.OEMol) –
-
classmethod
save(file_name, file_path='./', **kwargs)[source]¶ Save to file the parameterised system.
- Parameters
file_name (str) – No file type postfix is necessary
file_path (str) – Default to current directory
- Returns
path – The absolute path where the trajectory is written to.
- Return type
str
-
classmethod
run()¶ Abstract method
-
__init__(self, /, *args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
class
mdfptools.Parameteriser.LiquidParameteriser[source]¶ Bases:
mdfptools.Parameteriser.BaseParameteriserParameterisation of liquid box, i.e. multiple replicates of the same molecule
- Attributes
- system_pmd
Methods
load_ddec_models([epsilon])Charging molecule using machine learned charge instead of the default AM1-BCC method.
Abstract method
run(smiles, density[, …])Parameterisation perfromed via openeye toolkit.
save(file_name[, file_path])Save to file the parameterised system.
unload_ddec_models(\*\*kwargs)Unload the machine-learned charge model, which takes over 1 GB of memory.
via_openeye(smiles, density[, …])Parameterisation perfromed via openeye toolkit.
via_rdkit(smiles, density[, …])Parameterisation perfromed via rdkit.
-
classmethod
via_openeye(smiles, density, allow_undefined_stereo=False, num_lig=100, **kwargs)[source]¶ Parameterisation perfromed via openeye toolkit.
- Parameters
smiles (str) – SMILES string of the molecule to be parametersied
density (simtk.unit) – Density of liquid box
allow_undefined_stereo (bool) – Flag passed to OpenForceField Molecule object during parameterisation. When set to False an error is returned if SMILES have no/ambiguous steroechemistry. Default to False here as a sanity check for user.
num_lig (int) – Number of replicates of the molecule
- Returns
system_pmd – The parameterised system as parmed object
- Return type
parmed.structure
-
classmethod
via_rdkit(smiles, density, allow_undefined_stereo=False, num_lig=100, **kwargs)[source]¶ Parameterisation perfromed via rdkit.
- Parameters
smiles (str) – SMILES string of the molecule to be parametersied
density (simtk.unit) – Density of liquid box
allow_undefined_stereo (bool) – Flag passed to OpenForceField Molecule object during parameterisation. When set to False an error is returned if SMILES have no/ambiguous steroechemistry. Default to False here as a sanity check for user.
num_lig (int) – Number of replicates of the molecule
- Returns
system_pmd – The parameterised system as parmed object
- Return type
parmed.structure
-
classmethod
_via_helper(density, num_lig, **kwargs)[source]¶ Helper function for via_rdkit or via_openeye
- Parameters
density (simtk.unit) – Density of liquid box
num_lig (int) – Number of replicates of the molecule
- Returns
system_pmd – The parameterised system as parmed object
- Return type
parmed.structure
-
classmethod
run(smiles, density, allow_undefined_stereo=False, num_lig=100, **kwargs)¶ Parameterisation perfromed via openeye toolkit.
- Parameters
smiles (str) – SMILES string of the molecule to be parametersied
density (simtk.unit) – Density of liquid box
allow_undefined_stereo (bool) – Flag passed to OpenForceField Molecule object during parameterisation. When set to False an error is returned if SMILES have no/ambiguous steroechemistry. Default to False here as a sanity check for user.
num_lig (int) – Number of replicates of the molecule
- Returns
system_pmd – The parameterised system as parmed object
- Return type
parmed.structure
-
__init__(self, /, *args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
classmethod
_openeye_parameteriser(mol, **kwargs)¶ Creates a parameterised system from openeye molecule
- Parameters
mol (oechem.OEMol) –
-
classmethod
_openeye_setter(smiles, **kwargs)¶ Prepares an openeye molecule with 3D coordinates.
- Parameters
smiles (str) – SMILES string of the solute moleulce
- Returns
mol
- Return type
oechem.OEMol
-
classmethod
_rdkit_parameteriser(mol, **kwargs)¶
-
classmethod
_rdkit_setter(smiles, **kwargs)¶ Prepares an rdkit molecule with 3D coordinates.
- Parameters
smiles (str) – SMILES string of the solute moleulce
- Returns
mol
- Return type
rdkit.Chem.Mol
-
classmethod
load_ddec_models(epsilon=4, **kwargs)¶ Charging molecule using machine learned charge instead of the default AM1-BCC method.
Requires first installing the mlddec(https://github.com/rinikerlab/mlddec) package. Parameters are availible for elements : {H,C,N,O,Cl,Br,F}.
- Parameters
epsilon (int) – Dielectric constant to be used, polarity of the resulting molecule varies, possible values are {4,78}.
-
classmethod
pmd_generator()¶ Abstract method
-
classmethod
save(file_name, file_path='./', **kwargs)¶ Save to file the parameterised system.
- Parameters
file_name (str) – No file type postfix is necessary
file_path (str) – Default to current directory
- Returns
path – The absolute path where the trajectory is written to.
- Return type
str
-
system_pmd= None¶
-
classmethod
unload_ddec_models(**kwargs)¶ Unload the machine-learned charge model, which takes over 1 GB of memory.
-
class
mdfptools.Parameteriser.SolutionParameteriser[source]¶ Bases:
mdfptools.Parameteriser.BaseParameteriserParameterisation of solution box, i.e. one copy of solute molecule surronded by water.
- Parameters
solvent_pmd (parmed.structure) – Parameterised tip3p water as parmed object
- Attributes
- system_pmd
Methods
load_ddec_models([epsilon])Charging molecule using machine learned charge instead of the default AM1-BCC method.
Abstract method
run(smiles[, allow_undefined_stereo, …])Parameterisation perfromed via openeye.
save(file_name[, file_path])Save to file the parameterised system.
unload_ddec_models(\*\*kwargs)Unload the machine-learned charge model, which takes over 1 GB of memory.
via_openeye(smiles[, …])Parameterisation perfromed via openeye.
via_rdkit(smiles[, allow_undefined_stereo, …])Parameterisation perfromed via openeye.
-
classmethod
via_openeye(smiles, allow_undefined_stereo=False, default_padding=Quantity(value=1.25, unit=nanometer), **kwargs)[source]¶ Parameterisation perfromed via openeye.
- Parameters
smiles (str) – SMILES string of the solute molecule
allow_undefined_stereo (bool) – Flag passed to OpenForceField Molecule object during parameterisation. When set to False an error is returned if SMILES have no/ambiguous steroechemistry. Default to False here as a sanity check for user.
default_padding (simtk.unit) – Dictates amount of water surronding the solute. Default is 1.25 nanometers
- Returns
system_pmd – The parameterised system as parmed object
- Return type
parmed.structure
-
classmethod
via_rdkit(smiles, allow_undefined_stereo=False, default_padding=Quantity(value=1.25, unit=nanometer), **kwargs)[source]¶ Parameterisation perfromed via openeye.
- Parameters
smiles (str) – SMILES string of the solute molecule
allow_undefined_stereo (bool) – Flag passed to OpenForceField Molecule object during parameterisation. When set to False an error is returned if SMILES have no/ambiguous steroechemistry. Default to False here as a sanity check for user.
default_padding (simtk.unit) – Dictates amount of water surronding the solute. Default is 1.25 nanometers
- Returns
system_pmd – The parameterised system as parmed object
- Return type
parmed.structure
-
classmethod
_via_helper(**kwargs)[source]¶ Helper function for via_rdkit or via_openeye
- Returns
system_pmd – The parameterised system as parmed object
- Return type
parmed.structure
-
classmethod
run(smiles, allow_undefined_stereo=False, default_padding=Quantity(value=1.25, unit=nanometer), **kwargs)¶ Parameterisation perfromed via openeye.
- Parameters
smiles (str) – SMILES string of the solute molecule
allow_undefined_stereo (bool) – Flag passed to OpenForceField Molecule object during parameterisation. When set to False an error is returned if SMILES have no/ambiguous steroechemistry. Default to False here as a sanity check for user.
default_padding (simtk.unit) – Dictates amount of water surronding the solute. Default is 1.25 nanometers
- Returns
system_pmd – The parameterised system as parmed object
- Return type
parmed.structure
-
__init__(self, /, *args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
classmethod
_openeye_parameteriser(mol, **kwargs)¶ Creates a parameterised system from openeye molecule
- Parameters
mol (oechem.OEMol) –
-
classmethod
_openeye_setter(smiles, **kwargs)¶ Prepares an openeye molecule with 3D coordinates.
- Parameters
smiles (str) – SMILES string of the solute moleulce
- Returns
mol
- Return type
oechem.OEMol
-
classmethod
_rdkit_parameteriser(mol, **kwargs)¶
-
classmethod
_rdkit_setter(smiles, **kwargs)¶ Prepares an rdkit molecule with 3D coordinates.
- Parameters
smiles (str) – SMILES string of the solute moleulce
- Returns
mol
- Return type
rdkit.Chem.Mol
-
classmethod
load_ddec_models(epsilon=4, **kwargs)¶ Charging molecule using machine learned charge instead of the default AM1-BCC method.
Requires first installing the mlddec(https://github.com/rinikerlab/mlddec) package. Parameters are availible for elements : {H,C,N,O,Cl,Br,F}.
- Parameters
epsilon (int) – Dielectric constant to be used, polarity of the resulting molecule varies, possible values are {4,78}.
-
classmethod
pmd_generator()¶ Abstract method
-
classmethod
save(file_name, file_path='./', **kwargs)¶ Save to file the parameterised system.
- Parameters
file_name (str) – No file type postfix is necessary
file_path (str) – Default to current directory
- Returns
path – The absolute path where the trajectory is written to.
- Return type
str
-
system_pmd= None¶
-
classmethod
unload_ddec_models(**kwargs)¶ Unload the machine-learned charge model, which takes over 1 GB of memory.
-
class
mdfptools.Parameteriser.VaccumParameteriser[source]¶ Bases:
mdfptools.Parameteriser.BaseParameteriser- Attributes
- system_pmd
Methods
load_ddec_models([epsilon])Charging molecule using machine learned charge instead of the default AM1-BCC method.
Abstract method
run(smiles[, allow_undefined_stereo])Parameterisation perfromed via openeye toolkit.
save(file_name[, file_path])Save to file the parameterised system.
unload_ddec_models(\*\*kwargs)Unload the machine-learned charge model, which takes over 1 GB of memory.
via_openeye(smiles[, allow_undefined_stereo])Parameterisation perfromed via openeye toolkit.
via_rdkit(smiles[, allow_undefined_stereo])Parameterisation perfromed via rdkit toolkit.
-
classmethod
via_openeye(smiles, allow_undefined_stereo=False, **kwargs)[source]¶ Parameterisation perfromed via openeye toolkit.
- Parameters
smiles (str) – SMILES string of the molecule to be parametersied
allow_undefined_stereo (bool) – Flag passed to OpenForceField Molecule object during parameterisation. When set to False an error is returned if SMILES have no/ambiguous steroechemistry. Default to False here as a sanity check for user.
- Returns
system_pmd – The parameterised system as parmed object
- Return type
parmed.structure
-
classmethod
via_rdkit(smiles, allow_undefined_stereo=False, **kwargs)[source]¶ Parameterisation perfromed via rdkit toolkit.
- Parameters
smiles (str) – SMILES string of the molecule to be parametersied
allow_undefined_stereo (bool) – Flag passed to OpenForceField Molecule object during parameterisation. When set to False an error is returned if SMILES have no/ambiguous steroechemistry. Default to False here as a sanity check for user.
- Returns
system_pmd – The parameterised system as parmed object
- Return type
parmed.structure
-
__init__(self, /, *args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
classmethod
_openeye_parameteriser(mol, **kwargs)¶ Creates a parameterised system from openeye molecule
- Parameters
mol (oechem.OEMol) –
-
classmethod
_openeye_setter(smiles, **kwargs)¶ Prepares an openeye molecule with 3D coordinates.
- Parameters
smiles (str) – SMILES string of the solute moleulce
- Returns
mol
- Return type
oechem.OEMol
-
classmethod
_rdkit_parameteriser(mol, **kwargs)¶
-
classmethod
_rdkit_setter(smiles, **kwargs)¶ Prepares an rdkit molecule with 3D coordinates.
- Parameters
smiles (str) – SMILES string of the solute moleulce
- Returns
mol
- Return type
rdkit.Chem.Mol
-
classmethod
load_ddec_models(epsilon=4, **kwargs)¶ Charging molecule using machine learned charge instead of the default AM1-BCC method.
Requires first installing the mlddec(https://github.com/rinikerlab/mlddec) package. Parameters are availible for elements : {H,C,N,O,Cl,Br,F}.
- Parameters
epsilon (int) – Dielectric constant to be used, polarity of the resulting molecule varies, possible values are {4,78}.
-
classmethod
pmd_generator()¶ Abstract method
-
classmethod
run(smiles, allow_undefined_stereo=False, **kwargs)¶ Parameterisation perfromed via openeye toolkit.
- Parameters
smiles (str) – SMILES string of the molecule to be parametersied
allow_undefined_stereo (bool) – Flag passed to OpenForceField Molecule object during parameterisation. When set to False an error is returned if SMILES have no/ambiguous steroechemistry. Default to False here as a sanity check for user.
- Returns
system_pmd – The parameterised system as parmed object
- Return type
parmed.structure
-
classmethod
save(file_name, file_path='./', **kwargs)¶ Save to file the parameterised system.
- Parameters
file_name (str) – No file type postfix is necessary
file_path (str) – Default to current directory
- Returns
path – The absolute path where the trajectory is written to.
- Return type
str
-
system_pmd= None¶
-
classmethod
unload_ddec_models(**kwargs)¶ Unload the machine-learned charge model, which takes over 1 GB of memory.
mdfptools.Simulator module¶
-
class
mdfptools.Simulator.BaseSimulator[source]¶ Bases:
objectWarning
The base class should not be used directly
- Parameters
temperature (simtk.unit) – default 298.15 K
pressure (simtk.unit) – default 1.013 bar
time_step (simtk.unit) – default 2 fs
Methods
run(parmed_obj, file_name[, file_path, …])Runs simulation using OpenMM.
Simulation via GROMACS will be added in the future.
via_openmm(parmed_obj, file_name[, …])Runs simulation using OpenMM.
-
temperature= Quantity(value=298.15, unit=kelvin)¶
-
pressure= Quantity(value=1.013, unit=bar)¶
-
time_step= Quantity(value=0.002, unit=picosecond)¶
-
equil_steps= 50000¶
-
classmethod
via_openmm(parmed_obj, file_name, file_path='./', platform='CUDA', num_steps=2500000, write_out_freq=5000, **kwargs)[source]¶ Runs simulation using OpenMM.
- Parameters
parmed_obj (parmed.structure) – Parmed object of the fully parameterised simulated system.
file_name (str) – No file type postfix is necessary
file_path (str) – Default to current directory
platform (str) – The computing architecture to do the calculation, default to CUDA, CPU, OpenCL is also possible.
num_steps (int) – Number of production simulation to run, default 2,500,000 steps, i.e. 5 ns.
write_out_freq (int) – Write out every nth frame of simulated trajectory, default to every 5000 frame write out one, i.e. 10 ps per frame.
- Returns
path – The absolute path where the trajectory is written to.
- Return type
str
-
classmethod
run(parmed_obj, file_name, file_path='./', platform='CUDA', num_steps=2500000, write_out_freq=5000, **kwargs)¶ Runs simulation using OpenMM.
- Parameters
parmed_obj (parmed.structure) – Parmed object of the fully parameterised simulated system.
file_name (str) – No file type postfix is necessary
file_path (str) – Default to current directory
platform (str) – The computing architecture to do the calculation, default to CUDA, CPU, OpenCL is also possible.
num_steps (int) – Number of production simulation to run, default 2,500,000 steps, i.e. 5 ns.
write_out_freq (int) – Write out every nth frame of simulated trajectory, default to every 5000 frame write out one, i.e. 10 ps per frame.
- Returns
path – The absolute path where the trajectory is written to.
- Return type
str
-
__init__(self, /, *args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
class
mdfptools.Simulator.SolutionSimulator[source]¶ Bases:
mdfptools.Simulator.BaseSimulatorPerform solution simulation, namely one copy of solute in water box. Currently identical to BaseSimulator
- Parameters
equil_steps (int) – number of steps during equilibraion, default 50,000 steps, i.e. 100 ps
Methods
run(parmed_obj, file_name[, file_path, …])Runs simulation using OpenMM.
Simulation via GROMACS will be added in the future.
via_openmm(parmed_obj, file_name[, …])Runs simulation using OpenMM.
-
equil_steps= 50000¶
-
__init__(self, /, *args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
pressure= Quantity(value=1.013, unit=bar)¶
-
classmethod
run(parmed_obj, file_name, file_path='./', platform='CUDA', num_steps=2500000, write_out_freq=5000, **kwargs)¶ Runs simulation using OpenMM.
- Parameters
parmed_obj (parmed.structure) – Parmed object of the fully parameterised simulated system.
file_name (str) – No file type postfix is necessary
file_path (str) – Default to current directory
platform (str) – The computing architecture to do the calculation, default to CUDA, CPU, OpenCL is also possible.
num_steps (int) – Number of production simulation to run, default 2,500,000 steps, i.e. 5 ns.
write_out_freq (int) – Write out every nth frame of simulated trajectory, default to every 5000 frame write out one, i.e. 10 ps per frame.
- Returns
path – The absolute path where the trajectory is written to.
- Return type
str
-
temperature= Quantity(value=298.15, unit=kelvin)¶
-
time_step= Quantity(value=0.002, unit=picosecond)¶
-
classmethod
via_gromacs()¶ Simulation via GROMACS will be added in the future.
-
classmethod
via_openmm(parmed_obj, file_name, file_path='./', platform='CUDA', num_steps=2500000, write_out_freq=5000, **kwargs)¶ Runs simulation using OpenMM.
- Parameters
parmed_obj (parmed.structure) – Parmed object of the fully parameterised simulated system.
file_name (str) – No file type postfix is necessary
file_path (str) – Default to current directory
platform (str) – The computing architecture to do the calculation, default to CUDA, CPU, OpenCL is also possible.
num_steps (int) – Number of production simulation to run, default 2,500,000 steps, i.e. 5 ns.
write_out_freq (int) – Write out every nth frame of simulated trajectory, default to every 5000 frame write out one, i.e. 10 ps per frame.
- Returns
path – The absolute path where the trajectory is written to.
- Return type
str
-
class
mdfptools.Simulator.LiquidSimulator[source]¶ Bases:
mdfptools.Simulator.BaseSimulatorPerform liquid simulation, namely multiple copy of the same molecule.
- Parameters
equil_steps (int) – number of steps during equilibraion, default 500,000 steps, i.e. 1 ns
Methods
run(parmed_obj, file_name[, file_path, …])Runs simulation using OpenMM.
Simulation via GROMACS will be added in the future.
via_openmm(parmed_obj, file_name[, …])Runs simulation using OpenMM.
-
__init__(self, /, *args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
equil_steps= 500000¶
-
pressure= Quantity(value=1.013, unit=bar)¶
-
classmethod
run(parmed_obj, file_name, file_path='./', platform='CUDA', num_steps=2500000, write_out_freq=5000, **kwargs)¶ Runs simulation using OpenMM.
- Parameters
parmed_obj (parmed.structure) – Parmed object of the fully parameterised simulated system.
file_name (str) – No file type postfix is necessary
file_path (str) – Default to current directory
platform (str) – The computing architecture to do the calculation, default to CUDA, CPU, OpenCL is also possible.
num_steps (int) – Number of production simulation to run, default 2,500,000 steps, i.e. 5 ns.
write_out_freq (int) – Write out every nth frame of simulated trajectory, default to every 5000 frame write out one, i.e. 10 ps per frame.
- Returns
path – The absolute path where the trajectory is written to.
- Return type
str
-
temperature= Quantity(value=298.15, unit=kelvin)¶
-
time_step= Quantity(value=0.002, unit=picosecond)¶
-
classmethod
via_gromacs()¶ Simulation via GROMACS will be added in the future.
-
classmethod
via_openmm(parmed_obj, file_name, file_path='./', platform='CUDA', num_steps=2500000, write_out_freq=5000, **kwargs)¶ Runs simulation using OpenMM.
- Parameters
parmed_obj (parmed.structure) – Parmed object of the fully parameterised simulated system.
file_name (str) – No file type postfix is necessary
file_path (str) – Default to current directory
platform (str) – The computing architecture to do the calculation, default to CUDA, CPU, OpenCL is also possible.
num_steps (int) – Number of production simulation to run, default 2,500,000 steps, i.e. 5 ns.
write_out_freq (int) – Write out every nth frame of simulated trajectory, default to every 5000 frame write out one, i.e. 10 ps per frame.
- Returns
path – The absolute path where the trajectory is written to.
- Return type
str
mdfptools.utils module¶
-
mdfptools.utils.get_data_filename(relative_path)[source]¶ Get the full path to one of the reference files in testsystems. In the source distribution, these files are in
mdfptools/data/, but on installation, they’re moved to somewhere in the user’s python site-packages directory.- Parameters
name (str) – Name of the file to load (with respect to the repex folder).
- Returns
fn – filename
- Return type
str
-
mdfptools.utils.canonical_smiles_from_smiles(smiles, sanitize=True)[source]¶ Apply canonicalisation with rdkit
- Parameters
smiles (str) –
sanitize (bool) – Wether to apply rdkit sanitisation, default yes.
- Returns
canonical_smiles – Returns None if canonicalisation fails
- Return type
str
-
mdfptools.utils.hashing(smiles)[source]¶ Converts a string to hexdecimal representation (length 32). Specifically, it is used in mdfptools to convert canonical smiles to hex so it can be used as filename when store to disk.
- Parameters
smiles (str) –
- Returns
hex_str – Hexdecimal representation
- Return type
str
Module contents¶
mdfptools python implementation of molecular dynamics fingerprints as delineated in https://pubs.acs.org/doi/10.1021/acs.jcim.6b00778