fractaldna.dna_models.dnachain.MultiSolenoidVolume¶
- class fractaldna.dna_models.dnachain.MultiSolenoidVolume(voxelheight=1500.0, separation=400, twist=False, turn=False, chains=[0, 1, 2, 3, 4, 5, 6, 7, 8], nhistones=None, radius=100, histone_angle=50)¶
Bases:
PlottableSequence
Class to build placement volumes that contain multiple solenoidal DNA strands.
Constructor:
- MultiSolenoidVolume(voxelheight=1500., separation=400, twist=False,
turn=False)
voxelheight: size of placement volume separation: separation between DNA strands
The class can contain up to 9 strands with indices as follows
0: central strand 1: x = separation, y = 0 2: x = 0, y = separation 3: x = -separation, y = 0 4: x = separation, y = separation 5: x = separation, y = separation 6: x = -separation, y = separation 7: x = -separation, y = -separation 8: x = separation, y = -seperation
Try: dna = MultiSolenoidVolume() dna.to_line_plot() dna.to_text()
- Parameters:
voxelheight (
float
) – Height of ‘voxel’ in angstromseparation (
float
) – separation between DNA strandstwist (
bool
) – whether the DNA exiting the final spine should be rotated an extra pi/2.turn (
bool
) – make a turned volume (turn strand 90°)chains (
List
) – List of chains to plot, e.g. [0, 1, 2, 3, 4] for a central strand (0) and 4 strands along the X/Y axes.radius (
float
) – Radius from Solenoid centre to histone centrenhistones (
Optional
[int
]) – Number of histones to place (if None, will default) to int(38 * voxelheight / 750.0)histone_angle (
float
) – tilt of histones from axis in degrees
- __init__(voxelheight=1500.0, separation=400, twist=False, turn=False, chains=[0, 1, 2, 3, 4, 5, 6, 7, 8], nhistones=None, radius=100, histone_angle=50)¶
Methods
__init__
([voxelheight, separation, twist, ...])Get Histones in Solenoid as a dataframe of their positions
to_frame
()Return the molecules as a pandas data frame
to_line_plot
([size])Return a mayavi figure instance with histone and linkers shown
to_plot
([plot_p, plot_b, plot_s])Return a matplotlib.Figure instance with molecules plotted
to_strand_plot
([plot_p, plot_b, plot_s, plot_bp])Return a mayavi figure instance with strands plotted
Plot the surfaces of each molecule in the chain.
to_text
([seperator])Return a description of the molecules in the chain as text
translate
(translation)Translate the solenoid spatially
- histones_to_frame()¶
Get Histones in Solenoid as a dataframe of their positions
- Return type:
DataFrame
- Returns:
DataFrame of Histones
- to_frame()¶
Return the molecules as a pandas data frame
- Return type:
DataFrame
- Returns:
Pandas data frame with molecule information
- to_line_plot(size=(400, 350))¶
Return a mayavi figure instance with histone and linkers shown
- Parameters:
size (
Tuple
[int
,int
]) – Figure size (width, height)- Returns:
mayavi figure
- Raises:
ImportError – MayaVi likely Not installed
- to_plot(plot_p=True, plot_b=True, plot_s=True)¶
Return a matplotlib.Figure instance with molecules plotted
- Parameters:
plot_p (
bool
) – Show Phosphates in plotplot_b (
bool
) – Show Bases in plotplot_s (
bool
) – Show sugars in plot
- Return type:
Figure
- Returns:
Matplotlib Figure
- to_strand_plot(plot_p=True, plot_b=True, plot_s=True, plot_bp=False)¶
Return a mayavi figure instance with strands plotted
:param plot_p : plot phosphate strands :param plot_s : plot sugar strands :param plot_b : plot base strands :param plot_bp : join base pairs together
- Returns:
Mayavi Figure
- Raises:
ImportError – MayaVi not imported
- to_surface_plot()¶
Plot the surfaces of each molecule in the chain. Avoid this with large chains, this assumes each molecule is an ellipse
- Return type:
Figure
- Returns:
Matplotlib figure (contour plot)
- to_text(seperator=' ')¶
Return a description of the molecules in the chain as text
- Parameters:
seperator (
str
) – column seperator- Return type:
str
- translate(translation)¶
Translate the solenoid spatially
- Parameters:
translation (
Union
[List
,array
]) – 3-vector for translation- Return type:
None