Skip to content

Build

make(sequence=None, control_points=None, circular=False, closed=False, n_bp=None, dLk=None)

Generate a DNA structure from a given DNA sequence and control points.

Parameters:

Name Type Description Default
sequence str

DNA sequence code. If not provided, the default sequence 'CGCGAATTCGCG' will be used. (default: None)

None
control_points ndarray

Control points of the DNA structure. Should be a numpy array of shape (n, 3) where n is the number of control points. If not provided, a straight line will be used as the default control points. (default: None)

None
circular bool

Flag indicating if the DNA structure is circular/closed. If True, the DNA structure will be closed. If False, the DNA structure will be open. (default: False)

False
closed bool

Flag indicating if the DNA structure is closed. If True, the DNA structure will be closed. If False, the DNA structure will be open. This argument is deprecated and will be removed in a future version. Please use the 'circular' argument instead. (default: False)

False
n_bp int

Number of base pairs to scale the shape with. If not provided, the number of base pairs will be determined based on the length of the control points or the sequence. (default: None)

None
dLk int

Change in twist in terms of Linking number of the DNA structure. If not provided, a neutral twist based on bp_per_turn = 10.5 will be used. (default: None)

None

Returns:

Name Type Description
Nucleic object

DNA structure object.

Example

Generate a DNA structure from a sequence

dna = make(sequence='CGCGAATTCGCG', control_points=None, circular=False, closed=False, n_bp=None, dLk=None)

connect(Nucleic0, Nucleic1, sequence=None, n_bp=None, leader=0, frame=-1, margin=1, minimize=True, exvol_rad=0.0, temperature=300, control_points=None, index=0)

Connect two DNA structures by creating a new DNA structure with a connecting DNA strand.

The 3' end of the first DNA structure is connected to the 5' end of the second DNA structure. To connect the two strands, a straight line is interpolated between the two ends, and the optimal number of base pairs is distributed to achieve a neutral twist.

Parameters:

Name Type Description Default
Nucleic0 Nucleic

First DNA structure to connect.

required
Nucleic1 Nucleic

Second DNA structure to connect.

required
sequence str or List

DNA sequence of the connecting DNA strand. Default is None.

None
n_bp int

Number of base pairs of the connecting DNA strand. Default is None.

None
leader int

The leader of the DNA structure to connect. Default is 0.

0
frame int

The time frame to connect. Default is -1.

-1
margin int

Number of base pairs to fix at the end. Default is 1.

1
minimize bool

Whether to minimize the new DNA structure. Default is True.

True
exvol_rad float

Radius for excluded volume interactions during minimization. Default is 0.0.

0.0
temperature int

Temperature for minimization. Default is 300.

300

Returns:

Name Type Description
Nucleic object

DNA structure with the two DNA structures connected.

Raises:

Type Description
ValueError

If either of the DNA structures is circular.

Notes
  • The minimization does not use excluded volume interactions by default.This is because the excluded volume interactions require the EV beads to have no overlap. However, in the initial configuration, the EV beads are likely to have overlap. If desired, the resulting Nucleic object can be further minimized with the excluded volume interactions.
Example

Connect two DNA structures

dna = connect(Nucleic0, Nucleic1, margin=5)

Contains mdna DNA structure with reference frames and trajectory

extend(n_bp=None, sequence=None, fixed_endpoints=False, forward=True, frame=-1, shape=None, margin=1, minimize=True, plot=False, exvol_rad=2.0, temperature=300)

Extend the DNA structure in the specified direction. The method updates the attributes of the DNA object.

Parameters:

Name Type Description Default
n_bp int

Number of base pairs to extend the DNA structure. Defaults to None.

None
sequence str or List

DNA sequence to extend the DNA structure. If not provided, the sequence will be generated randomly. Defaults to None.

None
fixed_endpoints bool

Whether to fix the endpoints of the DNA structure during extension. Defaults to False.

False
forward bool

Whether to extend the DNA structure in the forward direction. If False, the DNA structure will be extended in the backward direction. Defaults to True.

True
frame int

The time frame to extend. Defaults to -1.

-1
shape ndarray

Control points of the shape to be used for extension. The shape should be a numpy array of shape (n, 3), where n is greater than 3. Defaults to None.

None
margin int

Number of base pairs to fix at the end/start of the DNA structure during extension. Defaults to 1.

1
minimize bool

Whether to minimize the new DNA structure after extension. Defaults to True.

True
plot bool

Whether to plot the Energy during minmization. Defaults to False.

False
exvol_rad float

Excluded volume radius. Defaults to 2.0.

2.0
temperature int

Temperature for equilibration. Defaults

300

Raises:

Type Description
ValueError

If the DNA structure is circular and cannot be extended.

ValueError

If neither a fixed endpoint nor a length is specified for extension.

ValueError

If the input sequence is invalid or the number of base pairs is invalid.

Notes
  • If the DNA structure is circular, it cannot be extended.
Example

Extend DNA structure

nuc = mdna.make(n_bp=100)
nuc.extend(n_bp=10, forward=True, margin=2, minimize=True)