generators¶
Generates simple DNA structures.
-
class
generators.StrandGenerator¶ Strand generator object.
-
generate(bp, sequence=None, start_pos=<mynumpy.mynumpy_core.array object>, dir=<mynumpy.mynumpy_core.array object>, perp=None, rot=0.0, double=True, circular=False, DELTA_LK=0, BP_PER_TURN=10.34, ds_start=None, ds_end=None, force_helicity=False)¶ Returns one (for single strand) or two (for duplex) base.Strand object(s).
- linear / circular (circular)
- ssDNA / dsDNA (double)
- Combination of ss/dsDNA (ds_start, ds_end)
Parameters: - bp – Integer number of bp/nt (required)
- sequence –
Array of integers or strings. Should be same length as bp (default None). Default (None) generates a random sequence.
Ex: [0,1,2,3,0]
Ex: “AGCTA”
See dictionary base.base_to_number for int/char conversion {0:’A’}
- start_pos – Location to begin building the strand (default np.array([0, 0, 0]))
- dir – a3 vector, orientation of the base (default np.array([0, 0, 1]))
- perp –
Sets a1 vector, the orientation of the backbone. (default False)
Must be perpendicular to dir (as a1 must be perpendicular to a3)
If perp is None or False, perp is set to a random orthogonal angle
- rot – Rotation of first bp (default 0.)
- double – Generate dsDNA (default True)
- circular –
Generate closed circular DNA (defalt False)
Limitations: For ssDNA (double=False): bp >= 4; For dsDNA (double=True) : bp >= 30
Will throw warnings. Allowed, but use at your own risk.
- DELTA_LK – Integer change in linking number from Lk0 (default 0). Only valid if circular==True
- BP_PER_TURN – Base pairs per complete 2*pi helix turn. (default 10.34). Only valid if circular==True
- ds_start – Index (from 0) to begin double stranded region (default None)
- ds_end –
Index (from 0) to end double stranded region (default None)
Default is None, which is entirely dsDNA; sets ds_start = 0, ds_end=bp
Ex: ds_start=0, ds_end=10 will create a double stranded region on bases range(0,10): [0,1,2,3,4,5,6,7,8,9]
Note: To generate a nicked circular dsDNA, manually change state with {Strand}.make_noncircular()
- force_helicity – Force generation of helical strands. Use helicity by default for bp > 30. Warns from 18 to 29. Will crash oxDNA below 18. (default False)
Notes
Minimuim circular duplex is 18. Shorter circular strands disobey FENE. For shorter strands, circular ssDNA is generated in a circle instead of having imposed helicity.
Examples:
Generate ssDNA:
generate(bp=4, sequence=[0,1,2,3], double=False, circular=False)
Generate circular dsDNA with +2 Linking number:
generate(bp=45, double=True, circular=True, DELTA_LK=2)
Generate a circular ssDNA (45nt) with ssDNA (25nt) annealed to indices 0 to 24:
generate(bp=45, double=True, circular=True, ds_start=0, ds_end=25)
-