rnavigate.plots package
Subpackages
- rnavigate.plots.functions package
- Submodules
- rnavigate.plots.functions.circle module
- rnavigate.plots.functions.functions module
- rnavigate.plots.functions.ss module
- rnavigate.plots.functions.tracks module
- Module contents
adjust_spines()box_xtick_labels()clip_spines()get_contrasting_colors()get_nt_ticks()plot_annotation_circle()plot_annotation_ss()plot_annotation_track()plot_basepairs_ss()plot_domain_track()plot_interactions_arcs()plot_interactions_circle()plot_interactions_ss()plot_nucleotides_ss()plot_positions_ss()plot_profile_bars()plot_profile_skyline()plot_sequence_alignment()plot_sequence_ss()plot_sequence_track()plot_structure_ss()set_nt_ticks()
Submodules
rnavigate.plots.alignment module
Plotting class for sequence alignments.
- class rnavigate.plots.alignment.Alignment(num_samples, rows=None, cols=1, **kwargs)
Bases:
PlotClass for plotting sequence alignments.
Parameters
- num_samplesint
The number of samples to plot. Always 2.
- rowsint, optional
The number of rows of plots. Always 1.
- colsint, optional
The number of columns of plots. Always 1.
- **kwargsdict
Additional keyword arguments to pass to plots.Plot.
Attributes
- regiontuple
The region of the alignment to plot. Defaults to (1, len(alignment1))
- figmatplotlib.figure.Figure
The figure containing the plot.
- axesnumpy.array
A 1x1 array of the axes containing the plot.
- plot_data(alignment, label, ax=None)
Add the alignment to the next (or given) axes.
Parameters
- alignmentrnavigate.Alignment
The alignment to plot.
- labelstr
The label for the alignment.
- axmatplotlib.axes.Axes, optional
The axes containing the plot. Defaults to None.
- set_figure_size(height_ax_rel=0.03, width_ax_rel=0.03, width_ax_in=None, height_ax_in=None, height_gap_in=1, width_gap_in=0.5, top_in=1, bottom_in=0.5, left_in=0.5, right_in=0.5)
Set the figure size for the plot.
Parameters
- height_ax_relfloat, optional
The relative height of each axes. Defaults to 0.03.
- width_ax_relfloat, optional
The relative width of each axes. Defaults to 0.03.
- width_ax_infloat, optional
The width of each axes in inches. Defaults to None.
- height_ax_infloat, optional
The height of each axes in inches. Defaults to None.
- height_gap_infloat, optional
The height of the gap between axes in inches. Defaults to 1.
- width_gap_infloat, optional
The width of the gap between axes in inches. Defaults to 0.5.
- top_infloat, optional
The top margin in inches. Defaults to 1.
- bottom_infloat, optional
The bottom margin in inches. Defaults to 0.5.
- left_infloat, optional
The left margin in inches. Defaults to 0.5.
- right_infloat, optional
The right margin in inches. Defaults to 0.5.
rnavigate.plots.arc module
Module for plotting arc plots.
- class rnavigate.plots.arc.AP(num_samples, nt_length, region='all', track_labels=True, **kwargs)
Bases:
PlotClass for plotting arc plots
Parameters
- num_samplesint
Number of samples to plot
- nt_lengthint
Length of the sequence
- regiontuple of 2 integers, optional
starting and ending positions of the region to plot. Default is “all”, which plots the entire sequence.
- track_labelsbool, optional
Whether to plot track labels. Default is True.
- **kwargs
Additional keyword arguments are passed to plots.Plot
Attributes
- nt_lengthint
Length of the sequence
- regiontuple of 2 integers
starting and ending positions of the region to plot.
- track_labelsbool
Whether to plot track labels.
- figmatplotlib.figure.Figure
Figure object containing the plot
- axesnumpy.ndarray of matplotlib.axes.Axes
Array of axes objects containing the plots
- iint
Index of the current plot
- plot_data(sequence, structure=None, structure2=None, interactions=None, interactions2=None, profile=None, annotations=None, domains=None, label='', ax=None, seqbar=True, title=True, panels=None, annotation_mode='track', track_height=None, profile_scale_factor=1, plot_error=False, nt_ticks=(20, 5))
Add data to the next (or specified) plot axes.
This function assumes data has already been aligned to a common sequence. rnavigate.plot_ functions can be used to automatically align data.
Parameters
- sequencernavigate.data.Sequence
Sequence object containing the sequence to plot
- structurernavigate.data.Structure, optional
Structure object containing a structure to plot
- structure2rnavigate.data.Structure, optional
Structure object containing a structure to compare to the first
- interactionsrnavigate.data.Interactions, optional
Interactions object containing inter-nucleotide data to plot
- interactions2rnavigate.data.Interactions, optional
Interactions object containing other inter-nucleotide data to plot
- profilernavigate.data.Profile, optional
Profile object containing per-nucleotide data to plot
- annotationslist of rnavigate.data.Annotation, optional
List of Annotation objects containing annotations to plot
- domainslist of rnavigate.data.Spans, optional
List of Spans objects containing domains to plot
- labelstr, defaults to “”
Label for the title of the plot.
- axmatplotlib.axes.Axes, optional
Axes object to plot on. If None, the next axes in the figure will be used.
- seqbarbool, Defaults to True
Whether to plot the sequence track.
- titlebool, defaults to True
Whether to show the title.
- panelsdict, optional
Dictionary of panels to plot, with keys being the panel name and values being the panel location. Default is {“interactions”: “bottom”, “interactions2”: “bottom”, “structure”: “top”, “profile”: “top”}
- annotation_mode“track” or “bar”, defaults to “track”
Mode for plotting annotations.
- track_heightint, optional
Height of the track. If None, the height is automatically determined.
- profile_scale_factorfloat, defaults to 1
Scale factor for the profile track.
- plot_errorbool, defaults to False
Whether to plot the error bars for the profile track.
- nt_tickstuple of 2 ints, optional
Major and minor tick spacing for the nucleotide axis. Default is (20, 5).
- set_axis(ax, sequence, track_height=0, nt_ticks=(20, 5), max_height=300, yticks=None, ylabels=None)
Set up the plotting axis settings for an aesthetic arc plot.
Sets the following properties of the given axis: 1. spine positions 2. x-axis and y-axis limits 3. x-axis tick labels and positions according to sequence 4. background boxes for x-axis tick labels 5. y-axis tick labels and positions according to track_height and ylabels
Parameters
- axmatplotlib.axes.Axes
Axes object to set up.
- sequencestr
Sequence to plot.
- track_heightint, optional
Height of the track. If None, the height is automatically determined.
- nt_tickstuple of 2 ints, optional
Major and minor tick spacing for the nucleotide axis. Default is (20, 5).
- max_heightint, optional
Maximum height of the plot. Default is 300.
- ytickslist of ints, optional
List of ytick positions. If None, the yticks are automatically determined.
- ylabelslist of str, optional
List of ytick labels. If None, the ylabels are automatically determined.
- set_figure_size(height_ax_rel=0.03, width_ax_rel=0.03, width_ax_in=None, height_ax_in=None, height_gap_in=0.5, width_gap_in=0.5, top_in=1, bottom_in=1, left_in=1, right_in=1)
Set the figure size for an arc plot.
Parameters
- height_ax_relfloat, Default is 0.03.
Relative height of each axes.
- width_ax_relfloat, Default is 0.03.
Relative width of each axes.
- width_ax_infloat, optional
Absolute width of each axes in inches. If None, the width is automatically determined.
- height_ax_infloat, optional
Absolute height of each axes in inches. If None, the height is automatically determined.
- height_gap_infloat, Default is 0.5.
Absolute height of the gap between axes in inches.
- width_gap_infloat, Default is 0.5.
Absolute width of the gap between axes in inches.
- top_infloat, Default is 1.
Absolute top margin in inches.
- bottom_infloat, Default is 1.
Absolute bottom margin in inches.
- left_infloat, Default is 1.
Absolute left margin in inches.
- right_infloat, Default is 1.
Absolute right margin in inches.
rnavigate.plots.circle module
Circle plot class.
- class rnavigate.plots.circle.Circle(num_samples, **kwargs)
Bases:
PlotCreate a circle plot.
Parameters
- num_samplesint
Number of samples to plot.
- **kwargs
Keyword arguments passed to
rnavigate.plots.Plot.
Attributes
- zorderdict
Dictionary of zorder values for each plot element.
- figmatplotlib.figure.Figure
Figure object.
- axnumpy.ndarray of matplotlib.axes.Axes
Array of axes objects.
- iint
Index of current axes object. Increments with each call to
rnavigate.plots.Circle.plot_data().
- plot_data(sequence, structure=None, structure2=None, interactions=None, interactions2=None, profile=None, annotations=None, label=None, colors=None, gap=30, nt_ticks=(20, 5))
Plot data on the current (or specified) axes.
Parameters
- sequencernavigate.data.Sequence
Sequence object to plot around the circle.
- structurernavigate.data.Structure, defaults to None
Structure object to plot as lines within the circle.
- structure2rnavigate.data.Structure, defaults to None
Structure object to compare to structure.
- interactionsrnavigate.data.Interactions, defaults to None
Interactions object to plot as lines within the circle.
- interactions2rnavigate.data.Interactions, defaults to None
Interactions object to plot as lines within the circle.
- profilernavigate.data.Profile, defaults to None
Profile object used to color the sequence.
- annotationslist of rnavigate.data.Annotation, defaults to None
List of Annotation objects to highlight regions around the circle.
- labelstr, defaults to None
Label for the plot title.
- colorsdict, defaults to None
Dictionary of colors for each plot element.
- gapfloat, defaults to 30
Gap between the start and end of the sequence in degrees.
- nt_tickstuple of int, defaults to (20, 5)
Gap between major and minor nucleotide ticks in degrees.
- set_axis(ax, label, seq_circle, gap, nt_ticks)
Set axis limits and ticks.
Parameters
- axmatplotlib.axes.Axes
Axes object to modify.
- labelstr
Label for the plot title.
- seq_circlernavigate.data.SequenceCircle
SequenceCircle object.
- gapfloat
Gap between the start and end of the sequence in degrees.
- nt_tickstuple of 2 integers
Gap between major and minor nucleotide ticks in degrees.
- set_figure_size(height_ax_rel=0.035, width_ax_rel=0.035, width_ax_in=None, height_ax_in=None, height_gap_in=1, width_gap_in=1, top_in=1, bottom_in=0.5, left_in=0.5, right_in=0.5)
Set figure size.
Parameters
- height_ax_relfloat, defaults to 0.035
Height of axes relative to the y-axis limits.
- width_ax_relfloat, defaults to 0.035
Width of axes relative to the x-axis limits.
- width_ax_infloat, defaults to None (overridden by width_ax_rel)
Width of axes in inches.
- height_ax_infloat, defaults to None (overridden by height_ax_rel)
Height of axes in inches.
- height_gap_infloat, defaults to 1
Height of gap between axes in inches.
- width_gap_infloat, defaults to 1
Width of gap between axes in inches.
- top_infloat, defaults to 1
Height of top margin in inches.
- bottom_infloat, defaults to 0.5
Height of bottom margin in inches.
- left_infloat, defaults to 0.5
Width of left margin in inches.
- right_infloat, defaults to 0.5
Width of right margin in inches.
rnavigate.plots.disthist module
Plot distance histograms.
- class rnavigate.plots.disthist.DistHist(num_samples, **plot_kwargs)
Bases:
PlotCreate a distance histogram plot.
Parameters
- num_samplesint
Number of samples to plot.
- **kwargs
Keyword arguments passed to
rnavigate.plots.Plot.
Attributes
- figmatplotlib.figure.Figure
Figure object.
- axesnumpy.ndarray of matplotlib.axes.Axes
Array of axes objects.
- axes2dict
Dictionary of twin axes objects. Keys are axes objects from
rnavigate.plots.DistHist.axes.- iint
Index of current axes object. Increments with each call to
rnavigate.plots.DistHist.plot_data().
- plot_data(structure, interactions, bg_interactions, label, atom="O2'", ax=None)
Plot data on the current (or specified) axes object.
Parameters
- structurernavigate.data.SecondaryStructure or rnavigate.data.PDB
Structure object to compute contact distances or 3D distances.
- interactionsrnavigate.data.Interactions
Filtered Interactions object to to visualize pairwise distances.
- bg_interactionsrnavigate.data.Interactions
Filtered Interactions object to to visualize pairwise background distances.
- labelstr
Label for the current axes object.
- atomstr, defaults to “O2’”
Atom to compute distances from.
- axmatplotlib.axes.Axes, defaults to None
Axes object to plot on. If None, use the current axes object.
- plot_experimental_distances(ax, structure, interactions, atom, histtype='bar')
Plot pairwise distances from the interactions object.
Parameters
- axmatplotlib.axes.Axes
Axes object to plot on.
- structurernavigate.data.SecondaryStructure or rnavigate.data.PDB
Structure object to compute contact distances or 3D distances.
- interactionsrnavigate.data.Interactions
Filtered Interactions object to to visualize pairwise distances.
- atomstr
Atom to compute distances from.
- histtype“bar” or “step”, defaults to “bar”
Type of histogram to plot.
- plot_structure_distances(ax, structure, atom)
Plot all distances in the structure.
Parameters
- axmatplotlib.axes.Axes
Axes object to plot on.
- structurernavigate.data.SecondaryStructure or rnavigate.data.PDB
Structure object to compute contact distances or 3D distances.
- atomstr
Atom to compute distances from.
- set_figure_size(height_ax_rel=None, width_ax_rel=None, width_ax_in=2, height_ax_in=2, height_gap_in=1, width_gap_in=0.4, top_in=1, bottom_in=1, left_in=1, right_in=1)
Set figure size.
Parameters
- height_ax_relfloat, defaults to None
Height of axes objects relative to y-axis limits.
- width_ax_relfloat, defaults to None
Width of axes objects relative to x-axis limits.
- width_ax_infloat, defaults to 2
Width of axes objects in inches.
- height_ax_infloat, defaults to 2
Height of axes objects in inches.
- height_gap_infloat, defaults to 1
Height of gap between axes objects in inches.
- width_gap_infloat, defaults to 0.4
Width of gap between axes objects in inches.
- top_infloat, defaults to 1
Height of top margin in inches.
- bottom_infloat, defaults to 1
Height of bottom margin in inches.
- left_infloat, defaults to 1
Width of left margin in inches.
- right_infloat, defaults to 1
Width of right margin in inches.
rnavigate.plots.heatmap module
Heatmap plot class.
- class rnavigate.plots.heatmap.Heatmap(num_samples, structure, **plot_kwargs)
Bases:
PlotCreate a heatmap plot.
Parameters
- num_samplesint
Number of samples to plot.
- structurernavigate.data.SecondaryStructure or rnavigate.data.PDB
Structure object.
- **kwargs
Keyword arguments passed to
rnavigate.plots.Plot.
Attributes
- structurernavigate.data.SecondaryStructure or rnavigate.data.PDB
Structure object.
- figmatplotlib.figure.Figure
Figure object.
- axesnumpy.ndarray of matplotlib.axes.Axes
Array of axes objects.
- iint
Index of current axes object. Increments with each call to
rnavigate.plots.Heatmap.plot_data().
- plot_contour_distances(ax, levels, atom)
Plot contour distances on the current (or specified) axes.
Parameters
- axmatplotlib.axes.Axes
Axes object to plot on.
- levelslist of float, defaults to None
Levels for contour lines. If None, levels are set automatically. [5] for SecondaryStructure, [20] for PDB.
- atomstr, defaults to “O2’”
Atom to use for calculating distances.
- plot_contour_regions(ax, interactions, regions)
Plot contour regions on the current (or specified) axes.
Parameters
- axmatplotlib.axes.Axes
Axes object to plot on.
- interactionsrnavigate.data.Interactions
Interactions object containing inter-nucleotide data to plot as heatmap.
- regionslist of tuple of int
Regions to plot as contour lines.
- plot_data(interactions, label, levels=None, regions=None, interpolation=None, atom="O2'", plot_type='heatmap', weights=None)
Plot heatmap and contour data on the current (or specified) axes.
Parameters
- interactionsrnavigate.data.Interactions
Interactions object containing inter-nucleotide data to plot as heatmap.
- labelstr
Label for plot title.
- levelslist of float, defaults to None
Levels for contour lines. If None, levels are set automatically. [5] for SecondaryStructure, [20] for PDB.
- regionslist of tuple of int, defaults to None
Regions to plot as contour lines. If None, distances are plotted.
- interpolationstr, defaults to None
Interpolation method for heatmap. If None, no interpolation is used.
- atomstr, defaults to “O2’”
Atom to use for calculating distances.
- plot_type“heatmap” or “kde”, defaults to “heatmap”
Type of plot to create.
- weightsarray-like, defaults to None
A column name of interactions to use as weights for KDE plot.
- plot_heatmap_data(ax, interactions, interpolation)
Plot heatmap data on the specified axes.
Parameters
- axmatplotlib.axes.Axes
Axes object to plot on.
- interactionsrnavigate.data.Interactions
Interactions object containing inter-nucleotide data to plot as heatmap.
- interpolationstr, defaults to None
Interpolation method for heatmap. If None, no interpolation is used.
- plot_kde_data(ax, interactions, weights=None, **kwargs)
Plot KDE data on the specified axes.
Parameters
- axmatplotlib.axes.Axes
Axes object to plot on.
- interactionsrnavigate.data.Interactions
Interactions object containing inter-nucleotide data to plot as KDE.
- weightsarray-like, defaults to None
A column name of interactions to use as weights for KDE plot.
- **kwargs
Keyword arguments passed to
seaborn.kdeplot().
- set_figure_size(height_ax_rel=None, width_ax_rel=None, width_ax_in=2, height_ax_in=2, height_gap_in=1, width_gap_in=0.5, top_in=1, bottom_in=0.5, left_in=0.5, right_in=0.5)
Set figure size.
Parameters
- height_ax_relfloat, defaults to None
Height of each axes object relative to y-axis limits.
- width_ax_relfloat, defaults to None
Width of each axes object relative to x-axis limits.
- width_ax_infloat, defaults to 2
Width of each axes object in inches.
- height_ax_infloat, defaults to 2
Height of each axes object in inches.
- height_gap_infloat, defaults to 1
Height of gap between axes objects in inches.
- width_gap_infloat, defaults to 0.5
Width of gap between axes objects in inches.
- top_infloat, defaults to 1
Top margin in inches.
- bottom_infloat, defaults to 0.5
Bottom margin in inches.
- left_infloat, defaults to 0.5
Left margin in inches.
- right_infloat, defaults to 0.5
Right margin in inches.
rnavigate.plots.linreg module
Plot linear regression scatter plots.
- class rnavigate.plots.linreg.LinReg(num_samples, scale='linear', regression='pearson', kde=False, region='all')
Bases:
PlotPlot a linear regression scatter plot, pairwise, between profiles.
Parameters
- num_samplesint
Number of samples to plot.
- scalestr, optional
Scale of the plot, either ‘linear’ or ‘log’. The default is ‘linear’.
- regression‘pearson’ or ‘spearman’, Defaults to ‘pearson’
Type of regression to perform.
- kdebool, optional
Whether to plot a kernel density estimate instead of a scatter plot. The default is False.
- region‘all’ or tuple of 2 integers, defaults to ‘all’
Start and end positions of the region to plot. If ‘all’, plot the entire profile.
Attributes
- figmatplotlib.figure.Figure
Figure of the plot.
- axesnumpy.ndarray of matplotlib.axes.Axes
Axes of the plot.
- lengthint
Number of samples to plot.
- limslist of 2 floats
Limits of the plot applied to all x and y axes.
- profileslist of numpy.ndarray
Each sample’s per-nucleotide values over the region and column of interest.
- colorslist of numpy.ndarray
A color for each nucleotide in the region applied to the scatter plot.
- labelslist of str
A label for each sample.
- scale‘linear’ or ‘log’
Scale of the plot axes.
- kdebool
Whether to plot a kernel density estimate instead of a scatter plot.
- regressionfunction
Regression function to use.
- regiontuple of 2 integers
Start and end positions of the region to plot.
- finalize()
Finalize the plot by formatting the axes and adding labels.
- plot_data(structure, profile, annotations, label, column=None, colors='sequence')
Add profile data. If all samples have been added, plot the regression.
Parameters
- structureStructure
Structure object.
- profileProfile
Profile object.
- annotationsAnnotations
Annotations object.
- labelstr
Label for the sample.
- columnstr, optional
Column of the profile to plot. The default is None.
- colorsstr, optional
Color scheme to use. The default is ‘sequence’.
- plot_regression(i, j)
Plot a linear regression between two profiles.
Profiles must already have been added using plot_data.
Parameters
- iint
Index of the first profile.
- jint
Index of the second profile.
- set_figure_size(height_ax_rel=None, width_ax_rel=None, width_ax_in=2, height_ax_in=2, height_gap_in=0.3, width_gap_in=0.3, top_in=1, bottom_in=0.5, left_in=0.5, right_in=0.5)
Set the figure size.
Parameters
- height_ax_relfloat, defaults to None
Height of the axes relative to the y-axis limits.
- width_ax_relfloat, defaults to None
Width of the axes relative to the x-axis limits.
- width_ax_infloat, defaults to 2
Width of the axes in inches.
- height_ax_infloat, defaults to 2
Height of the axes in inches.
- height_gap_infloat, defaults to 0.3
Height of the gap between axes in inches.
- width_gap_infloat, defaults to 0.3
Width of the gap between axes in inches.
- top_infloat, defaults to 1
Top margin of the figure in inches.
- bottom_infloat, defaults to 0.5
Bottom margin of the figure in inches.
- left_infloat, defaults to 0.5
Left margin of the figure in inches.
- right_infloat, defaults to 0.5
Right margin of the figure in inches.
rnavigate.plots.mol module
Module for plotting 3Dmol.js viewers
- class rnavigate.plots.mol.Mol(num_samples, pdb, width=400, height=400, background_alpha=1, rotation=None, orientation=None, style='cartoon', rows=None, cols=None)
Bases:
Plot- add_lines(i, j, color, viewer, atom)
Add lines between nucleotides i and j
Parameters
- iint
Index of the first nucleotide
- jint
Index of the second nucleotide
- colorstr
Color to use for the line
- viewertuple of ints
Tuple of ints defining the subviewer to plot on
- atomstr
Atom to use for plotting interactions
- get_orientation()
Adds a clickable event to the viewer to display the orientation vector.
- get_viewer(i=None)
Get the subviewer at index i
- hide_cylinders()
Hide the cylinders that represent nucleotides.
- plot_data(interactions=None, profile=None, label=None, colors='grey', atom="O2'", title=True, get_orientation=False, viewer=None)
Plot data on the current subviewer.
Parameters
- interactionsrnavigate.interactions.Interactions
Interactions object to plot as lines on the 3d structure
- profilernavigate.profile.Profile
Profile object to use as nucleotide colors
- labelstr, defaults to None
Label to use as a title on the subviewer
- colorsstr, defaults to “grey”
Color scheme to use for nucleotides
- atomstr, defaults to “O2’”
Atom to use for plotting interactions
- titlebool, defaults to True
Whether or not to add a title to the subviewer
- get_orientationbool, defaults to False
Whether or not to get the orientation of the subviewer This will display the orientation as a label on the subviewer when the structure is clicked.
- viewertuple of ints, defaults to None
Tuple of ints defining the subviewer to plot on
- plot_interactions(viewer, interactions, atom)
Plot interactions on the current subviewer
Parameters
- viewertuple of ints
Tuple of ints defining the subviewer to plot on
- interactionsrnavigate.interactions.Interactions
Interactions object to plot as lines on the 3d structure
- atomstr
Atom to use for plotting interactions
rnavigate.plots.ntdist module
Plot nucleotide distribution of a profile.
- class rnavigate.plots.ntdist.NucleotideDistribution(num_samples, **plot_kwargs)
Bases:
PlotPlot nucleotide distribution of a profile.
Parameters
- num_samplesint
Number of samples to plot.
- sharexbool, optional
Whether to share the x-axis between plots.
- colsint, optional
Number of columns in the plot.
- **plot_kwargs
Keyword arguments passed to the plot function.
Attributes
- figmatplotlib.figure.Figure
Figure object.
- axesnumpy.ndarray of matplotlib.axes.Axes
Array of axes objects.
- iint
Index of the current plot.
- plot_data(profile, label, column=None, normalize=None, ax=None)
Plot data to the current (or specified) axes.
Parameters
- profilernavigate.profile.Profile
Profile object.
- labelstr
label for the y-axis.
- columnstr, optional
Column of profile.data to plot.
- normalizedict, optional
Keyword arguments passed to profile.normalize.
- axmatplotlib.axes.Axes, optional
Axes object to plot to. If not specified, the current axes is used.
- set_figure_size(height_ax_rel=None, width_ax_rel=None, width_ax_in=2, height_ax_in=2, height_gap_in=0.2, width_gap_in=0.4, top_in=1, bottom_in=1, left_in=1, right_in=1)
Set the figure size.
Parameters
- height_ax_relfloat, optional
Height of the axes relative to the y-axis limits.
- width_ax_relfloat, optional
Width of the axes relative to the x-axis limits.
- width_ax_infloat, defaults to 2
Width of the axes in inches.
- height_ax_infloat, defaults to 2
Height of the axes in inches.
- height_gap_infloat, defaults to 0.2
Height of the gap between axes in inches.
- width_gap_infloat, defaults to 0.4
Width of the gap between axes in inches.
- top_infloat, defaults to 1
Top margin in inches.
- bottom_infloat, defaults to 1
Bottom margin in inches.
- left_infloat, defaults to 1
Left margin in inches.
- right_infloat, defaults to 1
Right margin in inches.
rnavigate.plots.plots module
- class rnavigate.plots.plots.ColorBar(num_samples, rows=None, cols=None, **kwargs)
Bases:
PlotPlot a colorbar.
Parameters
- rowsint, optional
Number of rows in the plot.
- **kwargs
Keyword arguments passed to matplotlib.pyplot.subplots.
Attributes
- figmatplotlib.figure.Figure
Figure object.
- axesnumpy.ndarray of matplotlib.axes.Axes
Array of axes objects.
- iint
Index of the current plot.
- plot_data(colorbar)
Add a colorbar to the current axes.
Parameters
- colorbarrnavigate.data.ScalarMappable
Colormap object.
- set_figure_size(height_ax_rel=None, width_ax_rel=None, width_ax_in=3, height_ax_in=0.1, height_gap_in=0.75, width_gap_in=0.5, top_in=0.5, bottom_in=0.5, left_in=0.5, right_in=0.5)
Set the figure size.
Parameters
- height_ax_relfloat, optional
Height of the axes relative to the y-axis limits.
- width_ax_relfloat, optional
Width of the axes relative to the x-axis limits.
- width_ax_infloat, defaults to 3
Width of the axes in inches.
- height_ax_infloat, defaults to 0.1
Height of the axes in inches.
- height_gap_infloat, defaults to 0.75
Height of the gap between axes in inches.
- width_gap_infloat, defaults to 0.5
Width of the gap between axes in inches.
- top_infloat, optional
Top margin in inches.
- bottom_infloat, optional
Bottom margin in inches.
- left_infloat, optional
Left margin in inches.
- right_infloat, optional
Right margin in inches.
- class rnavigate.plots.plots.Plot(num_samples, rows=None, cols=None, **kwargs)
Bases:
ABCAbstract base class for plots.
Parameters
- num_samplesint
Number of samples to plot.
- rowsint, optional
Number of rows in the plot.
- colsint, optional
Number of columns in the plot.
- **kwargs
Keyword arguments passed to matplotlib.pyplot.subplots.
Attributes
- figmatplotlib.figure.Figure
Figure object.
- axesnumpy.ndarray of matplotlib.axes.Axes
Array of axes objects.
- iint
Index of the current plot.
- add_colorbar_args(cmap)
Add colorbar arguments to the plot.
Parameters
- cmaprnavigate.data.ScalarMappable
Colormap object.
- get_ax(i=None)
Get the current axes object.
Parameters
- iint, optional
Index of the axes object to return. If None, return the current axes object.
Returns
- matplotlib.axes.Axes
Axes object.
- get_rows_columns(rows=None, cols=None)
Get the number of rows and columns in the plot.
Parameters
- rowsint, optional
Number of rows in the plot. If None, the number of rows is determined automatically.
- colsint, optional
Number of columns in the plot. If None, the number of columns is determined automatically.
Returns
- rowsint
Number of rows in the plot.
- colsint
Number of columns in the plot.
- abstractmethod plot_data()
- save(filename, **kwargs)
Saves the figure to a file
Parameters
- filenamestring
A file path to write to. The file format is provided by this file extension (svg, pdf, or png).
- **kwargs
Additional keyword arguments passed to matplotlib.pyplot.savefig.
- set_figure_size(height_ax_rel=None, width_ax_rel=None, width_ax_in=None, height_ax_in=None, height_gap_in=None, width_gap_in=None, top_in=None, bottom_in=None, left_in=None, right_in=None)
Sets figure size so that axes sizes are always consistent.
Parameters
- height_ax_relfloat, optional
Height of the axes relative to the y-axis limits.
- width_ax_relfloat, optional
Width of the axes relative to the x-axis limits.
- width_ax_infloat, optional
Width of the axes in inches.
- height_ax_infloat, optional
Height of the axes in inches.
- height_gap_infloat, optional
Height of the gap between axes in inches.
- width_gap_infloat, optional
Width of the gap between axes in inches.
- top_infloat, optional
Top margin in inches.
- bottom_infloat, optional
Bottom margin in inches.
- left_infloat, optional
Left margin in inches.
- right_infloat, optional
Right margin in inches.
rnavigate.plots.profile module
- class rnavigate.plots.profile.Profile(num_samples, nt_length, region='all', **kwargs)
Bases:
PlotPlot per-nucleotide measurements as colored bars.
Parameters
- num_samplesint
Number of samples to plot.
- nt_lengthint
Length of the nucleotide sequence.
- regiontuple of int, optional
Region of the nucleotide sequence to plot.
- **kwargs
Keyword arguments passed to the plot function.
Attributes
- figmatplotlib.figure.Figure
Figure object.
- axesnumpy.ndarray of matplotlib.axes.Axes
Array of axes objects.
- iint
Index of the current plot.
- get_rows_columns(rows=None, cols=None)
Get the number of rows and columns in the plot.
Parameters
- rowsint, optional
Number of rows in the plot.
- colsint, optional
Number of columns in the plot. This is ignored and set to 1.
Returns
- rowsint
Number of rows in the plot.
- colsint
Number of columns in the plot.
- plot_data(profile, annotations, domains, label, plot_error=True, column=None, seqbar=True, annotations_mode='track', nt_ticks=(20, 5))
Plot data to the current (or specified) axes.
Parameters
- profilernavigate.profile.Profile
Profile object.
- annotationslist of rnavigate.data.Annotation
List of annotation objects to plot along the sequence.
- domainslist of rnavigate.data.Annotation, optional
List of domains to plot along the sequence.
- labelstr
label for the y-axis.
- plot_errorbool, optional
Whether to plot the error bars.
- columnstr, optional
Column of profile to plot.
- seqbarbool, optional
Whether to plot the sequence track.
- annotations_mode“track” or “bar”, defaults to “track”
Mode of the annotations track.
- nt_tickstuple of int, optional
Major and minor tick interval for the nucleotide axis.
- set_axis(ax, sequence, nt_ticks=(20, 5))
Set up axis properties for aesthetics.
Parameters
- axmatplotlib.axes.Axes
Axes object.
- sequencestr
Nucleotide sequence.
- nt_tickstuple of int, optional
Major and minor tick interval for the nucleotide axis.
- set_figure_size(height_ax_rel=None, width_ax_rel=0.03, width_ax_in=None, height_ax_in=2, height_gap_in=1, width_gap_in=0.5, top_in=1, bottom_in=1, left_in=1, right_in=1)
Set the size of the figure.
Parameters
- height_ax_relfloat, optional
Height of the axes relative to the y-axis limits.
- width_ax_relfloat, defaults to 0.03
Width of the axes relative to the x-axis limits.
- width_ax_infloat, optional
Width of the axes in inches.
- height_ax_infloat, defaults to 2
Height of the axes in inches.
- height_gap_infloat, defaults to 1
Height of the gap between axes in inches.
- width_gap_infloat, defaults to 0.5
Width of the gap between axes in inches.
- top_infloat, defaults to 1
Height of the top margin in inches.
- bottom_infloat, defaults to 1
Height of the bottom margin in inches.
- left_infloat, defaults to 1
Width of the left margin in inches.
- right_infloat, defaults to 1
Width of the right margin in inches.
rnavigate.plots.qc module
- class rnavigate.plots.qc.QC(num_samples)
Bases:
PlotPlot QC data from log files.
Parameters
- num_samplesint
Number of samples to plot.
Attributes
- figmatplotlib.figure.Figure
Figure object.
- ax_muts_untmatplotlib.axes.Axes
Axes object for the mutations per molecule plot of untreated samples.
- ax_muts_modmatplotlib.axes.Axes
Axes object for the mutations per molecule plot of modified samples.
- ax_read_untmatplotlib.axes.Axes
Axes object for the read length plot of untreated samples.
- ax_read_modmatplotlib.axes.Axes
Axes object for the read length plot of modified samples.
- ax_boxplotmatplotlib.axes.Axes
Axes object for the boxplot of mutation rates.
- axesnumpy.ndarray of matplotlib.axes.Axes
Array of axes objects.
- iint
Index of the current plot.
- get_rows_columns(rows=None, cols=None)
Get the number of rows and columns.
Parameters
- rowsint, optional
Number of rows. This is ignored.
- colsint, optional
Number of columns. This is ignored.
Returns
- rowsint
Number of rows. 1 if there is only one sample, 2 otherwise.
- colsint
Number of columns. 3 if there is only one sample, 4 otherwise.
- make_boxplot(labels)
Make the boxplot of mutation rates.
Parameters
- labelslist of str
Labels for the samples.
- plot_data(profile, label)
Plot the data.
Parameters
- profilernavigate.profile.Profile
Profile object.
- labelstr
Label for the sample.
- plot_mutations_per_molecule(profile, label, upper_limit=12)
Plot the mutations per molecule.
Parameters
- profilernavigate.profile.Profile
Profile object.
- labelstr
Label for the sample.
- upper_limitint, optional
Upper limit of the x-axis.
- plot_read_lengths(profile, label, upper_limit=12)
Plot the read lengths.
Parameters
- profilernavigate.profile.Profile
Profile object.
- labelstr
Label for the sample.
- upper_limitint, optional
Upper limit of the x-axis.
- set_figure_size(height_ax_rel=None, width_ax_rel=None, width_ax_in=2, height_ax_in=2, height_gap_in=1, width_gap_in=1, top_in=1, bottom_in=0.5, left_in=1, right_in=0.5)
Set the size of the figure.
Parameters
- height_ax_relfloat, optional
Height of the axes relative to the y-axis limits.
- width_ax_relfloat, optional
Width of the axes relative to the x-axis limits.
- width_ax_infloat, defaults to 2
Width of the axes in inches.
- height_ax_infloat, defaults to 2
Height of the axes in inches.
- height_gap_infloat, defaults to 1
Height of the gap between axes in inches.
- width_gap_infloat, defaults to 1
Width of the gap between axes in inches.
- top_infloat, defaults to 1
Height of the top margin in inches.
- bottom_infloat, defaults to 0.5
Height of the bottom margin in inches.
- left_infloat, defaults to 0.5
Width of the left margin in inches.
- right_infloat, defaults to 0.5
Width of the right margin in inches.
rnavigate.plots.roc module
- class rnavigate.plots.roc.ROC(num_samples, **kwargs)
Bases:
PlotPlot ROC curves.
Parameters
- num_samplesint
Number of samples to plot.
- **kwargs
Keyword arguments passed to rnavigate.plots.Plot.
Attributes
- figmatplotlib.figure.Figure
Figure object.
- a_axmatplotlib.axes.Axes
Axes object for the AUC plot of A nucleotides.
- u_axmatplotlib.axes.Axes
Axes object for the AUC plot of U nucleotides.
- g_axmatplotlib.axes.Axes
Axes object for the AUC plot of G nucleotides.
- c_axmatplotlib.axes.Axes
Axes object for the AUC plot of C nucleotides.
- main_axmatplotlib.axes.Axes
Axes object for the main ROC plot.
- axesnumpy.ndarray of matplotlib.axes.Axes
Array of axes objects.
- iint
Index of the current plot.
- get_rows_columns(rows=None, cols=None)
Get the number of rows and columns.
Parameters
- rowsint
Number of rows. This is ignored.
- colsint
Number of columns. This is ignored.
Returns
- rowsint
Number of rows. This is always 2.
- colsint
Number of columns. This is always 4.
- plot_data(structure, profile, label, nts='AUCG')
Plot the data.
Parameters
- structurernavigate.structure.Structure
Structure object.
- profilernavigate.profile.Profile
Profile object.
- labelstr
Sample name.
- ntsstr, defaults to “AUCG”
Which nucleotides to plot.
- set_figure_size(height_ax_rel=None, width_ax_rel=None, width_ax_in=1.5, height_ax_in=1.5, height_gap_in=0.3, width_gap_in=0.2, top_in=1, bottom_in=0.5, left_in=0.5, right_in=0.5)
Set the figure size.
Parameters
- height_ax_relfloat
Height of the axes relative to the y-axis limits.
- width_ax_relfloat
Width of the axes relative to the x-axis limits.
- width_ax_infloat
Width of the axes in inches.
- height_ax_infloat
Height of the axes in inches.
- height_gap_infloat
Height of the gap between axes in inches.
- width_gap_infloat
Width of the gap between axes in inches.
- top_infloat
Height of the top margin in inches.
- bottom_infloat
Height of the bottom margin in inches.
- left_infloat
Width of the left margin in inches.
- right_infloat
Width of the right margin in inches.
rnavigate.plots.skyline module
- class rnavigate.plots.skyline.Skyline(num_samples, nt_length, region='all', **kwargs)
Bases:
PlotPlot per-nucleotide measurements as stepped line graphs (skyline plots).
Parameters
- num_samplesint
Number of samples to plot.
- nt_lengthint
Length of the nucleotide sequence.
- regiontuple of int, defaults to “all” (entire sequence)
start and end position of the region to plot. If “all”, plot the entire sequence.
- **kwargs
Keyword arguments passed to rnavigate.plots.Plot.
Attributes
- nt_lengthint
Length of the nucleotide sequence.
- regiontuple of int
start and end position of the region to plot.
- track_heightfloat
Height of the tracks in the plot.
- figmatplotlib.figure.Figure
Figure object.
- axmatplotlib.axes.Axes
Axes object.
- axesnumpy.ndarray of matplotlib.axes.Axes
Array of axes objects.
- iint
Index of the current plot.
- get_ax(i=None)
Get the current axes object.
Parameters
- iint, optional
Index of the axes object. This is ignored.
Returns
- axmatplotlib.axes.Axes
Axes object.
- get_rows_columns(rows=None, cols=None)
Get the number of rows and columns.
Parameters
- rowsint
Number of rows. This is ignored.
- colsint
Number of columns. This is ignored.
Returns
- rowsint
Number of rows. This is always 1.
- colsint
Number of columns. This is always 1.
- plot_data(profile, annotations=None, domains=None, label=None, columns=None, seqbar=True, errors=None, annotations_mode='track', nt_ticks=(20, 5))
Add data to the axes.
Parameters
- profilernavigate.profile.Profile
Profile object.
- annotationslist of rnavigate.annotation.Annotation, optional
List of annotation objects.
- domainslist of rnavigate.domain.Domain, optional
List of domain objects.
- labelstr, optional
Sample name.
- columnsstr or list of str, optional
Which columns to plot. If None, plot the metric column.
- seqbarbool, defaults to True
Whether to plot a sequence bar.
- errorsstr, optional
Which error columns to plot. If None, do not plot errors.
- annotations_mode“track” or “bar”, defaults to “track”
Whether to plot annotations as a track or as vertical bars.
- nt_tickstuple of int, defaults to (20, 5)
Major and minor tick frequency for nucleotide positions.
- set_axis(ax, sequence, nt_ticks)
Set the axis limits and ticks.
Parameters
- axmatplotlib.axes.Axes
Axes object.
- sequencernavigate.data.Sequence
The sequence on which position labels are based. Dashes are ignored.
- nt_tickstuple of int
Major and minor tick frequency for nucleotide positions.
- set_figure_size(height_ax_rel=None, width_ax_rel=0.03, width_ax_in=None, height_ax_in=2, height_gap_in=1, width_gap_in=0.5, top_in=1, bottom_in=1, left_in=1, right_in=1)
Set the figure size.
Parameters
- height_ax_relfloat
Height of the axes relative to the y-axis limits.
- width_ax_relfloat
Width of the axes relative to the x-axis limits.
- width_ax_infloat
Width of the axes in inches.
- height_ax_infloat
Height of the axes in inches.
- height_gap_infloat
Height of the gap between axes in inches.
- width_gap_infloat
Width of the gap between axes in inches.
- top_infloat
Height of the top margin in inches.
- bottom_infloat
Height of the bottom margin in inches.
- left_infloat
Width of the left margin in inches.
- right_infloat
Width of the right margin in inches.
- set_labels(ax, axis_title='Raw Reactivity Profile', legend_title='Samples', xlabel='Nucleotide Position', ylabel='Profile')
Set the axis labels and legend.
Parameters
- axmatplotlib.axes.Axes
Axes object.
- axis_titlestr, optional
Title of the axes.
- legend_titlestr, optional
Title of the legend.
- xlabelstr, optional
Label of the x-axis.
- ylabelstr, optional
Label of the y-axis.
rnavigate.plots.sm module
- class rnavigate.plots.sm.SM(nt_length, region=None, panels=['profile', 'rates', 'depth'])
Bases:
PlotPlot classic ShapeMapper plots.
Parameters
- nt_lengthint
Length of the nucleotide sequence.
- regiontuple of int, defaults to “all” (entire sequence)
start and end position of the region to plot. If “all”, plot the entire sequence.
- panelslist of str, defaults to [“profile”, “rates”, “depth”]
Which panels to plot. Options are “profile”, “rates”, and “depth”.
Attributes
- nt_lengthint
Length of the nucleotide sequence.
- regiontuple of int
start and end position of the region to plot.
- figmatplotlib.figure.Figure
Figure object.
- axesnumpy.ndarray of matplotlib.axes.Axes
Array of axes objects.
- iint
Index of the current plot.
- metric_abbreviate(num)
takes a large number and applies an appropriate abbreviation
Parameters
- numint
number to be abbreviated
Returns
- str
abbreviated number
- plot_data(profile, label)
Plot the data.
Parameters
- profilernavigate.profile.Profile
Profile object.
- labelstr
Label for the plot.
- plot_sm_depth(ax, profile)
Plots classic ShapeMapper read depth on the given axis.
Parameters
- axmatplotlib.axes.Axes
Axes object.
- profilernavigate.profile.Profile
Profile object.
- plot_sm_profile(ax, profile)
Plots classic ShapeMapper profile on the given axis.
Parameters
- axmatplotlib.axes.Axes
Axes object.
- profilernavigate.profile.Profile
Profile object.
- plot_sm_rates(ax, profile)
Plots classic ShapeMapper mutation rates on the given axis.
Parameters
- axmatplotlib.axes.Axes
Axes object.
- profilernavigate.profile.Profile
Profile object.
- set_figure_size(height_ax_rel=None, width_ax_rel=0.03, width_ax_in=None, height_ax_in=2, height_gap_in=0.5, width_gap_in=0.5, top_in=1, bottom_in=0.5, left_in=0.5, right_in=0.5)
Set the figure size.
Parameters
- height_ax_relfloat, defaults to None
Height of the axes relative to the y-axis limits.
- width_ax_relfloat, defaults to 0.03
Width of the axes relative to the x-axis limits.
- width_ax_infloat, defaults to None
Width of the axes in inches.
- height_ax_infloat, defaults to 2
Height of the axes in inches.
- height_gap_infloat, defaults to 0.5
Height of the gap between axes in inches.
- width_gap_infloat, defaults to 0.5
Width of the gap between axes in inches.
- top_infloat, defaults to 1
Height of the top margin in inches.
- bottom_infloat, defaults to 0.5
Height of the bottom margin in inches.
- left_infloat, defaults to 0.5
Width of the left margin in inches.
- right_infloat, defaults to 0.5
Width of the right margin in inches.
rnavigate.plots.ss module
- class rnavigate.plots.ss.SS(num_samples, **kwargs)
Bases:
PlotPlot secondary structure diagrams.
Parameters
- num_samplesint
Number of samples to plot.
- **kwargs
Keyword arguments passed to rnavigate.plots.Plot.
Attributes
- figmatplotlib.figure.Figure
Figure object.
- axesnumpy.ndarray of matplotlib.axes.Axes
Array of axes objects.
- xlimslist of float
x limits of the plot.
- ylimslist of float
y limits of the plot.
- iint
Index of the current plot.
- plot_data(structure, interactions=None, interactions2=None, profile=None, annotations=None, label='', colors=None, nt_ticks=None, bp_style='dotted')
Plot the data on the current axes.
Parameters
- structurernavigate.data.SecondaryStructure
Structure object with diagram drawing coordinates.
- interactionsrnavigate.data.Interactions, optional
Interactions object to plot as lines between nucleotides.
- interactions2rnavigate.data.Interactions, optional
Interactions object to plot as lines between nucleotides.
- profilernavigate.data.Profile, optional
Profile object used to color nucleotides.
- annotationslist of rnavigate.data.Annotation, optional
Annotation objects to highlight regions or nucleotides of interest.
- labelstr, optional
Label for the plot title.
- colorsdict, optional
Dictionary of colors for each plot element. Keys are “sequence”, “nucleotides”, “structure”, and “basepairs”. Values are either matplotlib colors or strings specifying the color scheme.
- nt_ticksint, optional
Number of nucleotides between tick marks.
- bp_style“dotted”, “solid”, or “conventional”, defaults to “dotted”
Style of base pair lines.
- set_figure_size(height_ax_rel=0.2, width_ax_rel=0.2, width_ax_in=None, height_ax_in=None, height_gap_in=0.5, width_gap_in=0.2, top_in=1, bottom_in=0.5, left_in=0.5, right_in=0.5)
Set the figure size.
Parameters
- height_ax_relfloat, defaults to 0.2
Height of the axes relative to the y-axis limits.
- width_ax_relfloat, defaults to 0.2
Width of the axes relative to the x-axis limits.
- width_ax_infloat
Width of the axes in inches.
- height_ax_infloat
Height of the axes in inches.
- height_gap_infloat, defaults to 0.5
Height of the gap between axes in inches.
- width_gap_infloat, defaults to 0.2
Width of the gap between axes in inches.
- top_infloat, defaults to 1
Height of the top margin in inches.
- bottom_infloat, defaults to 0.5
Height of the bottom margin in inches.
- left_infloat, defaults to 0.5
Width of the left margin in inches.
- right_infloat, defaults to 0.5
Width of the right margin in inches.
Module contents
- class rnavigate.plots.AP(num_samples, nt_length, region='all', track_labels=True, **kwargs)
Bases:
PlotClass for plotting arc plots
Parameters
- num_samplesint
Number of samples to plot
- nt_lengthint
Length of the sequence
- regiontuple of 2 integers, optional
starting and ending positions of the region to plot. Default is “all”, which plots the entire sequence.
- track_labelsbool, optional
Whether to plot track labels. Default is True.
- **kwargs
Additional keyword arguments are passed to plots.Plot
Attributes
- nt_lengthint
Length of the sequence
- regiontuple of 2 integers
starting and ending positions of the region to plot.
- track_labelsbool
Whether to plot track labels.
- figmatplotlib.figure.Figure
Figure object containing the plot
- axesnumpy.ndarray of matplotlib.axes.Axes
Array of axes objects containing the plots
- iint
Index of the current plot
- plot_data(sequence, structure=None, structure2=None, interactions=None, interactions2=None, profile=None, annotations=None, domains=None, label='', ax=None, seqbar=True, title=True, panels=None, annotation_mode='track', track_height=None, profile_scale_factor=1, plot_error=False, nt_ticks=(20, 5))
Add data to the next (or specified) plot axes.
This function assumes data has already been aligned to a common sequence. rnavigate.plot_ functions can be used to automatically align data.
Parameters
- sequencernavigate.data.Sequence
Sequence object containing the sequence to plot
- structurernavigate.data.Structure, optional
Structure object containing a structure to plot
- structure2rnavigate.data.Structure, optional
Structure object containing a structure to compare to the first
- interactionsrnavigate.data.Interactions, optional
Interactions object containing inter-nucleotide data to plot
- interactions2rnavigate.data.Interactions, optional
Interactions object containing other inter-nucleotide data to plot
- profilernavigate.data.Profile, optional
Profile object containing per-nucleotide data to plot
- annotationslist of rnavigate.data.Annotation, optional
List of Annotation objects containing annotations to plot
- domainslist of rnavigate.data.Spans, optional
List of Spans objects containing domains to plot
- labelstr, defaults to “”
Label for the title of the plot.
- axmatplotlib.axes.Axes, optional
Axes object to plot on. If None, the next axes in the figure will be used.
- seqbarbool, Defaults to True
Whether to plot the sequence track.
- titlebool, defaults to True
Whether to show the title.
- panelsdict, optional
Dictionary of panels to plot, with keys being the panel name and values being the panel location. Default is {“interactions”: “bottom”, “interactions2”: “bottom”, “structure”: “top”, “profile”: “top”}
- annotation_mode“track” or “bar”, defaults to “track”
Mode for plotting annotations.
- track_heightint, optional
Height of the track. If None, the height is automatically determined.
- profile_scale_factorfloat, defaults to 1
Scale factor for the profile track.
- plot_errorbool, defaults to False
Whether to plot the error bars for the profile track.
- nt_tickstuple of 2 ints, optional
Major and minor tick spacing for the nucleotide axis. Default is (20, 5).
- set_axis(ax, sequence, track_height=0, nt_ticks=(20, 5), max_height=300, yticks=None, ylabels=None)
Set up the plotting axis settings for an aesthetic arc plot.
Sets the following properties of the given axis: 1. spine positions 2. x-axis and y-axis limits 3. x-axis tick labels and positions according to sequence 4. background boxes for x-axis tick labels 5. y-axis tick labels and positions according to track_height and ylabels
Parameters
- axmatplotlib.axes.Axes
Axes object to set up.
- sequencestr
Sequence to plot.
- track_heightint, optional
Height of the track. If None, the height is automatically determined.
- nt_tickstuple of 2 ints, optional
Major and minor tick spacing for the nucleotide axis. Default is (20, 5).
- max_heightint, optional
Maximum height of the plot. Default is 300.
- ytickslist of ints, optional
List of ytick positions. If None, the yticks are automatically determined.
- ylabelslist of str, optional
List of ytick labels. If None, the ylabels are automatically determined.
- set_figure_size(height_ax_rel=0.03, width_ax_rel=0.03, width_ax_in=None, height_ax_in=None, height_gap_in=0.5, width_gap_in=0.5, top_in=1, bottom_in=1, left_in=1, right_in=1)
Set the figure size for an arc plot.
Parameters
- height_ax_relfloat, Default is 0.03.
Relative height of each axes.
- width_ax_relfloat, Default is 0.03.
Relative width of each axes.
- width_ax_infloat, optional
Absolute width of each axes in inches. If None, the width is automatically determined.
- height_ax_infloat, optional
Absolute height of each axes in inches. If None, the height is automatically determined.
- height_gap_infloat, Default is 0.5.
Absolute height of the gap between axes in inches.
- width_gap_infloat, Default is 0.5.
Absolute width of the gap between axes in inches.
- top_infloat, Default is 1.
Absolute top margin in inches.
- bottom_infloat, Default is 1.
Absolute bottom margin in inches.
- left_infloat, Default is 1.
Absolute left margin in inches.
- right_infloat, Default is 1.
Absolute right margin in inches.
- class rnavigate.plots.Alignment(num_samples, rows=None, cols=1, **kwargs)
Bases:
PlotClass for plotting sequence alignments.
Parameters
- num_samplesint
The number of samples to plot. Always 2.
- rowsint, optional
The number of rows of plots. Always 1.
- colsint, optional
The number of columns of plots. Always 1.
- **kwargsdict
Additional keyword arguments to pass to plots.Plot.
Attributes
- regiontuple
The region of the alignment to plot. Defaults to (1, len(alignment1))
- figmatplotlib.figure.Figure
The figure containing the plot.
- axesnumpy.array
A 1x1 array of the axes containing the plot.
- plot_data(alignment, label, ax=None)
Add the alignment to the next (or given) axes.
Parameters
- alignmentrnavigate.Alignment
The alignment to plot.
- labelstr
The label for the alignment.
- axmatplotlib.axes.Axes, optional
The axes containing the plot. Defaults to None.
- set_figure_size(height_ax_rel=0.03, width_ax_rel=0.03, width_ax_in=None, height_ax_in=None, height_gap_in=1, width_gap_in=0.5, top_in=1, bottom_in=0.5, left_in=0.5, right_in=0.5)
Set the figure size for the plot.
Parameters
- height_ax_relfloat, optional
The relative height of each axes. Defaults to 0.03.
- width_ax_relfloat, optional
The relative width of each axes. Defaults to 0.03.
- width_ax_infloat, optional
The width of each axes in inches. Defaults to None.
- height_ax_infloat, optional
The height of each axes in inches. Defaults to None.
- height_gap_infloat, optional
The height of the gap between axes in inches. Defaults to 1.
- width_gap_infloat, optional
The width of the gap between axes in inches. Defaults to 0.5.
- top_infloat, optional
The top margin in inches. Defaults to 1.
- bottom_infloat, optional
The bottom margin in inches. Defaults to 0.5.
- left_infloat, optional
The left margin in inches. Defaults to 0.5.
- right_infloat, optional
The right margin in inches. Defaults to 0.5.
- class rnavigate.plots.Circle(num_samples, **kwargs)
Bases:
PlotCreate a circle plot.
Parameters
- num_samplesint
Number of samples to plot.
- **kwargs
Keyword arguments passed to
rnavigate.plots.Plot.
Attributes
- zorderdict
Dictionary of zorder values for each plot element.
- figmatplotlib.figure.Figure
Figure object.
- axnumpy.ndarray of matplotlib.axes.Axes
Array of axes objects.
- iint
Index of current axes object. Increments with each call to
rnavigate.plots.Circle.plot_data().
- plot_data(sequence, structure=None, structure2=None, interactions=None, interactions2=None, profile=None, annotations=None, label=None, colors=None, gap=30, nt_ticks=(20, 5))
Plot data on the current (or specified) axes.
Parameters
- sequencernavigate.data.Sequence
Sequence object to plot around the circle.
- structurernavigate.data.Structure, defaults to None
Structure object to plot as lines within the circle.
- structure2rnavigate.data.Structure, defaults to None
Structure object to compare to structure.
- interactionsrnavigate.data.Interactions, defaults to None
Interactions object to plot as lines within the circle.
- interactions2rnavigate.data.Interactions, defaults to None
Interactions object to plot as lines within the circle.
- profilernavigate.data.Profile, defaults to None
Profile object used to color the sequence.
- annotationslist of rnavigate.data.Annotation, defaults to None
List of Annotation objects to highlight regions around the circle.
- labelstr, defaults to None
Label for the plot title.
- colorsdict, defaults to None
Dictionary of colors for each plot element.
- gapfloat, defaults to 30
Gap between the start and end of the sequence in degrees.
- nt_tickstuple of int, defaults to (20, 5)
Gap between major and minor nucleotide ticks in degrees.
- set_axis(ax, label, seq_circle, gap, nt_ticks)
Set axis limits and ticks.
Parameters
- axmatplotlib.axes.Axes
Axes object to modify.
- labelstr
Label for the plot title.
- seq_circlernavigate.data.SequenceCircle
SequenceCircle object.
- gapfloat
Gap between the start and end of the sequence in degrees.
- nt_tickstuple of 2 integers
Gap between major and minor nucleotide ticks in degrees.
- set_figure_size(height_ax_rel=0.035, width_ax_rel=0.035, width_ax_in=None, height_ax_in=None, height_gap_in=1, width_gap_in=1, top_in=1, bottom_in=0.5, left_in=0.5, right_in=0.5)
Set figure size.
Parameters
- height_ax_relfloat, defaults to 0.035
Height of axes relative to the y-axis limits.
- width_ax_relfloat, defaults to 0.035
Width of axes relative to the x-axis limits.
- width_ax_infloat, defaults to None (overridden by width_ax_rel)
Width of axes in inches.
- height_ax_infloat, defaults to None (overridden by height_ax_rel)
Height of axes in inches.
- height_gap_infloat, defaults to 1
Height of gap between axes in inches.
- width_gap_infloat, defaults to 1
Width of gap between axes in inches.
- top_infloat, defaults to 1
Height of top margin in inches.
- bottom_infloat, defaults to 0.5
Height of bottom margin in inches.
- left_infloat, defaults to 0.5
Width of left margin in inches.
- right_infloat, defaults to 0.5
Width of right margin in inches.
- class rnavigate.plots.ColorBar(num_samples, rows=None, cols=None, **kwargs)
Bases:
PlotPlot a colorbar.
Parameters
- rowsint, optional
Number of rows in the plot.
- **kwargs
Keyword arguments passed to matplotlib.pyplot.subplots.
Attributes
- figmatplotlib.figure.Figure
Figure object.
- axesnumpy.ndarray of matplotlib.axes.Axes
Array of axes objects.
- iint
Index of the current plot.
- plot_data(colorbar)
Add a colorbar to the current axes.
Parameters
- colorbarrnavigate.data.ScalarMappable
Colormap object.
- set_figure_size(height_ax_rel=None, width_ax_rel=None, width_ax_in=3, height_ax_in=0.1, height_gap_in=0.75, width_gap_in=0.5, top_in=0.5, bottom_in=0.5, left_in=0.5, right_in=0.5)
Set the figure size.
Parameters
- height_ax_relfloat, optional
Height of the axes relative to the y-axis limits.
- width_ax_relfloat, optional
Width of the axes relative to the x-axis limits.
- width_ax_infloat, defaults to 3
Width of the axes in inches.
- height_ax_infloat, defaults to 0.1
Height of the axes in inches.
- height_gap_infloat, defaults to 0.75
Height of the gap between axes in inches.
- width_gap_infloat, defaults to 0.5
Width of the gap between axes in inches.
- top_infloat, optional
Top margin in inches.
- bottom_infloat, optional
Bottom margin in inches.
- left_infloat, optional
Left margin in inches.
- right_infloat, optional
Right margin in inches.
- class rnavigate.plots.DistHist(num_samples, **plot_kwargs)
Bases:
PlotCreate a distance histogram plot.
Parameters
- num_samplesint
Number of samples to plot.
- **kwargs
Keyword arguments passed to
rnavigate.plots.Plot.
Attributes
- figmatplotlib.figure.Figure
Figure object.
- axesnumpy.ndarray of matplotlib.axes.Axes
Array of axes objects.
- axes2dict
Dictionary of twin axes objects. Keys are axes objects from
rnavigate.plots.DistHist.axes.- iint
Index of current axes object. Increments with each call to
rnavigate.plots.DistHist.plot_data().
- plot_data(structure, interactions, bg_interactions, label, atom="O2'", ax=None)
Plot data on the current (or specified) axes object.
Parameters
- structurernavigate.data.SecondaryStructure or rnavigate.data.PDB
Structure object to compute contact distances or 3D distances.
- interactionsrnavigate.data.Interactions
Filtered Interactions object to to visualize pairwise distances.
- bg_interactionsrnavigate.data.Interactions
Filtered Interactions object to to visualize pairwise background distances.
- labelstr
Label for the current axes object.
- atomstr, defaults to “O2’”
Atom to compute distances from.
- axmatplotlib.axes.Axes, defaults to None
Axes object to plot on. If None, use the current axes object.
- plot_experimental_distances(ax, structure, interactions, atom, histtype='bar')
Plot pairwise distances from the interactions object.
Parameters
- axmatplotlib.axes.Axes
Axes object to plot on.
- structurernavigate.data.SecondaryStructure or rnavigate.data.PDB
Structure object to compute contact distances or 3D distances.
- interactionsrnavigate.data.Interactions
Filtered Interactions object to to visualize pairwise distances.
- atomstr
Atom to compute distances from.
- histtype“bar” or “step”, defaults to “bar”
Type of histogram to plot.
- plot_structure_distances(ax, structure, atom)
Plot all distances in the structure.
Parameters
- axmatplotlib.axes.Axes
Axes object to plot on.
- structurernavigate.data.SecondaryStructure or rnavigate.data.PDB
Structure object to compute contact distances or 3D distances.
- atomstr
Atom to compute distances from.
- set_figure_size(height_ax_rel=None, width_ax_rel=None, width_ax_in=2, height_ax_in=2, height_gap_in=1, width_gap_in=0.4, top_in=1, bottom_in=1, left_in=1, right_in=1)
Set figure size.
Parameters
- height_ax_relfloat, defaults to None
Height of axes objects relative to y-axis limits.
- width_ax_relfloat, defaults to None
Width of axes objects relative to x-axis limits.
- width_ax_infloat, defaults to 2
Width of axes objects in inches.
- height_ax_infloat, defaults to 2
Height of axes objects in inches.
- height_gap_infloat, defaults to 1
Height of gap between axes objects in inches.
- width_gap_infloat, defaults to 0.4
Width of gap between axes objects in inches.
- top_infloat, defaults to 1
Height of top margin in inches.
- bottom_infloat, defaults to 1
Height of bottom margin in inches.
- left_infloat, defaults to 1
Width of left margin in inches.
- right_infloat, defaults to 1
Width of right margin in inches.
- class rnavigate.plots.Heatmap(num_samples, structure, **plot_kwargs)
Bases:
PlotCreate a heatmap plot.
Parameters
- num_samplesint
Number of samples to plot.
- structurernavigate.data.SecondaryStructure or rnavigate.data.PDB
Structure object.
- **kwargs
Keyword arguments passed to
rnavigate.plots.Plot.
Attributes
- structurernavigate.data.SecondaryStructure or rnavigate.data.PDB
Structure object.
- figmatplotlib.figure.Figure
Figure object.
- axesnumpy.ndarray of matplotlib.axes.Axes
Array of axes objects.
- iint
Index of current axes object. Increments with each call to
rnavigate.plots.Heatmap.plot_data().
- plot_contour_distances(ax, levels, atom)
Plot contour distances on the current (or specified) axes.
Parameters
- axmatplotlib.axes.Axes
Axes object to plot on.
- levelslist of float, defaults to None
Levels for contour lines. If None, levels are set automatically. [5] for SecondaryStructure, [20] for PDB.
- atomstr, defaults to “O2’”
Atom to use for calculating distances.
- plot_contour_regions(ax, interactions, regions)
Plot contour regions on the current (or specified) axes.
Parameters
- axmatplotlib.axes.Axes
Axes object to plot on.
- interactionsrnavigate.data.Interactions
Interactions object containing inter-nucleotide data to plot as heatmap.
- regionslist of tuple of int
Regions to plot as contour lines.
- plot_data(interactions, label, levels=None, regions=None, interpolation=None, atom="O2'", plot_type='heatmap', weights=None)
Plot heatmap and contour data on the current (or specified) axes.
Parameters
- interactionsrnavigate.data.Interactions
Interactions object containing inter-nucleotide data to plot as heatmap.
- labelstr
Label for plot title.
- levelslist of float, defaults to None
Levels for contour lines. If None, levels are set automatically. [5] for SecondaryStructure, [20] for PDB.
- regionslist of tuple of int, defaults to None
Regions to plot as contour lines. If None, distances are plotted.
- interpolationstr, defaults to None
Interpolation method for heatmap. If None, no interpolation is used.
- atomstr, defaults to “O2’”
Atom to use for calculating distances.
- plot_type“heatmap” or “kde”, defaults to “heatmap”
Type of plot to create.
- weightsarray-like, defaults to None
A column name of interactions to use as weights for KDE plot.
- plot_heatmap_data(ax, interactions, interpolation)
Plot heatmap data on the specified axes.
Parameters
- axmatplotlib.axes.Axes
Axes object to plot on.
- interactionsrnavigate.data.Interactions
Interactions object containing inter-nucleotide data to plot as heatmap.
- interpolationstr, defaults to None
Interpolation method for heatmap. If None, no interpolation is used.
- plot_kde_data(ax, interactions, weights=None, **kwargs)
Plot KDE data on the specified axes.
Parameters
- axmatplotlib.axes.Axes
Axes object to plot on.
- interactionsrnavigate.data.Interactions
Interactions object containing inter-nucleotide data to plot as KDE.
- weightsarray-like, defaults to None
A column name of interactions to use as weights for KDE plot.
- **kwargs
Keyword arguments passed to
seaborn.kdeplot().
- set_figure_size(height_ax_rel=None, width_ax_rel=None, width_ax_in=2, height_ax_in=2, height_gap_in=1, width_gap_in=0.5, top_in=1, bottom_in=0.5, left_in=0.5, right_in=0.5)
Set figure size.
Parameters
- height_ax_relfloat, defaults to None
Height of each axes object relative to y-axis limits.
- width_ax_relfloat, defaults to None
Width of each axes object relative to x-axis limits.
- width_ax_infloat, defaults to 2
Width of each axes object in inches.
- height_ax_infloat, defaults to 2
Height of each axes object in inches.
- height_gap_infloat, defaults to 1
Height of gap between axes objects in inches.
- width_gap_infloat, defaults to 0.5
Width of gap between axes objects in inches.
- top_infloat, defaults to 1
Top margin in inches.
- bottom_infloat, defaults to 0.5
Bottom margin in inches.
- left_infloat, defaults to 0.5
Left margin in inches.
- right_infloat, defaults to 0.5
Right margin in inches.
- class rnavigate.plots.LinReg(num_samples, scale='linear', regression='pearson', kde=False, region='all')
Bases:
PlotPlot a linear regression scatter plot, pairwise, between profiles.
Parameters
- num_samplesint
Number of samples to plot.
- scalestr, optional
Scale of the plot, either ‘linear’ or ‘log’. The default is ‘linear’.
- regression‘pearson’ or ‘spearman’, Defaults to ‘pearson’
Type of regression to perform.
- kdebool, optional
Whether to plot a kernel density estimate instead of a scatter plot. The default is False.
- region‘all’ or tuple of 2 integers, defaults to ‘all’
Start and end positions of the region to plot. If ‘all’, plot the entire profile.
Attributes
- figmatplotlib.figure.Figure
Figure of the plot.
- axesnumpy.ndarray of matplotlib.axes.Axes
Axes of the plot.
- lengthint
Number of samples to plot.
- limslist of 2 floats
Limits of the plot applied to all x and y axes.
- profileslist of numpy.ndarray
Each sample’s per-nucleotide values over the region and column of interest.
- colorslist of numpy.ndarray
A color for each nucleotide in the region applied to the scatter plot.
- labelslist of str
A label for each sample.
- scale‘linear’ or ‘log’
Scale of the plot axes.
- kdebool
Whether to plot a kernel density estimate instead of a scatter plot.
- regressionfunction
Regression function to use.
- regiontuple of 2 integers
Start and end positions of the region to plot.
- finalize()
Finalize the plot by formatting the axes and adding labels.
- plot_data(structure, profile, annotations, label, column=None, colors='sequence')
Add profile data. If all samples have been added, plot the regression.
Parameters
- structureStructure
Structure object.
- profileProfile
Profile object.
- annotationsAnnotations
Annotations object.
- labelstr
Label for the sample.
- columnstr, optional
Column of the profile to plot. The default is None.
- colorsstr, optional
Color scheme to use. The default is ‘sequence’.
- plot_regression(i, j)
Plot a linear regression between two profiles.
Profiles must already have been added using plot_data.
Parameters
- iint
Index of the first profile.
- jint
Index of the second profile.
- set_figure_size(height_ax_rel=None, width_ax_rel=None, width_ax_in=2, height_ax_in=2, height_gap_in=0.3, width_gap_in=0.3, top_in=1, bottom_in=0.5, left_in=0.5, right_in=0.5)
Set the figure size.
Parameters
- height_ax_relfloat, defaults to None
Height of the axes relative to the y-axis limits.
- width_ax_relfloat, defaults to None
Width of the axes relative to the x-axis limits.
- width_ax_infloat, defaults to 2
Width of the axes in inches.
- height_ax_infloat, defaults to 2
Height of the axes in inches.
- height_gap_infloat, defaults to 0.3
Height of the gap between axes in inches.
- width_gap_infloat, defaults to 0.3
Width of the gap between axes in inches.
- top_infloat, defaults to 1
Top margin of the figure in inches.
- bottom_infloat, defaults to 0.5
Bottom margin of the figure in inches.
- left_infloat, defaults to 0.5
Left margin of the figure in inches.
- right_infloat, defaults to 0.5
Right margin of the figure in inches.
- class rnavigate.plots.Mol(num_samples, pdb, width=400, height=400, background_alpha=1, rotation=None, orientation=None, style='cartoon', rows=None, cols=None)
Bases:
Plot- add_lines(i, j, color, viewer, atom)
Add lines between nucleotides i and j
Parameters
- iint
Index of the first nucleotide
- jint
Index of the second nucleotide
- colorstr
Color to use for the line
- viewertuple of ints
Tuple of ints defining the subviewer to plot on
- atomstr
Atom to use for plotting interactions
- get_orientation()
Adds a clickable event to the viewer to display the orientation vector.
- get_viewer(i=None)
Get the subviewer at index i
- hide_cylinders()
Hide the cylinders that represent nucleotides.
- plot_data(interactions=None, profile=None, label=None, colors='grey', atom="O2'", title=True, get_orientation=False, viewer=None)
Plot data on the current subviewer.
Parameters
- interactionsrnavigate.interactions.Interactions
Interactions object to plot as lines on the 3d structure
- profilernavigate.profile.Profile
Profile object to use as nucleotide colors
- labelstr, defaults to None
Label to use as a title on the subviewer
- colorsstr, defaults to “grey”
Color scheme to use for nucleotides
- atomstr, defaults to “O2’”
Atom to use for plotting interactions
- titlebool, defaults to True
Whether or not to add a title to the subviewer
- get_orientationbool, defaults to False
Whether or not to get the orientation of the subviewer This will display the orientation as a label on the subviewer when the structure is clicked.
- viewertuple of ints, defaults to None
Tuple of ints defining the subviewer to plot on
- plot_interactions(viewer, interactions, atom)
Plot interactions on the current subviewer
Parameters
- viewertuple of ints
Tuple of ints defining the subviewer to plot on
- interactionsrnavigate.interactions.Interactions
Interactions object to plot as lines on the 3d structure
- atomstr
Atom to use for plotting interactions
- class rnavigate.plots.NucleotideDistribution(num_samples, **plot_kwargs)
Bases:
PlotPlot nucleotide distribution of a profile.
Parameters
- num_samplesint
Number of samples to plot.
- sharexbool, optional
Whether to share the x-axis between plots.
- colsint, optional
Number of columns in the plot.
- **plot_kwargs
Keyword arguments passed to the plot function.
Attributes
- figmatplotlib.figure.Figure
Figure object.
- axesnumpy.ndarray of matplotlib.axes.Axes
Array of axes objects.
- iint
Index of the current plot.
- plot_data(profile, label, column=None, normalize=None, ax=None)
Plot data to the current (or specified) axes.
Parameters
- profilernavigate.profile.Profile
Profile object.
- labelstr
label for the y-axis.
- columnstr, optional
Column of profile.data to plot.
- normalizedict, optional
Keyword arguments passed to profile.normalize.
- axmatplotlib.axes.Axes, optional
Axes object to plot to. If not specified, the current axes is used.
- set_figure_size(height_ax_rel=None, width_ax_rel=None, width_ax_in=2, height_ax_in=2, height_gap_in=0.2, width_gap_in=0.4, top_in=1, bottom_in=1, left_in=1, right_in=1)
Set the figure size.
Parameters
- height_ax_relfloat, optional
Height of the axes relative to the y-axis limits.
- width_ax_relfloat, optional
Width of the axes relative to the x-axis limits.
- width_ax_infloat, defaults to 2
Width of the axes in inches.
- height_ax_infloat, defaults to 2
Height of the axes in inches.
- height_gap_infloat, defaults to 0.2
Height of the gap between axes in inches.
- width_gap_infloat, defaults to 0.4
Width of the gap between axes in inches.
- top_infloat, defaults to 1
Top margin in inches.
- bottom_infloat, defaults to 1
Bottom margin in inches.
- left_infloat, defaults to 1
Left margin in inches.
- right_infloat, defaults to 1
Right margin in inches.
- class rnavigate.plots.Plot(num_samples, rows=None, cols=None, **kwargs)
Bases:
ABCAbstract base class for plots.
Parameters
- num_samplesint
Number of samples to plot.
- rowsint, optional
Number of rows in the plot.
- colsint, optional
Number of columns in the plot.
- **kwargs
Keyword arguments passed to matplotlib.pyplot.subplots.
Attributes
- figmatplotlib.figure.Figure
Figure object.
- axesnumpy.ndarray of matplotlib.axes.Axes
Array of axes objects.
- iint
Index of the current plot.
- add_colorbar_args(cmap)
Add colorbar arguments to the plot.
Parameters
- cmaprnavigate.data.ScalarMappable
Colormap object.
- get_ax(i=None)
Get the current axes object.
Parameters
- iint, optional
Index of the axes object to return. If None, return the current axes object.
Returns
- matplotlib.axes.Axes
Axes object.
- get_rows_columns(rows=None, cols=None)
Get the number of rows and columns in the plot.
Parameters
- rowsint, optional
Number of rows in the plot. If None, the number of rows is determined automatically.
- colsint, optional
Number of columns in the plot. If None, the number of columns is determined automatically.
Returns
- rowsint
Number of rows in the plot.
- colsint
Number of columns in the plot.
- abstractmethod plot_data()
- save(filename, **kwargs)
Saves the figure to a file
Parameters
- filenamestring
A file path to write to. The file format is provided by this file extension (svg, pdf, or png).
- **kwargs
Additional keyword arguments passed to matplotlib.pyplot.savefig.
- set_figure_size(height_ax_rel=None, width_ax_rel=None, width_ax_in=None, height_ax_in=None, height_gap_in=None, width_gap_in=None, top_in=None, bottom_in=None, left_in=None, right_in=None)
Sets figure size so that axes sizes are always consistent.
Parameters
- height_ax_relfloat, optional
Height of the axes relative to the y-axis limits.
- width_ax_relfloat, optional
Width of the axes relative to the x-axis limits.
- width_ax_infloat, optional
Width of the axes in inches.
- height_ax_infloat, optional
Height of the axes in inches.
- height_gap_infloat, optional
Height of the gap between axes in inches.
- width_gap_infloat, optional
Width of the gap between axes in inches.
- top_infloat, optional
Top margin in inches.
- bottom_infloat, optional
Bottom margin in inches.
- left_infloat, optional
Left margin in inches.
- right_infloat, optional
Right margin in inches.
- class rnavigate.plots.Profile(num_samples, nt_length, region='all', **kwargs)
Bases:
PlotPlot per-nucleotide measurements as colored bars.
Parameters
- num_samplesint
Number of samples to plot.
- nt_lengthint
Length of the nucleotide sequence.
- regiontuple of int, optional
Region of the nucleotide sequence to plot.
- **kwargs
Keyword arguments passed to the plot function.
Attributes
- figmatplotlib.figure.Figure
Figure object.
- axesnumpy.ndarray of matplotlib.axes.Axes
Array of axes objects.
- iint
Index of the current plot.
- get_rows_columns(rows=None, cols=None)
Get the number of rows and columns in the plot.
Parameters
- rowsint, optional
Number of rows in the plot.
- colsint, optional
Number of columns in the plot. This is ignored and set to 1.
Returns
- rowsint
Number of rows in the plot.
- colsint
Number of columns in the plot.
- plot_data(profile, annotations, domains, label, plot_error=True, column=None, seqbar=True, annotations_mode='track', nt_ticks=(20, 5))
Plot data to the current (or specified) axes.
Parameters
- profilernavigate.profile.Profile
Profile object.
- annotationslist of rnavigate.data.Annotation
List of annotation objects to plot along the sequence.
- domainslist of rnavigate.data.Annotation, optional
List of domains to plot along the sequence.
- labelstr
label for the y-axis.
- plot_errorbool, optional
Whether to plot the error bars.
- columnstr, optional
Column of profile to plot.
- seqbarbool, optional
Whether to plot the sequence track.
- annotations_mode“track” or “bar”, defaults to “track”
Mode of the annotations track.
- nt_tickstuple of int, optional
Major and minor tick interval for the nucleotide axis.
- set_axis(ax, sequence, nt_ticks=(20, 5))
Set up axis properties for aesthetics.
Parameters
- axmatplotlib.axes.Axes
Axes object.
- sequencestr
Nucleotide sequence.
- nt_tickstuple of int, optional
Major and minor tick interval for the nucleotide axis.
- set_figure_size(height_ax_rel=None, width_ax_rel=0.03, width_ax_in=None, height_ax_in=2, height_gap_in=1, width_gap_in=0.5, top_in=1, bottom_in=1, left_in=1, right_in=1)
Set the size of the figure.
Parameters
- height_ax_relfloat, optional
Height of the axes relative to the y-axis limits.
- width_ax_relfloat, defaults to 0.03
Width of the axes relative to the x-axis limits.
- width_ax_infloat, optional
Width of the axes in inches.
- height_ax_infloat, defaults to 2
Height of the axes in inches.
- height_gap_infloat, defaults to 1
Height of the gap between axes in inches.
- width_gap_infloat, defaults to 0.5
Width of the gap between axes in inches.
- top_infloat, defaults to 1
Height of the top margin in inches.
- bottom_infloat, defaults to 1
Height of the bottom margin in inches.
- left_infloat, defaults to 1
Width of the left margin in inches.
- right_infloat, defaults to 1
Width of the right margin in inches.
- class rnavigate.plots.QC(num_samples)
Bases:
PlotPlot QC data from log files.
Parameters
- num_samplesint
Number of samples to plot.
Attributes
- figmatplotlib.figure.Figure
Figure object.
- ax_muts_untmatplotlib.axes.Axes
Axes object for the mutations per molecule plot of untreated samples.
- ax_muts_modmatplotlib.axes.Axes
Axes object for the mutations per molecule plot of modified samples.
- ax_read_untmatplotlib.axes.Axes
Axes object for the read length plot of untreated samples.
- ax_read_modmatplotlib.axes.Axes
Axes object for the read length plot of modified samples.
- ax_boxplotmatplotlib.axes.Axes
Axes object for the boxplot of mutation rates.
- axesnumpy.ndarray of matplotlib.axes.Axes
Array of axes objects.
- iint
Index of the current plot.
- get_rows_columns(rows=None, cols=None)
Get the number of rows and columns.
Parameters
- rowsint, optional
Number of rows. This is ignored.
- colsint, optional
Number of columns. This is ignored.
Returns
- rowsint
Number of rows. 1 if there is only one sample, 2 otherwise.
- colsint
Number of columns. 3 if there is only one sample, 4 otherwise.
- make_boxplot(labels)
Make the boxplot of mutation rates.
Parameters
- labelslist of str
Labels for the samples.
- plot_data(profile, label)
Plot the data.
Parameters
- profilernavigate.profile.Profile
Profile object.
- labelstr
Label for the sample.
- plot_mutations_per_molecule(profile, label, upper_limit=12)
Plot the mutations per molecule.
Parameters
- profilernavigate.profile.Profile
Profile object.
- labelstr
Label for the sample.
- upper_limitint, optional
Upper limit of the x-axis.
- plot_read_lengths(profile, label, upper_limit=12)
Plot the read lengths.
Parameters
- profilernavigate.profile.Profile
Profile object.
- labelstr
Label for the sample.
- upper_limitint, optional
Upper limit of the x-axis.
- set_figure_size(height_ax_rel=None, width_ax_rel=None, width_ax_in=2, height_ax_in=2, height_gap_in=1, width_gap_in=1, top_in=1, bottom_in=0.5, left_in=1, right_in=0.5)
Set the size of the figure.
Parameters
- height_ax_relfloat, optional
Height of the axes relative to the y-axis limits.
- width_ax_relfloat, optional
Width of the axes relative to the x-axis limits.
- width_ax_infloat, defaults to 2
Width of the axes in inches.
- height_ax_infloat, defaults to 2
Height of the axes in inches.
- height_gap_infloat, defaults to 1
Height of the gap between axes in inches.
- width_gap_infloat, defaults to 1
Width of the gap between axes in inches.
- top_infloat, defaults to 1
Height of the top margin in inches.
- bottom_infloat, defaults to 0.5
Height of the bottom margin in inches.
- left_infloat, defaults to 0.5
Width of the left margin in inches.
- right_infloat, defaults to 0.5
Width of the right margin in inches.
- class rnavigate.plots.ROC(num_samples, **kwargs)
Bases:
PlotPlot ROC curves.
Parameters
- num_samplesint
Number of samples to plot.
- **kwargs
Keyword arguments passed to rnavigate.plots.Plot.
Attributes
- figmatplotlib.figure.Figure
Figure object.
- a_axmatplotlib.axes.Axes
Axes object for the AUC plot of A nucleotides.
- u_axmatplotlib.axes.Axes
Axes object for the AUC plot of U nucleotides.
- g_axmatplotlib.axes.Axes
Axes object for the AUC plot of G nucleotides.
- c_axmatplotlib.axes.Axes
Axes object for the AUC plot of C nucleotides.
- main_axmatplotlib.axes.Axes
Axes object for the main ROC plot.
- axesnumpy.ndarray of matplotlib.axes.Axes
Array of axes objects.
- iint
Index of the current plot.
- get_rows_columns(rows=None, cols=None)
Get the number of rows and columns.
Parameters
- rowsint
Number of rows. This is ignored.
- colsint
Number of columns. This is ignored.
Returns
- rowsint
Number of rows. This is always 2.
- colsint
Number of columns. This is always 4.
- plot_data(structure, profile, label, nts='AUCG')
Plot the data.
Parameters
- structurernavigate.structure.Structure
Structure object.
- profilernavigate.profile.Profile
Profile object.
- labelstr
Sample name.
- ntsstr, defaults to “AUCG”
Which nucleotides to plot.
- set_figure_size(height_ax_rel=None, width_ax_rel=None, width_ax_in=1.5, height_ax_in=1.5, height_gap_in=0.3, width_gap_in=0.2, top_in=1, bottom_in=0.5, left_in=0.5, right_in=0.5)
Set the figure size.
Parameters
- height_ax_relfloat
Height of the axes relative to the y-axis limits.
- width_ax_relfloat
Width of the axes relative to the x-axis limits.
- width_ax_infloat
Width of the axes in inches.
- height_ax_infloat
Height of the axes in inches.
- height_gap_infloat
Height of the gap between axes in inches.
- width_gap_infloat
Width of the gap between axes in inches.
- top_infloat
Height of the top margin in inches.
- bottom_infloat
Height of the bottom margin in inches.
- left_infloat
Width of the left margin in inches.
- right_infloat
Width of the right margin in inches.
- class rnavigate.plots.SM(nt_length, region=None, panels=['profile', 'rates', 'depth'])
Bases:
PlotPlot classic ShapeMapper plots.
Parameters
- nt_lengthint
Length of the nucleotide sequence.
- regiontuple of int, defaults to “all” (entire sequence)
start and end position of the region to plot. If “all”, plot the entire sequence.
- panelslist of str, defaults to [“profile”, “rates”, “depth”]
Which panels to plot. Options are “profile”, “rates”, and “depth”.
Attributes
- nt_lengthint
Length of the nucleotide sequence.
- regiontuple of int
start and end position of the region to plot.
- figmatplotlib.figure.Figure
Figure object.
- axesnumpy.ndarray of matplotlib.axes.Axes
Array of axes objects.
- iint
Index of the current plot.
- metric_abbreviate(num)
takes a large number and applies an appropriate abbreviation
Parameters
- numint
number to be abbreviated
Returns
- str
abbreviated number
- plot_data(profile, label)
Plot the data.
Parameters
- profilernavigate.profile.Profile
Profile object.
- labelstr
Label for the plot.
- plot_sm_depth(ax, profile)
Plots classic ShapeMapper read depth on the given axis.
Parameters
- axmatplotlib.axes.Axes
Axes object.
- profilernavigate.profile.Profile
Profile object.
- plot_sm_profile(ax, profile)
Plots classic ShapeMapper profile on the given axis.
Parameters
- axmatplotlib.axes.Axes
Axes object.
- profilernavigate.profile.Profile
Profile object.
- plot_sm_rates(ax, profile)
Plots classic ShapeMapper mutation rates on the given axis.
Parameters
- axmatplotlib.axes.Axes
Axes object.
- profilernavigate.profile.Profile
Profile object.
- set_figure_size(height_ax_rel=None, width_ax_rel=0.03, width_ax_in=None, height_ax_in=2, height_gap_in=0.5, width_gap_in=0.5, top_in=1, bottom_in=0.5, left_in=0.5, right_in=0.5)
Set the figure size.
Parameters
- height_ax_relfloat, defaults to None
Height of the axes relative to the y-axis limits.
- width_ax_relfloat, defaults to 0.03
Width of the axes relative to the x-axis limits.
- width_ax_infloat, defaults to None
Width of the axes in inches.
- height_ax_infloat, defaults to 2
Height of the axes in inches.
- height_gap_infloat, defaults to 0.5
Height of the gap between axes in inches.
- width_gap_infloat, defaults to 0.5
Width of the gap between axes in inches.
- top_infloat, defaults to 1
Height of the top margin in inches.
- bottom_infloat, defaults to 0.5
Height of the bottom margin in inches.
- left_infloat, defaults to 0.5
Width of the left margin in inches.
- right_infloat, defaults to 0.5
Width of the right margin in inches.
- class rnavigate.plots.SS(num_samples, **kwargs)
Bases:
PlotPlot secondary structure diagrams.
Parameters
- num_samplesint
Number of samples to plot.
- **kwargs
Keyword arguments passed to rnavigate.plots.Plot.
Attributes
- figmatplotlib.figure.Figure
Figure object.
- axesnumpy.ndarray of matplotlib.axes.Axes
Array of axes objects.
- xlimslist of float
x limits of the plot.
- ylimslist of float
y limits of the plot.
- iint
Index of the current plot.
- plot_data(structure, interactions=None, interactions2=None, profile=None, annotations=None, label='', colors=None, nt_ticks=None, bp_style='dotted')
Plot the data on the current axes.
Parameters
- structurernavigate.data.SecondaryStructure
Structure object with diagram drawing coordinates.
- interactionsrnavigate.data.Interactions, optional
Interactions object to plot as lines between nucleotides.
- interactions2rnavigate.data.Interactions, optional
Interactions object to plot as lines between nucleotides.
- profilernavigate.data.Profile, optional
Profile object used to color nucleotides.
- annotationslist of rnavigate.data.Annotation, optional
Annotation objects to highlight regions or nucleotides of interest.
- labelstr, optional
Label for the plot title.
- colorsdict, optional
Dictionary of colors for each plot element. Keys are “sequence”, “nucleotides”, “structure”, and “basepairs”. Values are either matplotlib colors or strings specifying the color scheme.
- nt_ticksint, optional
Number of nucleotides between tick marks.
- bp_style“dotted”, “solid”, or “conventional”, defaults to “dotted”
Style of base pair lines.
- set_figure_size(height_ax_rel=0.2, width_ax_rel=0.2, width_ax_in=None, height_ax_in=None, height_gap_in=0.5, width_gap_in=0.2, top_in=1, bottom_in=0.5, left_in=0.5, right_in=0.5)
Set the figure size.
Parameters
- height_ax_relfloat, defaults to 0.2
Height of the axes relative to the y-axis limits.
- width_ax_relfloat, defaults to 0.2
Width of the axes relative to the x-axis limits.
- width_ax_infloat
Width of the axes in inches.
- height_ax_infloat
Height of the axes in inches.
- height_gap_infloat, defaults to 0.5
Height of the gap between axes in inches.
- width_gap_infloat, defaults to 0.2
Width of the gap between axes in inches.
- top_infloat, defaults to 1
Height of the top margin in inches.
- bottom_infloat, defaults to 0.5
Height of the bottom margin in inches.
- left_infloat, defaults to 0.5
Width of the left margin in inches.
- right_infloat, defaults to 0.5
Width of the right margin in inches.
- class rnavigate.plots.Skyline(num_samples, nt_length, region='all', **kwargs)
Bases:
PlotPlot per-nucleotide measurements as stepped line graphs (skyline plots).
Parameters
- num_samplesint
Number of samples to plot.
- nt_lengthint
Length of the nucleotide sequence.
- regiontuple of int, defaults to “all” (entire sequence)
start and end position of the region to plot. If “all”, plot the entire sequence.
- **kwargs
Keyword arguments passed to rnavigate.plots.Plot.
Attributes
- nt_lengthint
Length of the nucleotide sequence.
- regiontuple of int
start and end position of the region to plot.
- track_heightfloat
Height of the tracks in the plot.
- figmatplotlib.figure.Figure
Figure object.
- axmatplotlib.axes.Axes
Axes object.
- axesnumpy.ndarray of matplotlib.axes.Axes
Array of axes objects.
- iint
Index of the current plot.
- get_ax(i=None)
Get the current axes object.
Parameters
- iint, optional
Index of the axes object. This is ignored.
Returns
- axmatplotlib.axes.Axes
Axes object.
- get_rows_columns(rows=None, cols=None)
Get the number of rows and columns.
Parameters
- rowsint
Number of rows. This is ignored.
- colsint
Number of columns. This is ignored.
Returns
- rowsint
Number of rows. This is always 1.
- colsint
Number of columns. This is always 1.
- plot_data(profile, annotations=None, domains=None, label=None, columns=None, seqbar=True, errors=None, annotations_mode='track', nt_ticks=(20, 5))
Add data to the axes.
Parameters
- profilernavigate.profile.Profile
Profile object.
- annotationslist of rnavigate.annotation.Annotation, optional
List of annotation objects.
- domainslist of rnavigate.domain.Domain, optional
List of domain objects.
- labelstr, optional
Sample name.
- columnsstr or list of str, optional
Which columns to plot. If None, plot the metric column.
- seqbarbool, defaults to True
Whether to plot a sequence bar.
- errorsstr, optional
Which error columns to plot. If None, do not plot errors.
- annotations_mode“track” or “bar”, defaults to “track”
Whether to plot annotations as a track or as vertical bars.
- nt_tickstuple of int, defaults to (20, 5)
Major and minor tick frequency for nucleotide positions.
- set_axis(ax, sequence, nt_ticks)
Set the axis limits and ticks.
Parameters
- axmatplotlib.axes.Axes
Axes object.
- sequencernavigate.data.Sequence
The sequence on which position labels are based. Dashes are ignored.
- nt_tickstuple of int
Major and minor tick frequency for nucleotide positions.
- set_figure_size(height_ax_rel=None, width_ax_rel=0.03, width_ax_in=None, height_ax_in=2, height_gap_in=1, width_gap_in=0.5, top_in=1, bottom_in=1, left_in=1, right_in=1)
Set the figure size.
Parameters
- height_ax_relfloat
Height of the axes relative to the y-axis limits.
- width_ax_relfloat
Width of the axes relative to the x-axis limits.
- width_ax_infloat
Width of the axes in inches.
- height_ax_infloat
Height of the axes in inches.
- height_gap_infloat
Height of the gap between axes in inches.
- width_gap_infloat
Width of the gap between axes in inches.
- top_infloat
Height of the top margin in inches.
- bottom_infloat
Height of the bottom margin in inches.
- left_infloat
Width of the left margin in inches.
- right_infloat
Width of the right margin in inches.
- set_labels(ax, axis_title='Raw Reactivity Profile', legend_title='Samples', xlabel='Nucleotide Position', ylabel='Profile')
Set the axis labels and legend.
Parameters
- axmatplotlib.axes.Axes
Axes object.
- axis_titlestr, optional
Title of the axes.
- legend_titlestr, optional
Title of the legend.
- xlabelstr, optional
Label of the x-axis.
- ylabelstr, optional
Label of the y-axis.
- rnavigate.plots.adjust_spines(ax, spines)
Places the given spines on the given axis, removes others.
Parameters
- axmatplotlib.axes.Axes
The axes to adjust the spines of.
- spineslist of str
The spines to adjust. Valid options are “left”, “right”, “top”, and “bottom”.
- rnavigate.plots.box_xtick_labels(ax)
Place a transparent box behind the xtick labels of the provided axis.
- rnavigate.plots.clip_spines(ax, spines)
Clips the given spines to the range of the ticks.
Parameters
- axmatplotlib.axes.Axes
The axes to clip the spines of.
- spineslist of str
The spines to clip. Valid options are “left”, “right”, “top”, and “bottom”.
- rnavigate.plots.get_contrasting_colors(colors)
Get contrasting colors for a list of colors.
Returns a list of “k” (black) or “w” (white) for each color in the input list, which ever contrasts better with the input color.
Parameters
- colorslist of str
List of colors to get contrasting colors for.
Returns
- list of str
List of “k” or “w” for each color in the input list.
- rnavigate.plots.get_nt_ticks(sequence, region, gap)
Get the ticks and labels for a region of a sequence.
Dashes are ignored when counting nucleotide positions.
Parameters
- sequencestr or rnavigate.data.Sequence
The sequence to get ticks and labels for.
- regiontuple of int
The region of the sequence to get ticks and labels for.
- gapint
The gap between major ticks.
Returns
- ticks, labelstuple of list of int
The ticks and labels for the given region of the sequence.
- rnavigate.plots.plot_annotation_circle(ax, seq_circle, annotation, offset=1)
Plot annotations on a circle plot.
Parameters
- axmatplotlib.axes.Axes
The axes to plot on.
- seq_circlernavigate.data.SequenceCircle
The sequence circle object containing nucleotide positions.
- annotationrnavigate.data.Annotation
The annotation to be plotted.
- offsetfloat, optional
The offset from the circle circumference to plot the annotation.
- rnavigate.plots.plot_annotation_ss(ax, structure, annotation)
Highlight regions or nucleotides of interest on a secondary structure diagram.
Parameters
- axmatplotlib.axes.Axes
Axes to plot on.
- structurernavigate.data.SecondaryStructure
Secondary structure with diagram drawing coordinates.
- annotationrnavigate.data.Annotation
Annotation to plot.
- rnavigate.plots.plot_annotation_track(ax, annotation, yvalue, height, mode, region='all', ytrans='data')
Plot an annotation track along the x-axis of a plot.
Parameters
- axmatplotlib.axes.Axes
The axes to plot the annotation track on.
- annotationrnavigate.data.Annotation
The annotation to plot.
- yvaluefloat
The y-value of the annotation track.
- heightfloat
The height of the annotation track.
- mode“track” or “bar”
The annotation mode.
- regionlist of 2 int, defaults to “all”
Start and end positions of the region to plot. If “all”, plot the entire sequence.
- ytrans“data” or “axes”, defaults to “data”
The y-axis coordinate system.
- rnavigate.plots.plot_basepairs_ss(ax, structure, bp_style)
Plot the basepairs of a secondary structure diagram.
Parameters
- axmatplotlib.axes.Axes
Axes to plot on.
- structurernavigate.data.SecondaryStructure
Secondary structure with diagram drawing coordinates to plot.
- bp_style“conventional”, “dotted” or “line”
Style of basepairs to plot.
- rnavigate.plots.plot_domain_track(ax, spans, yvalue, height, region='all', ytrans='data')
Plot a domain track along the x-axis of a plot.
Parameters
- axmatplotlib.axes.Axes
The axes to plot the domain track on.
- spansrnavigate.data.Spans
The spans to plot.
- yvaluefloat
The y-value of the domain track.
- heightfloat
The height of the domain track.
- regionlist of 2 int, defaults to “all”
Start and end positions of the region to plot. If “all”, plot the entire sequence.
- ytrans“data” or “axes”, defaults to “data”
The y-axis coordinate system.
- rnavigate.plots.plot_interactions_arcs(ax, interactions, panel, yvalue=0, region='all')
Plot interactions as arcs.
Parameters
- axmatplotlib.axes.Axes
The axes to plot the interactions on.
- interactionsrnavigate.data.Interactions
The interactions to plot.
- panel“top” or “bottom”
The panel to plot the interactions on.
- yvaluefloat, optional
The y-value at which to plot the interactions.
- regiontuple of int, optional
The region of the sequence to plot interactions for.
- rnavigate.plots.plot_interactions_circle(ax, seq_circle, interactions)
Plot interactions on a circle plot.
Parameters
- axmatplotlib.axes.Axes
The axes to plot on.
- seq_circlernavigate.data.SequenceCircle
The sequence circle object containing nucleotide positions.
- interactionsrnavigate.data.Interactions
The interactions to be plotted as arcs between nucleotides.
- rnavigate.plots.plot_interactions_ss(ax, structure, interactions)
Plot the interactions as lines over a secondary structure diagram.
Parameters
- axmatplotlib.axes.Axes
Axes to plot on.
- structurernavigate.data.SecondaryStructure
Secondary structure with diagram drawing coordinates.
- interactionsrnavigate.data.Interactions
Interactions to plot.
- rnavigate.plots.plot_nucleotides_ss(ax, structure, colors)
Plot the nucleotides of a secondary structure diagram.
Parameters
- axmatplotlib.axes.Axes
Axes to plot on.
- structurernavigate.data.SecondaryStructure
Secondary structure with diagram drawing coordinates to plot.
- colorslist
List of colors to use for each nucleotide in the structure.
- rnavigate.plots.plot_positions_ss(ax, structure, xticks=20)
Plot the positions of a secondary structure diagram.
Label locations are chosen from a point on a circle around each position that is the furthest from any other nucleotides. This sometimes causes tick marks and labels to overlap with other plot elements.
Parameters
- axmatplotlib.axes.Axes
Axes to plot on.
- structurernavigate.data.SecondaryStructure
Secondary structure with diagram drawing coordinates to plot.
- xticksint
Spacing between position labels.
- rnavigate.plots.plot_profile_bars(ax, profile, scale_factor=1, plot_error=True, bottom=0, region='all')
Plot per-nucleotide data as colored bars.
Parameters
- axmatplotlib.axes.Axes
The axes to plot the profile on.
- profilernavigate.data.Profile
The profile to plot.
- scale_factorfloat, optional
The factor by which to multiply per-nucleotide values.
- plot_errorbool, optional
Whether to plot error bars.
- bottomfloat, optional
The y-value at which to plot the bars.
- regiontuple of int, optional
The region of the sequence to plot bars for.
- rnavigate.plots.plot_profile_skyline(ax, profile, label, columns, errors)
Plot per-nucleotide data as a skyline plot.
Parameters
- axmatplotlib.axes.Axes
The axes to plot the profile on.
- profilernavigate.data.Profile
The profile to plot.
- labelstr
The label to use for the plot legend.
- columnslist of str
The columns of the profile to plot.
- errorslist of str
The columns of the profile to use for error bars.
- rnavigate.plots.plot_sequence_alignment(ax, alignment, labels, top=5, bottom=-5, ytrans='data')
Plot a sequence alignment.
Parameters
- axmatplotlib.axes.Axes
The axes to plot the alignment on.
- alignmentrnavigate.data.Alignment
The alignment to plot.
- labelstuple of str
The labels for the two sequences in the alignment.
- topint, optional
The y-value to plot the top sequence at.
- bottomint, optional
The y-value to plot the bottom sequence at.
- ytransstr, optional
The transform to use for the y-values. Valid options are “data” and “axes”.
- rnavigate.plots.plot_sequence_ss(ax, structure, colors)
Plot the sequence of a secondary structure diagram.
Parameters
- axmatplotlib.axes.Axes
Axes to plot on.
- structurernavigate.data.SecondaryStructure
Secondary structure with diagram drawing coordinates to plot.
- colorslist
List of colors to use for each nucleotide in the structure.
- rnavigate.plots.plot_sequence_track(ax, sequence, yvalue=-0.05, height=0.05, ytrans='data', verticalalignment='bottom', region='all')
Plot a sequence track along the x-axis of a plot.
Parameters
- axmatplotlib.axes.Axes
The axes to plot the sequence track on.
- sequencestr
The sequence to plot.
- yvaluefloat, defaults to -0.05
The y-value of the sequence track.
- heightfloat, defaults to 0.05
The height of the sequence track.
- ytrans“data” or “axes”, defaults to “data”
The y-axis coordinate system.
- verticalalignment“top” or “bottom”, defaults to “bottom”
The vertical alignment of the sequence track.
- regionlist of 2 int, defaults to “all”
Start and end positions of the region to plot. If “all”, plot the entire sequence.
- rnavigate.plots.plot_structure_ss(ax, structure, colors)
Plot the structure of a secondary structure diagram.
Parameters
- axmatplotlib.axes.Axes
Axes to plot on.
- structurernavigate.data.SecondaryStructure
Secondary structure with diagram drawing coordinates to plot.
- colorslist
List of colors to use for each nucleotide in the structure.
- rnavigate.plots.set_nt_ticks(ax, sequence, region, major, minor)
Set the ticks and labels for a region of a sequence.
Dashes are ignored when counting nucleotide positions.
Parameters
- axmatplotlib.axes.Axes
The axes to set the ticks and labels of.
- sequencestr or rnavigate.data.Sequence
The sequence to set ticks and labels for.
- regiontuple of int
The region of the sequence to set ticks and labels for.
- majorint
The gap between major ticks.
- minorint
The gap between minor ticks.