Utility Class
load_prokaryote_example_file
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
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)
- Chromosome BED file (e.g.
chr1 0 248956422) - Cytoband file (e.g.
chr1 0 2300000 p36.33 gneg) - Chromosome links (e.g.
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
|
BED file
TYPE:
|
cytoband_file
|
Cytoband file
TYPE:
|
chr_links
|
Chromosome links
TYPE:
|
load_example_tree_file
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
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
fetch_genbank_by_accid(
accid: str, gbk_outfile: str | Path | None = None, email: str | None = None
) -> StringIO
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 |
|---|---|
gbk_str_io
|
Genbank data
TYPE:
|
Examples:
calc_group_spaces
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:
|
ColorCycler
Color Cycler Class
__new__
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:
|
get_color
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:
|
get_color_list
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:
|