GenomeViz Class
GenomeViz
GenomeViz(
*,
fig_width: float = 15,
fig_track_height: float = 1.0,
track_align_type: TrackAlignType = "left",
feature_track_ratio: float = 0.25,
link_track_ratio: float = 1.0,
theme: Theme = "light",
show_axis: bool = False
)
Genome Visualization Class
PARAMETER | DESCRIPTION |
---|---|
fig_width
|
Figure width
TYPE:
|
fig_track_height
|
Figure height =
TYPE:
|
track_align_type
|
Figure track alignment type (
TYPE:
|
feature_track_ratio
|
Feature track size ratio
TYPE:
|
link_track_ratio
|
Link track size ratio
TYPE:
|
theme
|
TYPE:
|
show_axis
|
Show axis for debug purpose
TYPE:
|
get_tracks
Get tracks
PARAMETER | DESCRIPTION |
---|---|
subtrack
|
If True, include subtracks in FeatureTrack
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
tracks
|
Tracks [
TYPE:
|
add_feature_track
add_feature_track(
name: str,
segments: (
int
| tuple[int, int]
| Sequence[int | tuple[int, int]]
| Mapping[str, int | tuple[int, int]]
),
*,
space: float | list[float] = 0.02,
offset: int | TrackAlignType | None = None,
labelsize: float = 20,
labelmargin: float = 0.01,
align_label: bool = True,
label_kws: dict[str, Any] | None = None,
line_kws: dict[str, Any] | None = None
) -> FeatureTrack
Add feature track
Add feature track, and also add link track between feature tracks if other feature tracks already exist.
PARAMETER | DESCRIPTION |
---|---|
name
|
Track name
TYPE:
|
segments
|
Track segments definition. Segment sizes or ranges can be specified.
TYPE:
|
space
|
Space ratio between segments.
If
TYPE:
|
offset
|
Offset int value or TrackAlignType (
TYPE:
|
labelsize
|
Track label size
TYPE:
|
labelmargin
|
Track label margin
TYPE:
|
align_label
|
If True, align track label to the most left position. If False, set track label to first segment start position.
TYPE:
|
label_kws
|
Text properties (e.g.
TYPE:
|
line_kws
|
Axes.plot properties (e.g.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
feature_track
|
Feature track
TYPE:
|
add_link
add_link(
target1: tuple[str, int, int] | tuple[str, str | None, int, int],
target2: tuple[str, int, int] | tuple[str, str | None, int, int],
color: str = "grey",
inverted_color: str | None = None,
alpha: float = 0.8,
v: float | None = None,
vmin: float = 0,
vmax: float = 100,
size: float = 1.0,
curve: bool = False,
filter_length: int = 0,
ignore_outside_range: bool = False,
v_tooltip: float | None = None,
**kwargs
) -> None
Add link patch to link track between adjacent feature tracks
PARAMETER | DESCRIPTION |
---|---|
target1
|
Target link1
TYPE:
|
target2
|
Target link2
TYPE:
|
color
|
Link color
TYPE:
|
inverted_color
|
Inverted link color. If None,
TYPE:
|
alpha
|
Color transparency
TYPE:
|
v
|
Identity value for color interpolation. If None, no color interpolation is done.
TYPE:
|
vmin
|
Min value for color interpolation
TYPE:
|
vmax
|
Max value for color interpolation
TYPE:
|
size
|
Link vertical size ratio for track
TYPE:
|
curve
|
If True, bezier curve link is plotted
TYPE:
|
filter_length
|
If link length is shorter than
TYPE:
|
ignore_outside_range
|
If True and the link position is outside the range of the target track, ignore it without raising an error.
TYPE:
|
v_tooltip
|
Identity value for only tooltip display.
If no color interpolation is required, use this option instead of
TYPE:
|
**kwargs
|
Patch properties (e.g.
DEFAULT:
|
set_scale_bar
set_scale_bar(
*,
ymargin: float = 1.0,
labelsize: float = 15,
scale_size_label: tuple[int, str] | None = None
) -> None
Set scale bar
PARAMETER | DESCRIPTION |
---|---|
ymargin
|
Scale bar y margin
TYPE:
|
labelsize
|
Label size
TYPE:
|
scale_size_label
|
Scale bar size & label tuple (e.g.
TYPE:
|
set_scale_xticks
set_scale_xticks(
*,
ymargin: float = 1.0,
labelsize: float = 15,
start: int = 0,
unit: Unit | None = None
) -> None
Set scale xticks
PARAMETER | DESCRIPTION |
---|---|
ymargin
|
X ticks y margin
TYPE:
|
labelsize
|
Label size
TYPE:
|
start
|
X ticks start position
TYPE:
|
unit
|
Display unit (
TYPE:
|
set_colorbar
set_colorbar(
colors: list[str] | None = None,
*,
alpha: float = 0.8,
vmin: float = 0,
vmax: float = 100,
bar_height: float = 0.2,
bar_width: float = 0.01,
bar_left: float = 1.02,
bar_bottom: float = 0,
bar_label: str = "",
bar_labelsize: float = 15,
tick_labelsize: float = 10
) -> None
Set colorbar
PARAMETER | DESCRIPTION |
---|---|
colors
|
Colors for bar
TYPE:
|
alpha
|
Color transparency
TYPE:
|
vmin
|
Colorbar min value
TYPE:
|
vmax
|
Colorbar max value
TYPE:
|
bar_height
|
Colorbar height ratio
TYPE:
|
bar_width
|
Colorbar width ratio
TYPE:
|
bar_left
|
Colorbar left position
TYPE:
|
bar_bottom
|
Colorbar bottom position
TYPE:
|
bar_label
|
Colorbar label
TYPE:
|
bar_labelsize
|
Colorbar label size
TYPE:
|
tick_labelsize
|
Colorbar tick label size
TYPE:
|
plotfig
Plot figure
PARAMETER | DESCRIPTION |
---|---|
dpi
|
DPI
TYPE:
|
fast_render
|
Enable fast rendering mode using PatchCollection.
Set fast_render=True by default, and set it to False
when used in the
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
fig
|
Plot figure result
TYPE:
|
savefig
Save figure to file
PARAMETER | DESCRIPTION |
---|---|
savefile
|
Save file
TYPE:
|
dpi
|
DPI
TYPE:
|
pad_inches
|
Padding inches
TYPE:
|
Warnings
To plot a figure that settings a user-defined legend, subtracks, or annotations,
call fig.savefig()
instead of gv.savefig()
.
savefig_html
savefig_html(
html_outfile: str | Path | io.StringIO | io.BytesIO, figure: Figure | None = None
) -> None
Save figure in html format
PARAMETER | DESCRIPTION |
---|---|
html_outfile
|
Output HTML file (*.html)
TYPE:
|
figure
|
Save HTML viewer file using user customized figure.
Set to output figure including user-specified legend, subtracks, etc.
Target figure must be generated by
TYPE:
|