rnavigate.plots.functions package

Submodules

rnavigate.plots.functions.circle module

rnavigate.plots.functions.circle.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.functions.circle.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.functions.functions module

rnavigate.plots.functions.functions.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.functions.functions.box_xtick_labels(ax)

Place a transparent box behind the xtick labels of the provided axis.

rnavigate.plots.functions.functions.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.functions.functions.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.functions.functions.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.functions.functions.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.functions.functions.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.functions.functions.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.functions.functions.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.functions.functions.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.

rnavigate.plots.functions.ss module

rnavigate.plots.functions.ss.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.functions.ss.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.functions.ss.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.functions.ss.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.functions.ss.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.functions.ss.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.functions.ss.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.functions.tracks module

rnavigate.plots.functions.tracks.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.functions.tracks.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.functions.tracks.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.

Module contents

rnavigate.plots.functions.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.functions.box_xtick_labels(ax)

Place a transparent box behind the xtick labels of the provided axis.

rnavigate.plots.functions.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.functions.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.functions.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.functions.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.functions.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.functions.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.functions.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.functions.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.functions.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.functions.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.functions.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.functions.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.functions.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.functions.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.functions.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.functions.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.functions.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.functions.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.functions.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.functions.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.