utils
utils
ColorCycler
Color Cycler Class
__new__
Get hexcolor cyclically from cmap by counter or user specified number
ColorCycler() works same as ColorCycler.get_color() (syntactic sugar)
| 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:
|
fetch_genbank_by_accid
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:
load_example_fasta_dataset
load_example_fasta_dataset(
name: GenbankDatasetName,
*,
cache_dir: str | Path | None = None,
overwrite_cache: bool = False
) -> list[Path]
Load pygenomeviz example fasta dataset
Load genbank datasets from https://github.com/moshi4/pygenomeviz-data-v1
and convert genbank to fasta format.
Cache datasets in local directory (Default: ~/.cache/pygenomeviz/).
List of dataset name
acinetobacter_phage(4 species)yersinia_phage(4 species)enterobacteria_phage(6 species)mycoplasma_mycoides(4 species)escherichia_coli(4 species, gzip compressed)saccharomyces(3 species, gzip compressed)
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Dataset name (e.g.
TYPE:
|
cache_dir
|
Output cache directory (Default:
TYPE:
|
overwrite_cache
|
If True, overwrite cached dataset
TYPE:
|
quiet
|
If True, no print log on screen.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
fasta_files
|
Fasta files
TYPE:
|
load_example_genbank_dataset
load_example_genbank_dataset(
name: GenbankDatasetName,
*,
cache_dir: str | Path | None = None,
overwrite_cache: bool = False
) -> list[Path]
Load pygenomeviz example genbank dataset
Load genbank datasets from https://github.com/moshi4/pygenomeviz-data-v1
and cache datasets in local directory (Default: ~/.cache/pygenomeviz/).
List of dataset name
acinetobacter_phage(4 species)yersinia_phage(4 species)enterobacteria_phage(6 species)mycoplasma_mycoides(4 species)escherichia_coli(4 species, gzip compressed)saccharomyces(3 species, gzip compressed)
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Dataset name (e.g.
TYPE:
|
cache_dir
|
Output cache directory (Default:
TYPE:
|
overwrite_cache
|
If True, overwrite cached dataset
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
gbk_files
|
Genbank files
TYPE:
|
load_example_gff_file
load_example_gff_file(
filename: GffExampleFileName,
*,
cache_dir: str | Path | None = None,
overwrite_cache: bool = False
) -> Path
Load pygenomeviz example GFF file
Load example GFF file from https://github.com/moshi4/pygenomeviz-data-v1/
and cache GFF file in local directory (Default: ~/.cache/pygenomeviz/).
List of example GFF filename
enterobacteria_phage.gffmycoplasma_mycoides.gffescherichia_coli.gff.gzsaccharomyces_cerevisiae.gff.gz
| PARAMETER | DESCRIPTION |
|---|---|
filename
|
GFF filename (e.g.
TYPE:
|
cache_dir
|
Output cache directory (Default:
TYPE:
|
overwrite_cache
|
If True, overwrite cached GFF file
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
gff_file
|
GFF file
TYPE:
|
extract_features_within_range
extract_features_within_range(
features: list[SeqFeature], *, target_range: tuple[int, int]
) -> list[SeqFeature]
Extract features by target range
| PARAMETER | DESCRIPTION |
|---|---|
features
|
Features to be extracted
TYPE:
|
target_range
|
Target range
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
range_features
|
Features within target range
TYPE:
|
interpolate_color
Interpolate the base color between vmin and vmax
vmin[nearly white] <= v <= vmax[base_color]
| PARAMETER | DESCRIPTION |
|---|---|
base_color
|
Base color for interpolation
TYPE:
|
v
|
Interpolation value
TYPE:
|
vmin
|
Min value
TYPE:
|
vmax
|
Max value
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
interpolate_color
|
Interpolated hexcolor
TYPE:
|
is_pseudo_feature
Check target feature is pseudo or not from qualifiers tag
| PARAMETER | DESCRIPTION |
|---|---|
feature
|
Target feature
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
check_result
|
pseudo check result
TYPE:
|