fractaldna.dna_models.dnachain.Solenoid

class fractaldna.dna_models.dnachain.Solenoid(voxelheight=750, radius=100, nhistones=38, histone_angle=50, twist=False, chain=0)

Bases: PlottableSequence

Inherits from PlottableSequence

Define Solenoidal DNA in a voxel (basically a box).

This method works by placing histones around the z-axis (≈6 histones per rotation) and then joining them together using SplineLinkers

Parameters:
  • voxelheight (float) – Height of ‘voxel’ in angstrom

  • radius (float) – Radius from Solenoid centre to histone centre

  • nhistones (int) – Number of histones to place

  • histone_angle (float) – tilt of histones from axis in degrees

  • twist (bool) – whether the DNA exiting the final spine should be rotated an extra pi/2.

  • chain (int) – Chain index for solenoid and basepairs therein

__init__(voxelheight=750, radius=100, nhistones=38, histone_angle=50, twist=False, chain=0)

Methods

__init__([voxelheight, radius, nhistones, ...])

histones_to_frame()

Get Histones in Solenoid as a dataframe of their positions

setChain(chainIdx)

Set the Chain Index of all base pairs in the solenoid

to_frame([suppress_hash])

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

to_surface_plot()

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

setChain(chainIdx)

Set the Chain Index of all base pairs in the solenoid

Parameters:

chainIdx (int) – Index for Chain

Return type:

None

to_frame(suppress_hash=False)

Return the molecules as a pandas data frame

Parameters:

suppress_hash (bool) – Hide the hash in front of the ‘name’ column which is kept for compatibiilty with the Geant4 DNA simulation format

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 plot

  • plot_b (bool) – Show Bases in plot

  • plot_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