mythos.energy.dna2

Implementation of the oxDNA2 energy model in mythos.

Submodules

Classes

BondedExcludedVolume

Bonded excluded volume energy function for DNA1 model.

BondedExcludedVolumeConfiguration

Configuration for the bonded excluded volume energy function.

CrossStacking

Cross-stacking energy function for DNA1 model.

CrossStackingConfiguration

Configuration for the cross-stacking energy function.

Fene

FENE energy function for DNA1 model.

FeneConfiguration

Configuration for the FENE energy function.

HydrogenBonding

Hydrogen bonding energy function for DNA1 model.

HydrogenBondingConfiguration

Configuration for the hydrogen bonding energy function.

StackingConfiguration

Configuration for the stacking energy function.

UnbondedExcludedVolume

Unbonded excluded volume energy function for DNA1 model.

UnbondedExcludedVolumeConfiguration

Configuration for the unbonded excluded volume energy function.

CoaxialStacking

Coaxial stacking energy function for DNA1 model.

CoaxialStackingConfiguration

Configuration for the coaxial stacking energy function.

Debye

Debye-huckel energy function for DNA2 model.

DebyeConfiguration

Configuration for the debye-huckel energy function.

Nucleotide

Nucleotide rigid body with additional sites for DNA2.

Stacking

Stacking energy function for DNA2 model.

Functions

default_configs(→ tuple[mythos.utils.types.PyTree, ...)

Return the default simulation and energy configurations for dna2.

default_energy_configs(, opts)

Return the default configurations for the energy functions for dna2.

default_energy_fns(...)

Return the default energy functions for dna2.

default_transform_fn(→ callable)

Return the default transform function for dna2 simulations.

create_default_energy_fn(...)

Create the default oxDNA2 energy function.

Package Contents

class mythos.energy.dna2.BondedExcludedVolume[source]

Bases: mythos.energy.base.BaseEnergyFunction

Bonded excluded volume energy function for DNA1 model.

params: BondedExcludedVolumeConfiguration
pairwise_energies(body: mythos.energy.base.BaseNucleotide, bonded_neighbors: mythos.utils.types.Arr_Bonded_Neighbors_2) mythos.utils.types.Arr_Bonded_Neighbors[source]

Computes the excluded volume energy for each bonded pair.

compute_energy(nucleotide: mythos.energy.base.BaseNucleotide) mythos.utils.types.Scalar[source]

Compute the energy of the system given the nucleotide.

class mythos.energy.dna2.BondedExcludedVolumeConfiguration[source]

Bases: mythos.energy.configuration.BaseConfiguration

Configuration for the bonded excluded volume energy function.

eps_exc: float | None = None
dr_star_base: float | None = None
sigma_base: float | None = None
sigma_back_base: float | None = None
sigma_base_back: float | None = None
dr_star_back_base: float | None = None
dr_star_base_back: float | None = None
b_base: float | None = None
dr_c_base: float | None = None
b_back_base: float | None = None
dr_c_back_base: float | None = None
b_base_back: float | None = None
dr_c_base_back: float | None = None
required_params: tuple[str] = ('eps_exc', 'dr_star_base', 'sigma_base', 'sigma_back_base', 'sigma_base_back',...
dependent_params: tuple[str] = ('b_base', 'dr_c_base', 'b_back_base', 'dr_c_back_base', 'b_base_back', 'dr_c_base_back')
init_params() BondedExcludedVolumeConfiguration[source]

Initializes the dependent parameters in configuration.

Should be implemented in the subclass if dependent parameters are present.

class mythos.energy.dna2.CrossStacking[source]

Bases: mythos.energy.base.BaseEnergyFunction

Cross-stacking energy function for DNA1 model.

params: CrossStackingConfiguration
pairwise_energies(body_i: mythos.energy.base.BaseNucleotide, body_j: mythos.energy.base.BaseNucleotide, unbonded_neighbors: mythos.utils.types.Arr_Unbonded_Neighbors_2) mythos.utils.types.Arr_Unbonded_Neighbors[source]

Computes the cross stacking energy for each unbonded pair.

compute_energy(nucleotide: mythos.energy.base.BaseNucleotide) mythos.utils.types.Scalar[source]

Compute the energy of the system given the nucleotide.

class mythos.energy.dna2.CrossStackingConfiguration[source]

Bases: mythos.energy.configuration.BaseConfiguration

Configuration for the cross-stacking energy function.

dr_low_cross: float | None = None
dr_high_cross: float | None = None
k_cross: float | None = None
r0_cross: float | None = None
dr_c_cross: float | None = None
theta0_cross_1: float | None = None
delta_theta_star_cross_1: float | None = None
a_cross_1: float | None = None
theta0_cross_2: float | None = None
delta_theta_star_cross_2: float | None = None
a_cross_2: float | None = None
theta0_cross_3: float | None = None
delta_theta_star_cross_3: float | None = None
a_cross_3: float | None = None
theta0_cross_4: float | None = None
delta_theta_star_cross_4: float | None = None
a_cross_4: float | None = None
theta0_cross_7: float | None = None
delta_theta_star_cross_7: float | None = None
a_cross_7: float | None = None
theta0_cross_8: float | None = None
delta_theta_star_cross_8: float | None = None
a_cross_8: float | None = None
b_low_cross: float | None = None
dr_c_low_cross: float | None = None
b_high_cross: float | None = None
dr_c_high_cross: float | None = None
b_cross_1: float | None = None
delta_theta_cross_1_c: float | None = None
b_cross_2: float | None = None
delta_theta_cross_2_c: float | None = None
b_cross_3: float | None = None
delta_theta_cross_3_c: float | None = None
b_cross_4: float | None = None
delta_theta_cross_4_c: float | None = None
b_cross_7: float | None = None
delta_theta_cross_7_c: float | None = None
b_cross_8: float | None = None
delta_theta_cross_8_c: float | None = None
required_params: tuple[str] = ('dr_low_cross', 'dr_high_cross', 'k_cross', 'r0_cross', 'dr_c_cross', 'theta0_cross_1',...
dependent_params: tuple[str] = ('b_low_cross', 'dr_c_low_cross', 'b_high_cross', 'dr_c_high_cross', 'b_cross_1',...
init_params() CrossStackingConfiguration[source]

Initializes the dependent parameters in configuration.

Should be implemented in the subclass if dependent parameters are present.

class mythos.energy.dna2.Fene[source]

Bases: mythos.energy.base.BaseEnergyFunction

FENE energy function for DNA1 model.

params: FeneConfiguration
pairwise_energies(body: mythos.energy.base.BaseNucleotide, bonded_neighbors: mythos.utils.types.Arr_Bonded_Neighbors_2) mythos.utils.types.Arr_Bonded_Neighbors[source]

Computes the FENE energy for each bonded pair.

compute_energy(nucleotide: mythos.energy.base.BaseNucleotide) mythos.utils.types.Scalar[source]

Compute the energy of the system given the nucleotide.

class mythos.energy.dna2.FeneConfiguration[source]

Bases: mythos.energy.configuration.BaseConfiguration

Configuration for the FENE energy function.

eps_backbone: float | None = None
r0_backbone: float | None = None
delta_backbone: float | None = None
fmax: float | None = None
finf: float | None = None
required_params: tuple[str] = ('eps_backbone', 'r0_backbone', 'delta_backbone', 'fmax', 'finf')
init_params() FeneConfiguration[source]

Initializes the dependent parameters in configuration.

Should be implemented in the subclass if dependent parameters are present.

class mythos.energy.dna2.HydrogenBonding[source]

Bases: mythos.energy.base.BaseEnergyFunction

Hydrogen bonding energy function for DNA1 model.

params: HydrogenBondingConfiguration
compute_v_hb(body_i: mythos.energy.base.BaseNucleotide, body_j: mythos.energy.base.BaseNucleotide, unbonded_neighbors: mythos.utils.types.Arr_Unbonded_Neighbors) mythos.utils.types.Arr_Unbonded_Neighbors[source]

Computes the sequence-independent energy for each unbonded pair.

weight(i: int, j: int, seq: mythos.utils.types.Probabilistic_Sequence) float[source]

Computes the sequence-dependent weight for an unbonded pair.

pairwise_energies(body_i: mythos.energy.base.BaseNucleotide, body_j: mythos.energy.base.BaseNucleotide, seq: mythos.utils.types.Discrete_Sequence, unbonded_neighbors: mythos.utils.types.Arr_Unbonded_Neighbors_2) mythos.utils.types.Arr_Unbonded_Neighbors[source]

Computes the hydrogen bonding energy for each unbonded pair.

compute_energy(nucleotide: mythos.energy.base.BaseNucleotide) mythos.utils.types.Scalar[source]

Compute the energy of the system given the nucleotide.

class mythos.energy.dna2.HydrogenBondingConfiguration[source]

Bases: mythos.energy.configuration.BaseConfiguration

Configuration for the hydrogen bonding energy function.

eps_hb: float | None = None
a_hb: float | None = None
dr0_hb: float | None = None
dr_c_hb: float | None = None
dr_low_hb: float | None = None
dr_high_hb: float | None = None
a_hb_1: float | None = None
theta0_hb_1: float | None = None
delta_theta_star_hb_1: float | None = None
a_hb_2: float | None = None
theta0_hb_2: float | None = None
delta_theta_star_hb_2: float | None = None
a_hb_3: float | None = None
theta0_hb_3: float | None = None
delta_theta_star_hb_3: float | None = None
a_hb_4: float | None = None
theta0_hb_4: float | None = None
delta_theta_star_hb_4: float | None = None
a_hb_7: float | None = None
theta0_hb_7: float | None = None
delta_theta_star_hb_7: float | None = None
a_hb_8: float | None = None
theta0_hb_8: float | None = None
delta_theta_star_hb_8: float | None = None
ss_hb_weights: numpy.ndarray | None = None
b_low_hb: float | None = None
dr_c_low_hb: float | None = None
b_high_hb: float | None = None
dr_c_high_hb: float | None = None
b_hb_1: float | None = None
delta_theta_hb_1_c: float | None = None
b_hb_2: float | None = None
delta_theta_hb_2_c: float | None = None
b_hb_3: float | None = None
delta_theta_hb_3_c: float | None = None
b_hb_4: float | None = None
delta_theta_hb_4_c: float | None = None
b_hb_7: float | None = None
delta_theta_hb_7_c: float | None = None
b_hb_8: float | None = None
delta_theta_hb_8_c: float | None = None
eps_hb_weights: numpy.ndarray | None = None
pseq: mythos.utils.types.Probabilistic_Sequence | None = None
pseq_constraints: mythos.input.sequence_constraints.SequenceConstraints | None = None
required_params: tuple[str] = ('eps_hb', 'a_hb', 'dr0_hb', 'dr_c_hb', 'dr_low_hb', 'dr_high_hb', 'a_hb_1', 'theta0_hb_1',...
dependent_params: tuple[str] = ('b_low_hb', 'dr_c_low_hb', 'b_high_hb', 'dr_c_high_hb', 'b_hb_1', 'delta_theta_hb_1_c',...
init_params() HydrogenBondingConfiguration[source]

Initializes the dependent parameters in configuration.

Should be implemented in the subclass if dependent parameters are present.

class mythos.energy.dna2.StackingConfiguration[source]

Bases: mythos.energy.configuration.BaseConfiguration

Configuration for the stacking energy function.

eps_stack_base: float | None = None
eps_stack_kt_coeff: float | None = None
dr_low_stack: float | None = None
dr_high_stack: float | None = None
a_stack: float | None = None
dr0_stack: float | None = None
dr_c_stack: float | None = None
theta0_stack_4: float | None = None
delta_theta_star_stack_4: float | None = None
a_stack_4: float | None = None
theta0_stack_5: float | None = None
delta_theta_star_stack_5: float | None = None
a_stack_5: float | None = None
theta0_stack_6: float | None = None
delta_theta_star_stack_6: float | None = None
a_stack_6: float | None = None
neg_cos_phi1_star_stack: float | None = None
a_stack_1: float | None = None
neg_cos_phi2_star_stack: float | None = None
a_stack_2: float | None = None
pseq: mythos.utils.types.Probabilistic_Sequence | None = None
pseq_constraints: mythos.input.sequence_constraints.SequenceConstraints | None = None
kt: float | None = None
ss_stack_weights: numpy.ndarray | None = None
b_low_stack: float | None = None
dr_c_low_stack: float | None = None
b_high_stack: float | None = None
dr_c_high_stack: float | None = None
b_stack_4: float | None = None
delta_theta_stack_4_c: float | None = None
b_stack_5: float | None = None
delta_theta_stack_5_c: float | None = None
b_stack_6: float | None = None
delta_theta_stack_6_c: float | None = None
b_neg_cos_phi1_stack: float | None = None
neg_cos_phi1_c_stack: float | None = None
b_neg_cos_phi2_stack: float | None = None
neg_cos_phi2_c_stack: float | None = None
eps_stack: float | None = None
required_params: tuple[str] = ('eps_stack_base', 'eps_stack_kt_coeff', 'dr_low_stack', 'dr_high_stack', 'a_stack',...
dependent_params: tuple[str] = ('b_low_stack', 'dr_c_low_stack', 'b_high_stack', 'dr_c_high_stack', 'b_stack_4',...
init_params() StackingConfiguration[source]

Initializes the dependent parameters in configuration.

Should be implemented in the subclass if dependent parameters are present.

class mythos.energy.dna2.UnbondedExcludedVolume[source]

Bases: mythos.energy.base.BaseEnergyFunction

Unbonded excluded volume energy function for DNA1 model.

params: UnbondedExcludedVolumeConfiguration
pairwise_energies(body_i: mythos.energy.base.BaseNucleotide, body_j: mythos.energy.base.BaseNucleotide, unbonded_neighbors: mythos.utils.types.Arr_Unbonded_Neighbors_2) mythos.utils.types.Arr_Bonded_Neighbors[source]

Computes the excluded volume energy for each unbonded pair.

compute_energy(nucleotide: mythos.energy.base.BaseNucleotide) mythos.utils.types.Scalar[source]

Compute the energy of the system given the nucleotide.

class mythos.energy.dna2.UnbondedExcludedVolumeConfiguration[source]

Bases: mythos.energy.configuration.BaseConfiguration

Configuration for the unbonded excluded volume energy function.

eps_exc: float | None = None
dr_star_base: float | None = None
sigma_base: float | None = None
dr_star_back_base: float | None = None
sigma_back_base: float | None = None
dr_star_base_back: float | None = None
sigma_base_back: float | None = None
dr_star_backbone: float | None = None
sigma_backbone: float | None = None
b_base: float | None = None
dr_c_base: float | None = None
b_back_base: float | None = None
dr_c_back_base: float | None = None
b_base_back: float | None = None
dr_c_base_back: float | None = None
b_backbone: float | None = None
dr_c_backbone: float | None = None
required_params: tuple[str] = ('eps_exc', 'dr_star_base', 'sigma_base', 'dr_star_back_base', 'sigma_back_base',...
dependent_params: tuple[str] = ('b_base', 'dr_c_base', 'b_back_base', 'dr_c_back_base', 'b_base_back', 'dr_c_base_back',...
init_params() UnbondedExcludedVolumeConfiguration[source]

Initializes the dependent parameters in configuration.

Should be implemented in the subclass if dependent parameters are present.

class mythos.energy.dna2.CoaxialStacking[source]

Bases: mythos.energy.base.BaseEnergyFunction

Coaxial stacking energy function for DNA1 model.

params: CoaxialStackingConfiguration
pairwise_energies(body_i: mythos.energy.dna2.nucleotide.Nucleotide, body_j: mythos.energy.dna2.nucleotide.Nucleotide, unbonded_neighbors: mythos.utils.types.Arr_Unbonded_Neighbors_2) mythos.utils.types.Arr_Unbonded_Neighbors[source]

Computes the coaxial stacking energy for each unbonded pair.

compute_energy(nucleotide: mythos.energy.dna2.nucleotide.Nucleotide) mythos.utils.types.Scalar[source]

Compute the energy of the system given the nucleotide.

class mythos.energy.dna2.CoaxialStackingConfiguration[source]

Bases: mythos.energy.configuration.BaseConfiguration

Configuration for the coaxial stacking energy function.

dr_low_coax: float | None = None
dr_high_coax: float | None = None
k_coax: float | None = None
dr0_coax: float | None = None
dr_c_coax: float | None = None
theta0_coax_4: float | None = None
delta_theta_star_coax_4: float | None = None
a_coax_4: float | None = None
theta0_coax_1: float | None = None
delta_theta_star_coax_1: float | None = None
a_coax_1: float | None = None
theta0_coax_5: float | None = None
delta_theta_star_coax_5: float | None = None
a_coax_5: float | None = None
theta0_coax_6: float | None = None
delta_theta_star_coax_6: float | None = None
a_coax_6: float | None = None
a_coax_1_f6: float | None = None
b_coax_1_f6: float | None = None
b_low_coax: float | None = None
dr_c_low_coax: float | None = None
b_high_coax: float | None = None
dr_c_high_coax: float | None = None
b_coax_4: float | None = None
delta_theta_coax_4_c: float | None = None
b_coax_1: float | None = None
delta_theta_coax_1_c: float | None = None
b_coax_5: float | None = None
delta_theta_coax_5_c: float | None = None
b_coax_6: float | None = None
delta_theta_coax_6_c: float | None = None
required_params: tuple[str] = ('dr_low_coax', 'dr_high_coax', 'k_coax', 'dr0_coax', 'dr_c_coax', 'theta0_coax_4',...
init_params() CoaxialStackingConfiguration[source]

Initializes the dependent parameters in configuration.

Should be implemented in the subclass if dependent parameters are present.

class mythos.energy.dna2.Debye[source]

Bases: mythos.energy.base.BaseEnergyFunction

Debye-huckel energy function for DNA2 model.

params: DebyeConfiguration
is_end: mythos.utils.types.Arr_Nucleotide_Int | None = None
__post_init__(topology: mythos.input.topology.Topology | None) None[source]
pairwise_energies(body_i: mythos.energy.base.BaseNucleotide, body_j: mythos.energy.base.BaseNucleotide, unbonded_neighbors: mythos.utils.types.Arr_Unbonded_Neighbors_2) mythos.utils.types.Arr_Bonded_Neighbors[source]

Computes the debye-huckel energy for each unbonded pair.

compute_energy(nucleotide: mythos.energy.base.BaseNucleotide) mythos.utils.types.Scalar[source]

Compute the energy of the system given the nucleotide.

class mythos.energy.dna2.DebyeConfiguration[source]

Bases: mythos.energy.configuration.BaseConfiguration

Configuration for the debye-huckel energy function.

q_eff: float | None = None
lambda_factor: float | None = None
prefactor_coeff: float | None = None
kt: float | None = None
salt_conc: float | None = None
half_charged_ends: bool | None = None
lambda_: float | None = None
kappa: float | None = None
r_high: float | None = None
prefactor: float | None = None
smoothing_coeff: float | None = None
r_cut: float | None = None
required_params: tuple[str] = ('q_eff', 'lambda_factor', 'prefactor_coeff', 'kt', 'salt_conc', 'half_charged_ends')
init_params() DebyeConfiguration[source]

Initializes the dependent parameters in configuration.

Should be implemented in the subclass if dependent parameters are present.

class mythos.energy.dna2.Nucleotide[source]

Bases: mythos.energy.base.BaseNucleotide

Nucleotide rigid body with additional sites for DNA2.

This class is inteneded to be used as a dataclass for a nucleotide rigid body as a rigid_body_transform_fn in jax_md.energy.ComposedEnergyFunction.

center: mythos.utils.types.Arr_Nucleotide_3
orientation: mythos.utils.types.Arr_Nucleotide_3 | jax_md.rigid_body.Quaternion
stack_sites: mythos.utils.types.Arr_Nucleotide_3
back_sites: mythos.utils.types.Arr_Nucleotide_3
back_sites_dna1: mythos.utils.types.Arr_Nucleotide_3
base_sites: mythos.utils.types.Arr_Nucleotide_3
back_base_vectors: mythos.utils.types.Arr_Nucleotide_3
base_normals: mythos.utils.types.Arr_Nucleotide_3
cross_prods: mythos.utils.types.Arr_Nucleotide_3
static from_rigid_body(rigid_body: jax_md.rigid_body.RigidBody, com_to_backbone_x: mythos.utils.types.Scalar, com_to_backbone_y: mythos.utils.types.Scalar, com_to_backbone_dna1: mythos.utils.types.Scalar, com_to_hb: mythos.utils.types.Scalar, com_to_stacking: mythos.utils.types.Scalar) Nucleotide[source]

Class method to precompute nucleotide sites from a rigid body.

class mythos.energy.dna2.Stacking[source]

Bases: mythos.energy.dna1.Stacking

Stacking energy function for DNA2 model.

params: mythos.energy.dna1.StackingConfiguration
pairwise_energies(body: mythos.energy.dna2.nucleotide.Nucleotide, seq: mythos.utils.types.Discrete_Sequence, bonded_neighbors: mythos.utils.types.Arr_Bonded_Neighbors_2) mythos.utils.types.Arr_Bonded_Neighbors[source]

Computes the stacking energy for each bonded pair.

compute_energy(nucleotide: mythos.energy.dna2.nucleotide.Nucleotide) mythos.utils.types.Scalar[source]

Compute the energy of the system given the nucleotide.

mythos.energy.dna2.default_configs() tuple[mythos.utils.types.PyTree, mythos.utils.types.PyTree][source]

Return the default simulation and energy configurations for dna2.

mythos.energy.dna2.default_energy_configs(overrides: dict = MappingProxyType({}), opts: dict = MappingProxyType({})) list[mythos.energy.configuration.BaseConfiguration][source]

Return the default configurations for the energy functions for dna2.

mythos.energy.dna2.default_energy_fns() list[mythos.energy.base.BaseEnergyFunction][source]

Return the default energy functions for dna2.

mythos.energy.dna2.default_transform_fn() callable[source]

Return the default transform function for dna2 simulations.

mythos.energy.dna2.create_default_energy_fn(topology: mythos.input.topology.Topology, displacement_fn: callable = DEFAULT_DISPLACEMENT) mythos.energy.base.EnergyFunction[source]

Create the default oxDNA2 energy function.

This creates the composed energy function from the default set of function classes, associated configs, and the default transform function - built for the provided topology and displacement function.

Parameters:
  • topology – The topology of the system.

  • displacement_fn – The displacement function to use. defaults to DEFAULT_DISPLACEMENT.