Minimizer¶
Monte Carlo energy minimization for DNA structures using the PMCpy engine.
mdna.minimizer.Minimizer
¶
Monte Carlo energy minimization of DNA structures using the PMCpy engine.
The Minimizer relaxes a Nucleic object by running rigid base-pair Monte
Carlo simulations with sequence-dependent elastic potentials and optional
excluded-volume interactions. Three equilibration strategies are available:
- Full equilibration (default) — adaptive convergence monitoring.
- Simple equilibration — fixed-sweep protocol, faster but less thorough.
- Writhe equilibration — maintains linking number while equilibrating writhe for circular DNA (requires compiled PyLk Cython extensions).
After minimization the internal frames are updated in-place and the full MC
trajectory can be retrieved via :meth:get_MC_traj.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nucleic
|
Nucleic
|
A :class: |
required |
Raises:
| Type | Description |
|---|---|
ImportError
|
If the PMCpy |
Source code in mdna/minimizer.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | |
get_MC_traj()
¶
Build an MDTraj Trajectory from the MC sampling snapshots.
Each frame contains Argon atoms at base-pair center positions and Helium (dummy) atoms offset along the major-groove vector, connected by bonds. This allows visualization of the MC relaxation path.
Returns:
| Type | Description |
|---|---|
Trajectory
|
md.Trajectory: An MDTraj trajectory with |
Source code in mdna/minimizer.py
minimize(frame=-1, exvol_rad=2.0, temperature=300, simple=False, equilibrate_writhe=False, endpoints_fixed=True, fixed=[], dump_every=20, plot=False)
¶
Run Monte Carlo energy minimization on the DNA structure.
Initializes the PMCpy engine with the current base-pair frames and sequence, performs MC equilibration, and updates the internal frames with the relaxed configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frame
|
int
|
Index of the stored frame to minimize (default |
-1
|
exvol_rad
|
float
|
Excluded-volume radius in nm. Base pairs closer than this distance incur a repulsive energy penalty. |
2.0
|
temperature
|
int
|
Temperature in Kelvin for the Metropolis acceptance criterion. |
300
|
simple
|
bool
|
If True, use simple (fixed-sweep) equilibration instead of the adaptive convergence protocol. |
False
|
equilibrate_writhe
|
bool
|
If True, additionally equilibrate the writhe
for circular DNA. Requires |
False
|
endpoints_fixed
|
bool
|
If True, the first and last base pairs are held fixed during the simulation. |
True
|
fixed
|
List[int]
|
List of base-pair indices to keep fixed. |
[]
|
dump_every
|
int
|
Save a trajectory snapshot every n MC sweeps. |
20
|
plot
|
bool
|
If True, plot the energy trace during full equilibration. |
False
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |