diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/404.html b/404.html new file mode 100644 index 0000000..0a72bac --- /dev/null +++ b/404.html @@ -0,0 +1,564 @@ + + + +
+ + + + + + + + + + + + + + + + + + +Circos(
+ sectors: dict[str, int] | dict[str, float],
+ start: float = 0,
+ end: float = 360,
+ *,
+ space: float | list[float] = 0,
+ endspace: bool = True,
+ sector2start_pos: dict[str, int] | dict[str, float] | None = None,
+ sector2clockwise: dict[str, bool] | None = None,
+ show_axis_for_debug: bool = False
+)
+
Circos Visualization Class
+ + + + +PARAMETER | +DESCRIPTION | +
---|---|
sectors |
+
+
+
+ Sector name & size dict +
+
+ TYPE:
+ |
+
start |
+
+
+
+ Plot start degree (
+
+ TYPE:
+ |
+
end |
+
+
+
+ Plot end degree (
+
+ TYPE:
+ |
+
space |
+
+
+
+ Space degree(s) between sector +
+
+ TYPE:
+ |
+
endspace |
+
+
+
+ If True, insert space after the end sector +
+
+ TYPE:
+ |
+
sector2start_pos |
+
+
+
+ Sector name & start position dict. By default,
+
+ TYPE:
+ |
+
sector2clockwise |
+
+
+
+ Sector name & clockwise bool dict. By default,
+
+ TYPE:
+ |
+
show_axis_for_debug |
+
+
+
+ Show axis for position check debugging (Developer option) +
+
+ TYPE:
+ |
+
property
+
+
+Circos radian limit
+property
+
+
+Circos degree limit
+property
+
+
+Tracks (from sectors)
+property
+
+
+Plot polar axes
+Can't access ax
property before calling circos.plotfig()
method
staticmethod
+
+
+initialize_from_matrix(
+ matrix: str | Path | pd.DataFrame | Matrix,
+ *,
+ start: float = 0,
+ end: float = 360,
+ space: float | list[float] = 0,
+ endspace: bool = True,
+ r_lim: tuple[float, float] = (97, 100),
+ cmap: str | dict[str, str] = "viridis",
+ link_cmap: list[tuple[str, str, str]] | None = None,
+ ticks_interval: int | None = None,
+ order: str | list[str] | None = None,
+ label_kws: dict[str, Any] | None = None,
+ ticks_kws: dict[str, Any] | None = None,
+ link_kws: dict[str, Any] | None = None,
+ link_kws_handler: Callable[[str, str], dict[str, Any] | None] | None = None
+) -> Circos
+
Initialize Circos instance from Matrix
+Circos tracks and links are auto-defined by Matrix (For plotting Chord Diagram)
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
matrix |
+
+
+
+ Matrix file or Matrix dataframe or Matrix instance +
+
+ TYPE:
+ |
+
start |
+
+
+
+ Plot start degree (-360 <= start < end <= 360) +
+
+ TYPE:
+ |
+
end |
+
+
+
+ Plot end degree (-360 <= start < end <= 360) +
+
+ TYPE:
+ |
+
space |
+
+
+
+ Space degree(s) between sector +
+
+ TYPE:
+ |
+
endspace |
+
+
+
+ If True, insert space after the end sector +
+
+ TYPE:
+ |
+
r_lim |
+
+
+
+ Outer track radius limit region (0 - 100) +
+
+ TYPE:
+ |
+
cmap |
+
+
+
+ Colormap assigned to each outer track and link.
+User can set matplotlib's colormap (e.g.
+
+ TYPE:
+ |
+
link_cmap |
+
+
+
+ Link colormap to overwrite link colors automatically set by cmap.
+User can set list of
+
+ TYPE:
+ |
+
ticks_interval |
+
+
+
+ Ticks interval. If None, ticks are not plotted. +
+
+ TYPE:
+ |
+
order |
+
+
+
+ Sort order of matrix for plotting Chord Diagram. If
+
+ TYPE:
+ |
+
label_kws |
+
+
+
+ Keyword arguments passed to
+
+ TYPE:
+ |
+
ticks_kws |
+
+
+
+ Keyword arguments passed to
+
+ TYPE:
+ |
+
link_kws |
+
+
+
+ Keyword arguments passed to
+
+ TYPE:
+ |
+
link_kws_handler |
+
+
+
+ User-defined function to handle keyword arguments for each link.
+This option allows user to set or override properties such as
+
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ circos
+ |
+
+
+
+ Circos instance initialized from Matrix +
+
+ TYPE:
+ |
+
staticmethod
+
+
+initialize_from_tree(
+ tree_data: str | Path | Tree,
+ *,
+ start: float = 0,
+ end: float = 360,
+ r_lim: tuple[float, float] = (50, 100),
+ format: str = "newick",
+ outer: bool = True,
+ align_leaf_label: bool = True,
+ ignore_branch_length: bool = False,
+ leaf_label_size: float = 12,
+ leaf_label_rmargin: float = 2.0,
+ reverse: bool = False,
+ ladderize: bool = False,
+ line_kws: dict[str, Any] | None = None,
+ align_line_kws: dict[str, Any] | None = None
+) -> tuple[Circos, TreeViz]
+
Initialize Circos instance from phylogenetic tree
+Circos sector and track are auto-defined by phylogenetic tree
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
tree_data |
+
+
+
+ Tree data (
+
+ TYPE:
+ |
+
start |
+
+
+
+ Plot start degree (-360 <= start < end <= 360) +
+
+ TYPE:
+ |
+
end |
+
+
+
+ Plot end degree (-360 <= start < end <= 360) +
+
+ TYPE:
+ |
+
r_lim |
+
+
+
+ Tree track radius limit region (0 - 100) +
+
+ TYPE:
+ |
+
format |
+
+
+
+ Tree format (
+
+ TYPE:
+ |
+
outer |
+
+
+
+ If True, plot tree on outer side. If False, plot tree on inner side. +
+
+ TYPE:
+ |
+
align_leaf_label |
+
+
+
+ If True, align leaf label. +
+
+ TYPE:
+ |
+
ignore_branch_length |
+
+
+
+ If True, ignore branch length for plotting tree. +
+
+ TYPE:
+ |
+
leaf_label_size |
+
+
+
+ Leaf label size +
+
+ TYPE:
+ |
+
leaf_label_rmargin |
+
+
+
+ Leaf label radius margin +
+
+ TYPE:
+ |
+
reverse |
+
+
+
+ If True, reverse tree +
+
+ TYPE:
+ |
+
ladderize |
+
+
+
+ If True, ladderize tree +
+
+ TYPE:
+ |
+
line_kws |
+
+
+
+ Patch properties (e.g.
+
+ TYPE:
+ |
+
align_line_kws |
+
+
+
+ Patch properties (e.g.
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+
+ circos, tv : tuple[Circos, TreeViz]
+
+ |
+
+
+
+ Circos & TreeViz instances initialized from tree + |
+
staticmethod
+
+
+initialize_from_bed(
+ bed_file: str | Path,
+ start: float = 0,
+ end: float = 360,
+ *,
+ space: float | list[float] = 0,
+ endspace: bool = True,
+ sector2clockwise: dict[str, bool] | None = None
+) -> Circos
+
Initialize Circos instance from BED file
+Circos sectors are auto-defined by BED chromosomes
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
bed_file |
+
+
+
+ Chromosome BED format file (zero-based coordinate) +
+
+ TYPE:
+ |
+
start |
+
+
+
+ Plot start degree (-360 <= start < end <= 360) +
+
+ TYPE:
+ |
+
end |
+
+
+
+ Plot end degree (-360 <= start < end <= 360) +
+
+ TYPE:
+ |
+
space |
+
+
+
+ Space degree(s) between sector +
+
+ TYPE:
+ |
+
endspace |
+
+
+
+ If True, insert space after the end sector +
+
+ TYPE:
+ |
+
sector2clockwise |
+
+
+
+ Sector name & clockwise bool dict. By default,
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ circos
+ |
+
+
+
+ Circos instance initialized from BED file +
+
+ TYPE:
+ |
+
add_cytoband_tracks(
+ r_lim: tuple[float, float],
+ cytoband_file: str | Path,
+ *,
+ track_name: str = "cytoband",
+ cytoband_cmap: dict[str, str] | None = None
+) -> None
+
Add track & plot chromosome cytoband on each sector
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
r_lim |
+
+
+
+ Radius limit region (0 - 100) +
+
+ TYPE:
+ |
+
cytoband_file |
+
+
+
+ Cytoband tsv file (UCSC format) +
+
+ TYPE:
+ |
+
track_name |
+
+
+
+ Cytoband track name. By default,
+
+ TYPE:
+ |
+
cytoband_cmap |
+
+
+
+ User-defined cytoband colormap. If None, use Circos style colormap.
+(e.g.
+
+ TYPE:
+ |
+
Get sector by name
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
name |
+
+
+
+ Sector name +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ sector
+ |
+
+
+
+ Sector +
+
+ TYPE:
+ |
+
Get degree min-max limit in target group sectors
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
group_sector_names |
+
+
+
+ Group sector names +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ group_sectors_deg_lim
+ |
+
+
+
+ Degree limit in group sectors +
+
+ TYPE:
+ |
+
Plot axis
+By default, simple black axis params(fc="none", ec="black", lw=0.5
) are set.
PARAMETER | +DESCRIPTION | +
---|---|
**kwargs |
+
+
+
+ Patch properties (e.g.
+
+ TYPE:
+ |
+
text(
+ text: str,
+ *,
+ r: float = 0,
+ deg: float = 0,
+ adjust_rotation: bool = False,
+ orientation: str = "horizontal",
+ **kwargs
+) -> None
+
Plot text
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
text |
+
+
+
+ Text content +
+
+ TYPE:
+ |
+
r |
+
+
+
+ Radius position +
+
+ TYPE:
+ |
+
deg |
+
+
+
+ Degree position (0 - 360) +
+
+ TYPE:
+ |
+
adjust_rotation |
+
+
+
+ If True, text rotation is auto set based on
+
+ TYPE:
+ |
+
orientation |
+
+
+
+ Text orientation (
+
+ TYPE:
+ |
+
**kwargs |
+
+
+
+ Text properties (e.g.
+
+ TYPE:
+ |
+
line(
+ *,
+ r: float | tuple[float, float],
+ deg_lim: tuple[float, float] | None = None,
+ arc: bool = True,
+ **kwargs
+) -> None
+
Plot line
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
r |
+
+
+
+ Line radius position (0 - 100). If r is float, (r, r) is set. +
+
+ TYPE:
+ |
+
deg_lim |
+
+
+
+ Degree limit region (-360 - 360). If None,
+
+ TYPE:
+ |
+
arc |
+
+
+
+ If True, plot arc style line for polar projection. +If False, simply plot linear style line. +
+
+ TYPE:
+ |
+
**kwargs |
+
+
+
+ Patch properties (e.g.
+
+ TYPE:
+ |
+
rect(
+ r_lim: tuple[float, float] = (0, 100),
+ deg_lim: tuple[float, float] | None = None,
+ **kwargs
+) -> None
+
Plot rectangle
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
r_lim |
+
+
+
+ Radius limit region (0 - 100) +
+
+ TYPE:
+ |
+
deg_lim |
+
+
+
+ Degree limit region (-360 - 360). If None,
+
+ TYPE:
+ |
+
**kwargs |
+
+
+
+ Patch properties (e.g.
+
+ TYPE:
+ |
+
link(
+ sector_region1: tuple[str, float, float],
+ sector_region2: tuple[str, float, float],
+ r1: float | None = None,
+ r2: float | None = None,
+ *,
+ color: str = "grey",
+ alpha: float = 0.5,
+ height_ratio: float = 0.5,
+ direction: int = 0,
+ arrow_length_ratio: float = 0.05,
+ allow_twist: bool = True,
+ **kwargs
+) -> None
+
Plot link to specified region within or between sectors
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
sector_region1 |
+
+
+
+ Link sector region1 (name, start, end) +
+
+ TYPE:
+ |
+
sector_region2 |
+
+
+
+ Link sector region2 (name, start, end) +
+
+ TYPE:
+ |
+
r1 |
+
+
+
+ Link radius end position for sector_region1. +If None, lowest radius position of track in target sector is set. +
+
+ TYPE:
+ |
+
r2 |
+
+
+
+ Link radius end position for sector_region2. +If None, lowest radius position of track in target sector is set. +
+
+ TYPE:
+ |
+
color |
+
+
+
+ Link color +
+
+ TYPE:
+ |
+
alpha |
+
+
+
+ Link color alpha (transparency) value +
+
+ TYPE:
+ |
+
height_ratio |
+
+
+
+ Bezier curve height ratio +
+
+ TYPE:
+ |
+
direction |
+
+
+
+
+
+ TYPE:
+ |
+
arrow_length_ratio |
+
+
+
+ Direction arrow length ratio +
+
+ TYPE:
+ |
+
allow_twist |
+
+
+
+ If False, twisted link is automatically resolved. +http://circos.ca/documentation/tutorials/links/twists/images +
+
+ TYPE:
+ |
+
**kwargs |
+
+
+
+ Patch properties (e.g.
+
+ TYPE:
+ |
+
colorbar(
+ bounds: tuple[float, float, float, float] = (1.02, 0.3, 0.02, 0.4),
+ *,
+ vmin: float = 0,
+ vmax: float = 1,
+ cmap: str | Colormap = "bwr",
+ orientation: str = "vertical",
+ colorbar_kws: dict[str, Any] | None = None,
+ tick_kws: dict[str, Any] | None = None
+) -> None
+
Plot colorbar
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
bounds |
+
+
+
+ Colorbar bounds tuple (
+
+ TYPE:
+ |
+
vmin |
+
+
+
+ Colorbar min value +
+
+ TYPE:
+ |
+
vmax |
+
+
+
+ Colorbar max value +
+
+ TYPE:
+ |
+
cmap |
+
+
+
+ Colormap (e.g.
+
+ TYPE:
+ |
+
orientation |
+
+
+
+ Colorbar orientation (
+
+ TYPE:
+ |
+
colorbar_kws |
+
+
+
+ Colorbar properties (e.g.
+
+ TYPE:
+ |
+
tick_kws |
+
+
+
+ Axes.tick_params properties (e.g.
+
+ TYPE:
+ |
+
Plot figure
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
dpi |
+
+
+
+ Figure DPI +
+
+ TYPE:
+ |
+
ax |
+
+
+
+ If None, figure and axes are newly created. +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ figure
+ |
+
+
+
+ Circos matplotlib figure +
+
+ TYPE:
+ |
+
Save figure to file
+circos.savefig("result.png")
is alias for
+circos.plotfig().savefig("result.png")
PARAMETER | +DESCRIPTION | +
---|---|
savefile |
+
+
+
+ Save file (
+
+ TYPE:
+ |
+
dpi |
+
+
+
+ DPI +
+
+ TYPE:
+ |
+
pad_inches |
+
+
+
+ Padding inches +
+
+ TYPE:
+ |
+
Sector(
+ name: str,
+ size: float,
+ rad_lim: tuple[float, float],
+ start_pos: float = 0,
+ clockwise: bool = True,
+)
+
Circos Sector Class
+ + + + +PARAMETER | +DESCRIPTION | +
---|---|
name |
+
+
+
+ Sector name +
+
+ TYPE:
+ |
+
size |
+
+
+
+ Sector size +
+
+ TYPE:
+ |
+
rad_lim |
+
+
+
+ Sector radian limit region +
+
+ TYPE:
+ |
+
start_pos |
+
+
+
+ Sector start position +
+
+ TYPE:
+ |
+
clockwise |
+
+
+
+ Sector coordinate direction (clockwise or anti-clockwise). +
+
+ TYPE:
+ |
+
property
+
+
+Sector start position (x coordinate)
+property
+
+
+Sector end position (x coordinate)
+property
+
+
+Sector center position (x coordinate)
+property
+
+
+Sector radian limit
+property
+
+
+Sector degree limit
+property
+
+
+Sector coordinate direction
+property
+
+
+Plot functions
+add_track(
+ r_lim: tuple[float, float], *, r_pad_ratio: float = 0, name: str | None = None
+) -> Track
+
Add track to sector
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
r_lim |
+
+
+
+ Radius limit region (0 - 100) +
+
+ TYPE:
+ |
+
r_pad_ratio |
+
+
+
+ Radius padding ratio for plot data (0 - 1.0) +
+
+ TYPE:
+ |
+
name |
+
+
+
+ Track name. If None,
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ track
+ |
+
+
+
+ Track +
+
+ TYPE:
+ |
+
Get track by name
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
name |
+
+
+
+ Track name +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ track
+ |
+
+
+
+ Target name track +
+
+ TYPE:
+ |
+
Get lowest radius position of sector from tracks data
+ + + +RETURNS | +DESCRIPTION | +
---|---|
+ lowest_r
+ |
+
+
+
+ Lowest radius position. If no tracks found,
+
+ TYPE:
+ |
+
Convert x coordinate to radian in sector start-end range
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
x |
+
+
+
+ X coordinate +
+
+ TYPE:
+ |
+
ignore_range_error |
+
+
+
+ Ignore x coordinate range error +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ rad
+ |
+
+
+
+ Radian coordinate +
+
+ TYPE:
+ |
+
Plot axis
+By default, simple black axis params(fc="none", ec="black", lw=0.5
) are set.
PARAMETER | +DESCRIPTION | +
---|---|
**kwargs |
+
+
+
+ Patch properties (e.g.
+
+ TYPE:
+ |
+
text(
+ text: str,
+ x: float | None = None,
+ r: float = 105,
+ *,
+ adjust_rotation: bool = True,
+ orientation: str = "horizontal",
+ ignore_range_error: bool = False,
+ **kwargs
+) -> None
+
Plot text
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
text |
+
+
+
+ Text content +
+
+ TYPE:
+ |
+
x |
+
+
+
+ X position. If None, sector center x is set. +
+
+ TYPE:
+ |
+
r |
+
+
+
+ Radius position. By default, outer position
+
+ TYPE:
+ |
+
adjust_rotation |
+
+
+
+ If True, text rotation is auto set based on
+
+ TYPE:
+ |
+
orientation |
+
+
+
+ Text orientation (
+
+ TYPE:
+ |
+
ignore_range_error |
+
+
+
+ If True, ignore x position range error
+(ErrorCase:
+
+ TYPE:
+ |
+
**kwargs |
+
+
+
+ Text properties (e.g.
+
+ TYPE:
+ |
+
line(
+ *,
+ r: float | tuple[float, float],
+ start: float | None = None,
+ end: float | None = None,
+ arc: bool = True,
+ **kwargs
+) -> None
+
Plot line
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
r |
+
+
+
+ Line radius position (0 - 100). If r is float, (r, r) is set. +
+
+ TYPE:
+ |
+
start |
+
+
+
+ Start position (x coordinate). If None,
+
+ TYPE:
+ |
+
end |
+
+
+
+ End position (x coordinate). If None,
+
+ TYPE:
+ |
+
arc |
+
+
+
+ If True, plot arc style line for polar projection. +If False, simply plot linear style line. +
+
+ TYPE:
+ |
+
**kwargs |
+
+
+
+ Patch properties (e.g.
+
+ TYPE:
+ |
+
rect(
+ start: float | None = None,
+ end: float | None = None,
+ r_lim: tuple[float, float] | None = None,
+ **kwargs
+) -> None
+
Plot rectangle
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
start |
+
+
+
+ Start position (x coordinate). If None,
+
+ TYPE:
+ |
+
end |
+
+
+
+ End position (x coordinate). If None,
+
+ TYPE:
+ |
+
r_lim |
+
+
+
+ Radius limit region. If None, (0, 100) is set. +
+
+ TYPE:
+ |
+
**kwargs |
+
+
+
+ Patch properties (e.g.
+
+ TYPE:
+ |
+
raster(
+ img: str | Path | Image.Image,
+ *,
+ size: float = 0.05,
+ x: float | None = None,
+ r: float = 105,
+ rotation: int | float | str | None = None,
+ border_width: int = 0,
+ label: str | None = None,
+ label_pos: str = "bottom",
+ label_margin: float = 0.1,
+ imshow_kws: dict[str, Any] | None = None,
+ text_kws: dict[str, Any] | None = None
+) -> None
+
Plot raster image
+This method is experimental. API may change in the future release.
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
img |
+
+
+
+ Image for plotting (
+
+ TYPE:
+ |
+
size |
+
+
+
+ Image size (ratio to overall figure size) +
+
+ TYPE:
+ |
+
x |
+
+
+
+ X position. If None, sector center x position is set. +
+
+ TYPE:
+ |
+
r |
+
+
+
+ Radius position +
+
+ TYPE:
+ |
+
rotation |
+
+
+
+ Image rotation setting.
+If
+
+ TYPE:
+ |
+
border_width |
+
+
+
+ Border width in pixel. By default, 0 is set (no border shown). +
+
+ TYPE:
+ |
+
label |
+
+
+
+ Image label. If None, no label shown. +
+
+ TYPE:
+ |
+
label_pos |
+
+
+
+ Label plot position (
+
+ TYPE:
+ |
+
label_margin |
+
+
+
+ Label margin +
+
+ TYPE:
+ |
+
imshow_kws |
+
+
+
+ Axes.imshow properties +https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.imshow.html +
+
+ TYPE:
+ |
+
text_kws |
+
+
+
+ Text properties (e.g.
+
+ TYPE:
+ |
+
Circos Track Class
+ + + + +PARAMETER | +DESCRIPTION | +
---|---|
name |
+
+
+
+ Track name +
+
+ TYPE:
+ |
+
r_lim |
+
+
+
+ Track radius limit region +
+
+ TYPE:
+ |
+
r_pad_ratio |
+
+
+
+ Track padding ratio for plot data +
+
+ TYPE:
+ |
+
parent_sector |
+
+
+
+ Parent sector of track +
+
+ TYPE:
+ |
+
property
+
+
+Track start position (x coordinate)
+property
+
+
+Track end position (x coordinate)
+property
+
+
+Track center position (x coordinate)
+property
+
+
+Track radius limit
+property
+
+
+Track radius size for plot data (r_size
with padding)
property
+
+
+Track radius limit for plot data (r_lim
with padding)
property
+
+
+Track radian limit
+property
+
+
+Track degree limit
+property
+
+
+Parent sector
+property
+
+
+Track coordinate direction
+property
+
+
+Plot functions
+Convert x coordinate to radian in track start-end range
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
x |
+
+
+
+ X coordinate +
+
+ TYPE:
+ |
+
ignore_range_error |
+
+
+
+ Ignore x coordinate range error +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ rad
+ |
+
+
+
+ Radian coordinate +
+
+ TYPE:
+ |
+
Plot axis
+By default, simple black axis params(fc="none", ec="black", lw=0.5
) are set.
PARAMETER | +DESCRIPTION | +
---|---|
**kwargs |
+
+
+
+ Patch properties (e.g.
+
+ TYPE:
+ |
+
text(
+ text: str,
+ x: float | None = None,
+ r: float | None = None,
+ *,
+ adjust_rotation: bool = True,
+ orientation: str = "horizontal",
+ ignore_range_error: bool = False,
+ **kwargs
+) -> None
+
Plot text
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
text |
+
+
+
+ Text content +
+
+ TYPE:
+ |
+
x |
+
+
+
+ X position. If None, track center x position is set. +
+
+ TYPE:
+ |
+
r |
+
+
+
+ Radius position. If None, track center radius position is set. +
+
+ TYPE:
+ |
+
adjust_rotation |
+
+
+
+ If True, text rotation is auto set based on
+
+ TYPE:
+ |
+
orientation |
+
+
+
+ Text orientation (
+
+ TYPE:
+ |
+
ignore_range_error |
+
+
+
+ If True, ignore x position range error
+(ErrorCase:
+
+ TYPE:
+ |
+
**kwargs |
+
+
+
+ Text properties (e.g.
+
+ TYPE:
+ |
+
rect(
+ start: float,
+ end: float,
+ *,
+ r_lim: tuple[float, float] | None = None,
+ ignore_pad: bool = False,
+ **kwargs
+) -> None
+
Plot rectangle
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
start |
+
+
+
+ Start position (x coordinate) +
+
+ TYPE:
+ |
+
end |
+
+
+
+ End position (x coordinate) +
+
+ TYPE:
+ |
+
r_lim |
+
+
+
+ Radius limit range.
+If None,
+
+ TYPE:
+ |
+
ignore_pad |
+
+
+
+ If True, ignore track padding setting.
+If
+
+ TYPE:
+ |
+
**kwargs |
+
+
+
+ Patch properties (e.g.
+
+ TYPE:
+ |
+
arrow(
+ start: float,
+ end: float,
+ *,
+ r_lim: tuple[float, float] | None = None,
+ head_length: float = 2,
+ shaft_ratio: float = 0.5,
+ **kwargs
+) -> None
+
Plot arrow
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
start |
+
+
+
+ Start position (x coordinate) +
+
+ TYPE:
+ |
+
end |
+
+
+
+ End position (x coordinate) +
+
+ TYPE:
+ |
+
r_lim |
+
+
+
+ Radius limit range. If None,
+
+ TYPE:
+ |
+
head_length |
+
+
+
+ Arrow head length (Degree unit) +
+
+ TYPE:
+ |
+
shaft_ratio |
+
+
+
+ Arrow shaft ratio (0 - 1.0) +
+
+ TYPE:
+ |
+
**kwargs |
+
+
+
+ Patch properties (e.g.
+
+ TYPE:
+ |
+
xticks(
+ x: list[int] | list[float] | np.ndarray,
+ labels: list[str] | None = None,
+ *,
+ tick_length: float = 2,
+ outer: bool = True,
+ show_bottom_line: bool = False,
+ label_size: float = 8,
+ label_margin: float = 0.5,
+ label_orientation: str = "horizontal",
+ line_kws: dict[str, Any] | None = None,
+ text_kws: dict[str, Any] | None = None
+) -> None
+
Plot xticks & labels on user-specified position
+If you want to plot xticks and their position labels at regular intervals,
+it is recommended to use track.xticks_by_interval()
instead.
PARAMETER | +DESCRIPTION | +
---|---|
x |
+
+
+
+ X coordinates +
+
+ TYPE:
+ |
+
labels |
+
+
+
+ Labels on xticks. If None, only plot ticks line. +
+
+ TYPE:
+ |
+
tick_length |
+
+
+
+ Tick length (Radius unit) +
+
+ TYPE:
+ |
+
outer |
+
+
+
+ If True, show ticks on outer. If False, show ticks on inner. +
+
+ TYPE:
+ |
+
show_bottom_line |
+
+
+
+ If True, show bottom line. +
+
+ TYPE:
+ |
+
label_size |
+
+
+
+ Label size +
+
+ TYPE:
+ |
+
label_margin |
+
+
+
+ Label margin size +
+
+ TYPE:
+ |
+
label_orientation |
+
+
+
+ Label orientation (
+
+ TYPE:
+ |
+
line_kws |
+
+
+
+ Patch properties (e.g.
+
+ TYPE:
+ |
+
text_kws |
+
+
+
+ Text properties (e.g.
+
+ TYPE:
+ |
+
xticks_by_interval(
+ interval: int | float,
+ *,
+ tick_length: float = 2,
+ outer: bool = True,
+ show_bottom_line: bool = False,
+ show_label: bool = True,
+ show_endlabel: bool = True,
+ label_size: float = 8,
+ label_margin: float = 0.5,
+ label_orientation: str = "horizontal",
+ label_formatter: Callable[[float], str] | None = None,
+ line_kws: dict[str, Any] | None = None,
+ text_kws: dict[str, Any] | None = None
+) -> None
+
Plot xticks & position labels by user-specified interval
+track.xticks_by_interval()
is high-level API function of track.xticks()
.
+If you want to plot xticks and their labels in any position you like,
+use track.xticks()
instead.
PARAMETER | +DESCRIPTION | +
---|---|
interval |
+
+
+
+ Xticks interval +
+
+ TYPE:
+ |
+
tick_length |
+
+
+
+ Tick length (Radius unit) +
+
+ TYPE:
+ |
+
outer |
+
+
+
+ If True, show ticks on outer. If False, show ticks on inner. +
+
+ TYPE:
+ |
+
show_bottom_line |
+
+
+
+ If True, show bottom line. +
+
+ TYPE:
+ |
+
show_label |
+
+
+
+ If True, show label of xticks interval position. +
+
+ TYPE:
+ |
+
show_endlabel |
+
+
+
+ If False, no display end xtick label. +Used to prevent overlap of start-end xtick labels. +
+
+ TYPE:
+ |
+
label_size |
+
+
+
+ Label size +
+
+ TYPE:
+ |
+
label_margin |
+
+
+
+ Label margin size +
+
+ TYPE:
+ |
+
label_orientation |
+
+
+
+ Label orientation (
+
+ TYPE:
+ |
+
label_formatter |
+
+
+
+ User-defined function for label format. (e.g.
+
+ TYPE:
+ |
+
line_kws |
+
+
+
+ Patch properties (e.g.
+
+ TYPE:
+ |
+
text_kws |
+
+
+
+ Text properties (e.g.
+
+ TYPE:
+ |
+
yticks(
+ y: list[int] | list[float] | np.ndarray,
+ labels: list[str] | None = None,
+ *,
+ vmin: float = 0,
+ vmax: float | None = None,
+ side: str = "right",
+ tick_length: float = 1,
+ label_size: float = 8,
+ label_margin: float = 0.5,
+ line_kws: dict[str, Any] | None = None,
+ text_kws: dict[str, Any] | None = None
+) -> None
+
Plot yticks & labels on user-specified position
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
y |
+
+
+
+ Y coordinates +
+
+ TYPE:
+ |
+
labels |
+
+
+
+ Labels on yticks. If None, only plot ticks line. +
+
+ TYPE:
+ |
+
vmin |
+
+
+
+ Y min value +
+
+ TYPE:
+ |
+
vmax |
+
+
+
+ Y max value. If None,
+
+ TYPE:
+ |
+
side |
+
+
+
+ Ticks side position (
+
+ TYPE:
+ |
+
tick_length |
+
+
+
+ Tick length (Degree unit) +
+
+ TYPE:
+ |
+
label_size |
+
+
+
+ Label size +
+
+ TYPE:
+ |
+
label_margin |
+
+
+
+ Label margin size +
+
+ TYPE:
+ |
+
line_kws |
+
+
+
+ Patch properties (e.g.
+
+ TYPE:
+ |
+
text_kws |
+
+
+
+ Text properties (e.g.
+
+ TYPE:
+ |
+
Plot grid
+By default, color="grey", alpha=0.5, zorder=0
line params are set.
PARAMETER | +DESCRIPTION | +
---|---|
y_grid_num |
+
+
+
+ Y-axis grid line number. If None, y-axis grid line is not shown. +
+
+ TYPE:
+ |
+
x_grid_interval |
+
+
+
+ X-axis grid line interval. If None, x-axis grid line is not shown. +
+
+ TYPE:
+ |
+
**kwargs |
+
+
+
+ Axes.plot properties (e.g.
+
+ TYPE:
+ |
+
line(
+ x: list[float] | np.ndarray,
+ y: list[float] | np.ndarray,
+ *,
+ vmin: float = 0,
+ vmax: float | None = None,
+ arc: bool = True,
+ **kwargs
+) -> None
+
Plot line
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
x |
+
+
+
+ X coordinates +
+
+ TYPE:
+ |
+
y |
+
+
+
+ Y coordinates +
+
+ TYPE:
+ |
+
vmin |
+
+
+
+ Y min value +
+
+ TYPE:
+ |
+
vmax |
+
+
+
+ Y max value. If None,
+
+ TYPE:
+ |
+
arc |
+
+
+
+ If True, plot arc style line for polar projection. +If False, simply plot linear style line. +
+
+ TYPE:
+ |
+
**kwargs |
+
+
+
+ Axes.plot properties (e.g.
+
+ TYPE:
+ |
+
scatter(
+ x: list[float] | np.ndarray,
+ y: list[float] | np.ndarray,
+ *,
+ vmin: float = 0,
+ vmax: float | None = None,
+ **kwargs
+) -> None
+
Plot scatter
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
x |
+
+
+
+ X position list +
+
+ TYPE:
+ |
+
y |
+
+
+
+ Y position list +
+
+ TYPE:
+ |
+
vmin |
+
+
+
+ Y min value +
+
+ TYPE:
+ |
+
vmax |
+
+
+
+ Y max value. If None,
+
+ TYPE:
+ |
+
**kwargs |
+
+
+
+ Axes.scatter properties (e.g.
+
+ TYPE:
+ |
+
bar(
+ x: list[float] | np.ndarray,
+ height: list[float] | np.ndarray,
+ width: float = 0.8,
+ bottom: float | list[float] | np.ndarray = 0,
+ align: str = "center",
+ *,
+ vmin: float = 0,
+ vmax: float | None = None,
+ **kwargs
+) -> None
+
Plot bar
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
x |
+
+
+
+ Bar x coordinates +
+
+ TYPE:
+ |
+
height |
+
+
+
+ Bar heights +
+
+ TYPE:
+ |
+
width |
+
+
+
+ Bar width +
+
+ TYPE:
+ |
+
bottom |
+
+
+
+ Bar bottom(s) +
+
+ TYPE:
+ |
+
align |
+
+
+
+ Bar alignment type (
+
+ TYPE:
+ |
+
vmin |
+
+
+
+ Y min value +
+
+ TYPE:
+ |
+
vmax |
+
+
+
+ Y max value. If None,
+
+ TYPE:
+ |
+
**kwargs |
+
+
+
+ Axes.bar properties (e.g.
+
+ TYPE:
+ |
+
stacked_bar(
+ table_data: str | Path | pd.DataFrame | StackedBarTable,
+ *,
+ delimiter: str = "\t",
+ width: float = 0.6,
+ cmap: str | dict[str, str] = "tab10",
+ vmax: float | None = None,
+ show_label: bool = True,
+ label_pos: str = "bottom",
+ label_margin: float = 2,
+ bar_kws: dict[str, Any] | None = None,
+ label_kws: dict[str, Any] | None = None
+) -> StackedBarTable
+
Plot stacked bar from table data
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
table_data |
+
+
+
+ Table file or Table DataFrame or StackedBarTable +
+
+ TYPE:
+ |
+
delimiter |
+
+
+
+ Table file delimiter +
+
+ TYPE:
+ |
+
width |
+
+
+
+ Bar width ratio (0.0 - 1.0) +
+
+ TYPE:
+ |
+
cmap |
+
+
+
+ Colormap assigned to each stacked bar.
+User can set matplotlib's colormap (e.g.
+
+ TYPE:
+ |
+
vmax |
+
+
+
+ Stacked bar max value. +If None, max value in each row values sum is set. +
+
+ TYPE:
+ |
+
show_label |
+
+
+
+ Show table row names as labels +
+
+ TYPE:
+ |
+
label_pos |
+
+
+
+ Label position (
+
+ TYPE:
+ |
+
label_margin |
+
+
+
+ Label margin size +
+
+ TYPE:
+ |
+
bar_kws |
+
+
+
+ Axes.bar properties (e.g.
+
+ TYPE:
+ |
+
label_kws |
+
+
+
+ Text properties (e.g.
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ sb_table
+ |
+
+
+
+ Stacked bar table +
+
+ TYPE:
+ |
+
stacked_barh(
+ table_data: str | Path | pd.DataFrame | StackedBarTable,
+ *,
+ delimiter: str = "\t",
+ width: float = 0.6,
+ cmap: str | dict[str, str] = "tab10",
+ bar_kws: dict[str, Any] | None = None
+) -> StackedBarTable
+
Plot horizontal stacked bar from table data
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
table_data |
+
+
+
+ Table file or Table DataFrame or StackedBarTable +
+
+ TYPE:
+ |
+
delimiter |
+
+
+
+ Table file delimiter +
+
+ TYPE:
+ |
+
width |
+
+
+
+ Bar width ratio (0.0 - 1.0) +
+
+ TYPE:
+ |
+
cmap |
+
+
+
+ Colormap assigned to each stacked bar.
+User can set matplotlib's colormap (e.g.
+
+ TYPE:
+ |
+
bar_kws |
+
+
+
+ Patch properties for bar plot (e.g.
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ sb_table
+ |
+
+
+
+ Stacked bar table +
+
+ TYPE:
+ |
+
fill_between(
+ x: list[float] | np.ndarray,
+ y1: list[float] | np.ndarray,
+ y2: float | list[float] | np.ndarray = 0,
+ *,
+ vmin: float = 0,
+ vmax: float | None = None,
+ **kwargs
+) -> None
+
Fill the area between two horizontal(y1, y2) curves
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
x |
+
+
+
+ X coordinates +
+
+ TYPE:
+ |
+
y1 |
+
+
+
+ Y coordinates (first curve definition) +
+
+ TYPE:
+ |
+
y2 |
+
+
+
+ Y coordinate[s] (second curve definition) +
+
+ TYPE:
+ |
+
vmin |
+
+
+
+ Y min value +
+
+ TYPE:
+ |
+
vmax |
+
+
+
+ Y max value. If None,
+
+ TYPE:
+ |
+
**kwargs |
+
+
+
+ Axes.fill_between properties (e.g.
+
+ TYPE:
+ |
+
heatmap(
+ data: list | np.ndarray,
+ *,
+ vmin: float | None = None,
+ vmax: float | None = None,
+ start: float | None = None,
+ end: float | None = None,
+ width: float | None = None,
+ cmap: str | Colormap = "bwr",
+ show_value: bool = False,
+ rect_kws: dict[str, Any] | None = None,
+ text_kws: dict[str, Any] | None = None
+) -> None
+
Plot heatmap
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
data |
+
+
+
+ Numerical list, numpy 1d or 2d array +
+
+ TYPE:
+ |
+
vmin |
+
+
+
+ Min value for heatmap plot. If None,
+
+ TYPE:
+ |
+
vmax |
+
+
+
+ Max value for heatmap plot. If None,
+
+ TYPE:
+ |
+
start |
+
+
+
+ Start position for heatmap plot (x coordinate).
+If None,
+
+ TYPE:
+ |
+
end |
+
+
+
+ End position for heatmap plot (x coordinate).
+If None,
+
+ TYPE:
+ |
+
width |
+
+
+
+ Heatmap rectangle x width size.
+Normally heatmap plots squares of equal width. In some cases,
+it is necessary to reduce the width of only the last column data square.
+At that time, width can be set under the following conditions.
+
+
+ TYPE:
+ |
+
cmap |
+
+
+
+ Colormap (e.g.
+
+ TYPE:
+ |
+
show_value |
+
+
+
+ If True, show data value on heatmap rectangle +
+
+ TYPE:
+ |
+
rect_kws |
+
+
+
+ Patch properties (e.g.
+
+ TYPE:
+ |
+
text_kws |
+
+
+
+ Text properties (e.g.
+
+ TYPE:
+ |
+
tree(
+ tree_data: str | Path | Tree,
+ *,
+ format: str = "newick",
+ outer: bool = True,
+ align_leaf_label: bool = True,
+ ignore_branch_length: bool = False,
+ leaf_label_size: float = 12,
+ leaf_label_rmargin: float = 2.0,
+ reverse: bool = False,
+ ladderize: bool = False,
+ line_kws: dict[str, Any] | None = None,
+ align_line_kws: dict[str, Any] | None = None
+) -> TreeViz
+
Plot tree
+It is recommended that the track(sector) size be the same as the number of
+leaf nodes in the tree, to make it easier to combine with bar
and heatmap
.
PARAMETER | +DESCRIPTION | +
---|---|
tree_data |
+
+
+
+ Tree data (
+
+ TYPE:
+ |
+
format |
+
+
+
+ Tree format (
+
+ TYPE:
+ |
+
outer |
+
+
+
+ If True, plot tree on outer side. If False, plot tree on inner side. +
+
+ TYPE:
+ |
+
align_leaf_label |
+
+
+
+ If True, align leaf label. +
+
+ TYPE:
+ |
+
ignore_branch_length |
+
+
+
+ If True, ignore branch length for plotting tree. +
+
+ TYPE:
+ |
+
leaf_label_size |
+
+
+
+ Leaf label size +
+
+ TYPE:
+ |
+
leaf_label_rmargin |
+
+
+
+ Leaf label radius margin +
+
+ TYPE:
+ |
+
reverse |
+
+
+
+ If True, reverse tree +
+
+ TYPE:
+ |
+
ladderize |
+
+
+
+ If True, ladderize tree +
+
+ TYPE:
+ |
+
line_kws |
+
+
+
+ Patch properties (e.g.
+
+ TYPE:
+ |
+
align_line_kws |
+
+
+
+ Patch properties (e.g.
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ tv
+ |
+
+
+
+ TreeViz instance +
+
+ TYPE:
+ |
+
genomic_features(
+ features: list[SeqFeature],
+ *,
+ plotstyle: str = "box",
+ r_lim: tuple[float, float] | None = None,
+ facecolor_handler: Callable[[SeqFeature], str] | None = None,
+ **kwargs
+) -> None
+
Plot genomic features
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
features |
+
+
+
+ Biopython's SeqFeature list +
+
+ TYPE:
+ |
+
plotstyle |
+
+
+
+ Plot style (
+
+ TYPE:
+ |
+
r_lim |
+
+
+
+ Radius limit range. If None,
+
+ TYPE:
+ |
+
facecolor_handler |
+
+
+
+ User-defined function to handle facecolor +
+
+ TYPE:
+ |
+
**kwargs |
+
+
+
+ Patch properties (e.g.
+
+ TYPE:
+ |
+
TreeViz(
+ tree_data: str | Path | Tree,
+ *,
+ format: str = "newick",
+ outer: bool = True,
+ align_leaf_label: bool = True,
+ ignore_branch_length: bool = False,
+ leaf_label_size: float = 12,
+ leaf_label_rmargin: float = 2.0,
+ reverse: bool = False,
+ ladderize: bool = False,
+ line_kws: dict[str, Any] | None = None,
+ align_line_kws: dict[str, Any] | None = None,
+ track: Track
+)
+
Phylogenetic Tree Visualization Class
+Interface for changing tree properties and adding tree annotations in a track
+ + + + +PARAMETER | +DESCRIPTION | +
---|---|
tree_data |
+
+
+
+ Tree data (
+
+ TYPE:
+ |
+
format |
+
+
+
+ Tree format (
+
+ TYPE:
+ |
+
outer |
+
+
+
+ If True, plot tree on outer side. If False, plot tree on inner side. +
+
+ TYPE:
+ |
+
align_leaf_label |
+
+
+
+ If True, align leaf label. +
+
+ TYPE:
+ |
+
ignore_branch_length |
+
+
+
+ If True, ignore branch length for plotting tree. +
+
+ TYPE:
+ |
+
leaf_label_size |
+
+
+
+ Leaf label size +
+
+ TYPE:
+ |
+
leaf_label_rmargin |
+
+
+
+ Leaf label radius margin +
+
+ TYPE:
+ |
+
reverse |
+
+
+
+ If True, reverse tree +
+
+ TYPE:
+ |
+
ladderize |
+
+
+
+ If True, ladderize tree +
+
+ TYPE:
+ |
+
line_kws |
+
+
+
+ Patch properties (e.g.
+
+ TYPE:
+ |
+
align_line_kws |
+
+
+
+ Patch properties (e.g.
+
+ TYPE:
+ |
+
track |
+
+
+
+ Track for tree visualization +
+
+ TYPE:
+ |
+
cached
+ property
+
+
+Leaf labels
+cached
+ property
+
+
+Internal node labels
+cached
+ property
+
+
+All node labels
+cached
+ property
+
+
+Max tree depth (root -> leaf max branch length)
+cached
+ property
+
+
+Tree node name & node xr coordinate dict
+cached
+ property
+
+
+Tree node name & rectangle dict
+staticmethod
+
+
+Load tree data
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
data |
+
+
+
+ Tree data +
+
+ TYPE:
+ |
+
format |
+
+
+
+ Tree format +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ tree
+ |
+
+
+
+ Tree object +
+
+ TYPE:
+ |
+
Search target node name from query
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
query |
+
+
+
+ Search query node name(s). If multiple node names are set, +MRCA(Most Recent Common Ancester) node is set. +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ target_node_name
+ |
+
+
+
+ Target node name +
+
+ TYPE:
+ |
+
Get target node x limit by query
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
query |
+
+
+
+ Search query node name(s) for getting x limit. +If multiple node names are set, +MRCA(Most Recent Common Ancester) node is set. +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ xlim
+ |
+
+
+
+ X limit tuple +
+
+ TYPE:
+ |
+
highlight(
+ query: str | list[str] | tuple[str], *, color: str, alpha: float = 0.5, **kwargs
+) -> None
+
Plot highlight for target node
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
query |
+
+
+
+ Search query node name(s) for highlight. If multiple node names are set, +MRCA(Most Recent Common Ancester) node is set. +
+
+ TYPE:
+ |
+
color |
+
+
+
+ Highlight color +
+
+ TYPE:
+ |
+
alpha |
+
+
+
+ Highlight color alpha(transparancy) value +
+
+ TYPE:
+ |
+
**kwargs |
+
+
+
+ Patch properties (e.g.
+
+ TYPE:
+ |
+
marker(
+ query: str | list[str] | tuple[str],
+ *,
+ marker: str = "o",
+ size: int = 6,
+ descendent: bool = True,
+ **kwargs
+) -> None
+
Plot marker on target node(s)
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
query |
+
+
+
+ Search query node name(s) for plotting marker. +If multiple node names are set, +MRCA(Most Recent Common Ancester) node is set. +
+
+ TYPE:
+ |
+
marker |
+
+
+
+ Marker type (e.g.
+
+ TYPE:
+ |
+
size |
+
+
+
+ Marker size +
+
+ TYPE:
+ |
+
descendent |
+
+
+
+ If True, plot markers on target node's descendent as well. +
+
+ TYPE:
+ |
+
**kwargs |
+
+
+
+ Axes.scatter properties (e.g.
+
+ TYPE:
+ |
+
Set tree node label properties
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
target_node_label |
+
+
+
+ Target node label name +
+
+ TYPE:
+ |
+
kwargs |
+
+
+
+ Text properties (e.g.
+
+ TYPE:
+ |
+
set_node_line_props(
+ query: str | list[str] | tuple[str],
+ *,
+ descendent: bool = True,
+ apply_label_color: bool = False,
+ **kwargs
+) -> None
+
Set tree node line properties
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
query |
+
+
+
+ Search query node name(s) for coloring tree node line. +If multiple node names are set, +MRCA(Most Recent Common Ancester) node is set. +
+
+ TYPE:
+ |
+
descendent |
+
+
+
+ If True, set properties on target node's descendent as well. +
+
+ TYPE:
+ |
+
apply_label_color |
+
+
+
+ If True &
+
+ TYPE:
+ |
+
**kwargs |
+
+
+
+ Patch properties (e.g.
+
+ TYPE:
+ |
+
load_prokaryote_example_file(
+ filename: str, cache_dir: str | Path | None = None, overwrite_cache: bool = False
+) -> Path
+
Load pycirclize example Genbank or GFF file
+Load example file from https://github.com/moshi4/pycirclize-data/
+and cache file in local directory (Default: ~/.cache/pycirclize/
).
List of example Genbank or GFF filename
+enterobacteria_phage.[gbk|gff]
mycoplasma_alvi.[gbk|gff]
escherichia_coli.[gbk|gff].gz
PARAMETER | +DESCRIPTION | +
---|---|
filename |
+
+
+
+ Genbank or GFF filename (e.g.
+
+ TYPE:
+ |
+
cache_dir |
+
+
+
+ Output cache directory (Default:
+
+ TYPE:
+ |
+
overwrite_cache |
+
+
+
+ If True, overwrite cache file. +Assumed to be used when cache file is corrupt. +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ file_path
+ |
+
+
+
+ Genbank or GFF file +
+
+ TYPE:
+ |
+
load_eukaryote_example_dataset(
+ name: str = "hg38",
+ cache_dir: str | Path | None = None,
+ overwrite_cache: bool = False,
+) -> tuple[Path, Path, list[ChrLink]]
+
Load pycirclize eukaryote example dataset
+Load example file from https://github.com/moshi4/pycirclize-data/
+and cache file in local directory (Default: ~/.cache/pycirclize/
).
List of dataset contents (download from UCSC)
+chr1 0 248956422
)chr1 0 2300000 p36.33 gneg
)chr1 1000 4321 chr3 8000 5600
)PARAMETER | +DESCRIPTION | +
---|---|
name |
+
+
+
+ Dataset name (
+
+ TYPE:
+ |
+
cache_dir |
+
+
+
+ Output cache directory (Default:
+
+ TYPE:
+ |
+
overwrite_cache |
+
+
+
+ If True, overwrite cache dataset. +Assumed to be used when cache dataset is corrupt. +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+
+ chr_bed_file, cytoband_file, chr_links : tuple[Path, Path, list[ChrLink]]
+
+ |
+
+
+
+ BED file, Cytoband file, Chromosome links + |
+
Load example phylogenetic tree file
+List of example tree filename
+small_example.nwk
(7 species)medium_example.nwk
(21 species)large_example.nwk
(190 species)alphabet.nwk
(26 species)PARAMETER | +DESCRIPTION | +
---|---|
filename |
+
+
+
+ Target filename +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ tree_file
+ |
+
+
+
+ Tree file (Newick format) +
+
+ TYPE:
+ |
+
Load example image file from local package data
+e.g. python_logo.png
PARAMETER | +DESCRIPTION | +
---|---|
filename |
+
+
+
+ Image file name +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ image_file_path
+ |
+
+
+
+ Image file path +
+
+ TYPE:
+ |
+
fetch_genbank_by_accid(
+ accid: str, gbk_outfile: str | Path | None = None, email: str | None = None
+) -> TextIOWrapper
+
Fetch genbank text by Accession ID
PARAMETER | +DESCRIPTION | +
---|---|
accid |
+
+
+
+ Accession ID +
+
+ TYPE:
+ |
+
gbk_outfile |
+
+
+
+ If file path is set, write fetch data to file +
+
+ TYPE:
+ |
+
email |
+
+
+
+ Email address to notify download limitation (Required for bulk download) +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+
+ TextIOWrapper
+
+ |
+
+
+
+ Genbank data + |
+
Examples:
+ + +calc_group_spaces(
+ groups: list[int],
+ *,
+ space_bw_group: float = 15,
+ space_in_group: float = 2,
+ endspace: bool = True
+) -> list[float]
+
Calculate spaces between/within groups
+This function can be used to easily calculate the space size
+when data is separated into multiple groups for display.
+For example, to set up a space to divide [A, B, C, D, E, F, G, H, I, J]
+into three groups such as [(A, B, C, D), (E, F, G), (H, I, J)]
,
+set groups=[4, 3, 3]
.
PARAMETER | +DESCRIPTION | +
---|---|
groups |
+
+
+
+ List of each group number (e.g.
+
+ TYPE:
+ |
+
space_bw_group |
+
+
+
+ Space size between group +
+
+ TYPE:
+ |
+
space_in_group |
+
+
+
+ Space size within group +
+
+ TYPE:
+ |
+
endspace |
+
+
+
+ If True, insert space after the end group +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ spaces
+ |
+
+
+
+ Spaces between/within groups +
+
+ TYPE:
+ |
+
Color Cycler Class
+ + + + +Get hexcolor cyclically from cmap by counter or user specified number
+ColorCycler()
works same as ColorCycler.get_color()
PARAMETER | +DESCRIPTION | +
---|---|
n |
+
+
+
+ Number for color cycle. If None, counter class variable is used. +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ hexcolor
+ |
+
+
+
+ Cyclic hexcolor string +
+
+ TYPE:
+ |
+
classmethod
+
+
+Reset cycle counter
+ +classmethod
+
+
+Set colormap (Default: tab10
)
classmethod
+
+
+Get hexcolor cyclically from cmap by counter or user specified number
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
n |
+
+
+
+ Number for color cycle. If None, counter class variable is used. +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ hexcolor
+ |
+
+
+
+ Cyclic hexcolor string +
+
+ TYPE:
+ |
+
classmethod
+
+
+Get hexcolor list of colormap
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
n |
+
+
+
+ If n is None, all(=cmap.N) hexcolors are extracted from colormap. +If n is specified, hexcolors are extracted from n equally divided colormap. +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ hexcolor_list
+ |
+
+
+
+ Hexcolor list +
+
+ TYPE:
+ |
+
{"use strict";/*!
+ * escape-html
+ * Copyright(c) 2012-2013 TJ Holowaychuk
+ * Copyright(c) 2015 Andreas Lubbe
+ * Copyright(c) 2015 Tiancheng "Timothy" Gu
+ * MIT Licensed
+ */var Ha=/["'&<>]/;Un.exports=$a;function $a(e){var t=""+e,r=Ha.exec(t);if(!r)return t;var o,n="",i=0,s=0;for(i=r.index;i