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..1782197 --- /dev/null +++ b/404.html @@ -0,0 +1,742 @@ + + + +
+ + + + + + + + + + + + + + + + + + +Genbank(
+ gbk_source: str | Path | TextIOWrapper | list[SeqRecord], *, name: str | None = None
+)
+
Genbank Parser Class
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
gbk_source |
+
+
+
+ Genbank file or source
+(
+
+ TYPE:
+ |
+
name |
+
+
+
+ name (If None,
+
+ TYPE:
+ |
+
property
+
+
+Genome sequence (only first record)
+property
+
+
+Genome length (only first record)
+property
+
+
+Full genome sequence (concatenate all records)
+property
+
+
+Full genome length (concatenate all records)
+Calculate genome GC content
+ + +PARAMETER | +DESCRIPTION | +
---|---|
seq |
+
+
+
+ Sequence for GC content calculation (Default:
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ gc_content
+ |
+
+
+
+ GC content +
+
+ TYPE:
+ |
+
calc_gc_skew(
+ window_size: int | None = None,
+ step_size: int | None = None,
+ *,
+ seq: str | None = None
+) -> tuple[NDArray[np.int64], NDArray[np.float64]]
+
Calculate GC skew in sliding window
+ + +PARAMETER | +DESCRIPTION | +
---|---|
window_size |
+
+
+
+ Window size (Default:
+
+ TYPE:
+ |
+
step_size |
+
+
+
+ Step size (Default:
+
+ TYPE:
+ |
+
seq |
+
+
+
+ Sequence for GCskew calculation (Default:
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ pos_list
+ |
+
+
+
+ Position list +
+
+ TYPE:
+ |
+
+ gc_skew_list
+ |
+
+
+
+ GC skew list +
+
+ TYPE:
+ |
+
calc_gc_content(
+ window_size: int | None = None,
+ step_size: int | None = None,
+ *,
+ seq: str | None = None
+) -> tuple[NDArray[np.int64], NDArray[np.float64]]
+
Calculate GC content in sliding window
+ + +PARAMETER | +DESCRIPTION | +
---|---|
window_size |
+
+
+
+ Window size (Default:
+
+ TYPE:
+ |
+
step_size |
+
+
+
+ Step size (Default:
+
+ TYPE:
+ |
+
seq |
+
+
+
+ Sequence for GC content calculation (Default:
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ pos_list
+ |
+
+
+
+ Position list +
+
+ TYPE:
+ |
+
+ gc_content_list
+ |
+
+
+
+ GC content list +
+
+ TYPE:
+ |
+
Get seqid & complete/contig/scaffold genome sequence dict
+ + +RETURNS | +DESCRIPTION | +
---|---|
+ seqid2seq
+ |
+
+
+
+ seqid & genome sequence dict +
+
+ TYPE:
+ |
+
Get seqid & complete/contig/scaffold genome size dict
+ + +RETURNS | +DESCRIPTION | +
---|---|
+ seqid2size
+ |
+
+
+
+ seqid & genome size dict +
+
+ TYPE:
+ |
+
get_seqid2features(
+ feature_type: str | list[str] | None = "CDS", target_strand: int | None = None
+) -> dict[str, list[SeqFeature]]
+
Get seqid & features in target seqid genome dict
+ + +PARAMETER | +DESCRIPTION | +
---|---|
feature_type |
+
+
+
+ Feature type (
+
+ TYPE:
+ |
+
target_strand |
+
+
+
+ Extract target strand. If None, extract regardless of strand. +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ seqid2features
+ |
+
+
+
+ seqid & features dict +
+
+ TYPE:
+ |
+
extract_features(
+ feature_type: str | list[str] | None = "CDS",
+ *,
+ target_strand: int | None = None,
+ target_range: tuple[int, int] | None = None
+) -> list[SeqFeature]
+
Extract features (only first record)
+ + +PARAMETER | +DESCRIPTION | +
---|---|
feature_type |
+
+
+
+ Feature type (
+
+ TYPE:
+ |
+
target_strand |
+
+
+
+ Extract target strand. If None, extract regardless of strand. +
+
+ TYPE:
+ |
+
target_range |
+
+
+
+ Extract target range. If None, extract regardless of range. +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ features
+ |
+
+
+
+ Extracted features +
+
+ TYPE:
+ |
+
Write CDS fasta file
+ + +PARAMETER | +DESCRIPTION | +
---|---|
outfile |
+
+
+
+ Output CDS fasta file +
+
+ TYPE:
+ |
+
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,
+ 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:
+ |
+
show_axis |
+
+
+
+ Show axis for debug purpose +
+
+ TYPE:
+ |
+
property
+
+
+Figure size (Width, Height)
+property
+
+
+Feature tracks
+property
+
+
+Link tracks
+Get tracks
+ + +PARAMETER | +DESCRIPTION | +
---|---|
subtrack |
+
+
+
+ If True, include subtracks in FeatureTrack +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ tracks
+ |
+
+
+
+ Tracks [
+
+ TYPE:
+ |
+
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(
+ 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(
+ *,
+ 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(
+ *,
+ 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(
+ 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:
+ |
+
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:
+ |
+
Save figure to file
+ + +PARAMETER | +DESCRIPTION | +
---|---|
savefile |
+
+
+
+ Save file +
+
+ TYPE:
+ |
+
dpi |
+
+
+
+ DPI +
+
+ TYPE:
+ |
+
pad_inches |
+
+
+
+ Padding inches +
+
+ TYPE:
+ |
+
To plot a figure that settings a user-defined legend, subtracks, or annotations,
+call fig.savefig()
instead of gv.savefig()
.
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:
+ |
+
GFF Parser Class
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
gff_file |
+
+
+
+ GFF file (
+
+ TYPE:
+ |
+
name |
+
+
+
+ name (If None,
+
+ TYPE:
+ |
+
target_seqid |
+
+
+
+ Target seqid to be extracted. If None, only first seqid record is extracted. +
+
+ TYPE:
+ |
+
property
+
+
+GFF sequence-region start & end tuple
+If ##sequence-region
pragma is not found, seq_region=(0, max_coords_value)
property
+
+
+GFF records (only target seqid)
+property
+
+
+All GFF records
+property
+
+
+Genome length (target seqid record)
+property
+
+
+Full genome length (concatenate all records)
+Get seqid & complete/contig/scaffold genome size dict
+By default, size is defined by ##sequence-region
pragma of target seqid.
+If ##sequence-region
is not found, size is defined by max coordinate size in
+target seqid features. This may differ from actual genome size.
RETURNS | +DESCRIPTION | +
---|---|
+ seqid2size
+ |
+
+
+
+ seqid & genome size dict +
+
+ TYPE:
+ |
+
get_seqid2features(
+ feature_type: str | list[str] | None = "CDS", target_strand: int | None = None
+) -> dict[str, list[SeqFeature]]
+
Get seqid & features in target seqid genome dict
+ + +PARAMETER | +DESCRIPTION | +
---|---|
feature_type |
+
+
+
+ Feature type (
+
+ TYPE:
+ |
+
target_strand |
+
+
+
+ Extract target strand. If None, extract regardless of strand. +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ seqid2features
+ |
+
+
+
+ seqid & features dict +
+
+ TYPE:
+ |
+
extract_features(
+ feature_type: str | list[str] | None = "CDS",
+ *,
+ target_strand: int | None = None,
+ target_range: tuple[int, int] | None = None
+) -> list[SeqFeature]
+
Extract features
+If target_seqid
is specified when the Gff instance initialized,
+then the features of the target seqid are extracted.
+Otherwise, extract the features of the seqid in the first row.
PARAMETER | +DESCRIPTION | +
---|---|
feature_type |
+
+
+
+ Feature type (
+
+ TYPE:
+ |
+
target_strand |
+
+
+
+ Extract target strand. If None, extract regardless of strand. +
+
+ TYPE:
+ |
+
target_range |
+
+
+
+ Extract target range. If None, extract regardless of range. +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ features
+ |
+
+
+
+ Feature list +
+
+ TYPE:
+ |
+
extract_exon_features(
+ feature_type: str = "mRNA",
+ *,
+ target_strand: int | None = None,
+ target_range: tuple[int, int] | None = None
+) -> list[SeqFeature]
+
Extract exon structure features
+Extract exons based on parent feature
and exon
ID-Parent relation
PARAMETER | +DESCRIPTION | +
---|---|
feature_type |
+
+
+
+ Feature type (e.g.
+
+ TYPE:
+ |
+
target_strand |
+
+
+
+ Extract target strand. If None, extract regardless of strand. +
+
+ TYPE:
+ |
+
target_range |
+
+
+
+ Extract target range. If None, extract regardless of range. +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ features
+ |
+
+
+
+ Feature list +
+
+ TYPE:
+ |
+
Feature Segment Class
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
name |
+
+
+
+ Segment name +
+
+ TYPE:
+ |
+
start |
+
+
+
+ Segment start position +
+
+ TYPE:
+ |
+
end |
+
+
+
+ Segment end position +
+
+ TYPE:
+ |
+
feature_track |
+
+
+
+ Parent feature track +
+
+ TYPE:
+ |
+
property
+
+
+Segment (start, end) range
+property
+
+
+Parent feature track
+property
+
+
+Segment start position in track
+property
+
+
+Segment end position in track
+property
+
+
+gid & feature dict (Sort by start coordinate)
+property
+
+
+Coordinate transformed features
+Segment-level coordinate is transformed to track-level coordinate.
+property
+
+
+Coordinate transformed exon features
+Segment-level coordinate is transformed to track-level coordinate.
+property
+
+
+Coordinate transformed text keywords list
+Check target pos is within segment range
+ +Transform segment-level coordinate to track-level coordinate
+ + +PARAMETER | +DESCRIPTION | +
---|---|
x |
+
+
+
+ Segment level coordinate(s) +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ track_coord
+ |
+
+
+
+ Track level coordinate(s) +
+
+ TYPE:
+ |
+
add_text(
+ x: float,
+ text: str,
+ *,
+ size: float = 12,
+ vpos: VPos = "top",
+ hpos: HPos = "left",
+ ymargin: float = 0.2,
+ rotation: float = 45,
+ **kwargs
+) -> None
+
Add text
+ + +PARAMETER | +DESCRIPTION | +
---|---|
x |
+
+
+
+ Text x coordinate +
+
+ TYPE:
+ |
+
text |
+
+
+
+ Text content +
+
+ TYPE:
+ |
+
size |
+
+
+
+ Text size +
+
+ TYPE:
+ |
+
vpos |
+
+
+
+ Vertical position (
+
+ TYPE:
+ |
+
hpos |
+
+
+
+ Horizontal position (
+
+ TYPE:
+ |
+
ymargin |
+
+
+
+ Y margin +
+
+ TYPE:
+ |
+
rotation |
+
+
+
+ Text rotation +
+
+ TYPE:
+ |
+
**kwargs |
+
+
+
+ Text properties (e.g.
+
+ TYPE:
+ |
+
add_sublabel(
+ text: str | None = None,
+ *,
+ size: float = 12,
+ pos: str = "bottom-left",
+ ymargin: float = 0.2,
+ rotation: float = 0,
+ **kwargs
+) -> None
+
Add sublabel
+ + +PARAMETER | +DESCRIPTION | +
---|---|
text |
+
+
+
+ Text content. If None,
+
+ TYPE:
+ |
+
size |
+
+
+
+ Text size +
+
+ TYPE:
+ |
+
pos |
+
+
+
+ Label position ([
+
+ TYPE:
+ |
+
ymargin |
+
+
+
+ Y margin +
+
+ TYPE:
+ |
+
rotation |
+
+
+
+ Text rotation +
+
+ TYPE:
+ |
+
**kwargs |
+
+
+
+
+
+ TYPE:
+ |
+
add_feature(
+ start: int,
+ end: int,
+ strand: int = 1,
+ *,
+ plotstyle: PlotStyle = "arrow",
+ arrow_shaft_ratio: float = 0.5,
+ label: str = "",
+ text_kws: dict[str, Any] | None = None,
+ **kwargs
+) -> None
+
Add feature
+ + +PARAMETER | +DESCRIPTION | +
---|---|
start |
+
+
+
+ Start position +
+
+ TYPE:
+ |
+
end |
+
+
+
+ End position +
+
+ TYPE:
+ |
+
strand |
+
+
+
+ Feature strand +
+
+ TYPE:
+ |
+
plotstyle |
+
+
+
+ Feature plot style (
+
+ TYPE:
+ |
+
arrow_shaft_ratio |
+
+
+
+ Arrow shaft size ratio +
+
+ TYPE:
+ |
+
label |
+
+
+
+ Feature label text +
+
+ TYPE:
+ |
+
text_kws |
+
+
+
+
+
+ TYPE:
+ |
+
**kwargs |
+
+
+
+ Patch properties (e.g.
+
+ TYPE:
+ |
+
add_features(
+ features: SeqFeature | list[SeqFeature],
+ *,
+ plotstyle: PlotStyle = "arrow",
+ arrow_shaft_ratio: float = 0.5,
+ label_type: str | None = None,
+ label_handler: Callable[[str], str] | None = None,
+ extra_tooltip: dict[str, str] | None = None,
+ ignore_outside_range: bool = False,
+ text_kws: dict[str, Any] | None = None,
+ **kwargs
+) -> None
+
Add features (BioPython SeqFeature)
+ + +PARAMETER | +DESCRIPTION | +
---|---|
features |
+
+
+
+ BioPython SeqFeature or SeqFeature list +
+
+ TYPE:
+ |
+
plotstyle |
+
+
+
+ Feature plot style (
+
+ TYPE:
+ |
+
arrow_shaft_ratio |
+
+
+
+ Arrow shaft size ratio +
+
+ TYPE:
+ |
+
label_type |
+
+
+
+ Label type (e.g.
+
+ TYPE:
+ |
+
label_handler |
+
+
+
+ Label handler function to customize label display.
+If None, set label handler to exclude labels containing
+
+ TYPE:
+ |
+
extra_tooltip |
+
+
+
+ Extra tooltip dict for html figure +
+
+ TYPE:
+ |
+
ignore_outside_range |
+
+
+
+ If True and the feature position is outside the range of the track segment, +ignore it without raising an error. +
+
+ TYPE:
+ |
+
text_kws |
+
+
+
+
+
+ TYPE:
+ |
+
**kwargs |
+
+
+
+ Patch properties (e.g.
+
+ TYPE:
+ |
+
add_exon_feature(
+ locs: list[tuple[int, int]],
+ strand: int = 1,
+ *,
+ plotstyle: PlotStyle = "arrow",
+ arrow_shaft_ratio: float = 0.5,
+ label: str = "",
+ patch_kws: dict[str, Any] | None = None,
+ intron_patch_kws: dict[str, Any] | None = None,
+ text_kws: dict[str, Any] | None = None
+) -> None
+
Add exon feature
+ + +PARAMETER | +DESCRIPTION | +
---|---|
locs |
+
+
+
+ Exon locations (e.g.
+
+ TYPE:
+ |
+
strand |
+
+
+
+ Feature strand +
+
+ TYPE:
+ |
+
plotstyle |
+
+
+
+ Feature plot style (
+
+ TYPE:
+ |
+
arrow_shaft_ratio |
+
+
+
+ Arrow shaft size ratio +
+
+ TYPE:
+ |
+
label |
+
+
+
+ Feature label +
+
+ TYPE:
+ |
+
patch_kws |
+
+
+
+ Exon patch properties (e.g.
+
+ TYPE:
+ |
+
intron_patch_kws |
+
+
+
+ Intron patch properties (e.g.
+
+ TYPE:
+ |
+
text_kws |
+
+
+
+
+
+ TYPE:
+ |
+
add_exon_features(
+ features: SeqFeature | list[SeqFeature],
+ *,
+ plotstyle: PlotStyle = "arrow",
+ arrow_shaft_ratio: float = 0.5,
+ label_type: str | None = None,
+ label_handler: Callable[[str], str] | None = None,
+ extra_tooltip: dict[str, str] | None = None,
+ ignore_outside_range: bool = False,
+ patch_kws: dict[str, Any] | None = None,
+ intron_patch_kws: dict[str, Any] | None = None,
+ text_kws: dict[str, Any] | None = None
+) -> None
+
Add exon features (BioPython SeqFeature)
+ + +PARAMETER | +DESCRIPTION | +
---|---|
features |
+
+
+
+ BioPython SeqFeature or SeqFeature list +
+
+ TYPE:
+ |
+
plotstyle |
+
+
+
+ Feature plot style (
+
+ TYPE:
+ |
+
arrow_shaft_ratio |
+
+
+
+ Arrow shaft size ratio +
+
+ TYPE:
+ |
+
label_type |
+
+
+
+ Label type (e.g.
+
+ TYPE:
+ |
+
label_handler |
+
+
+
+ Label handler function to customize label display.
+If None, set label handler to exclude labels containing
+
+ TYPE:
+ |
+
extra_tooltip |
+
+
+
+ Extra tooltip dict for html figure +
+
+ TYPE:
+ |
+
ignore_outside_range |
+
+
+
+ If True and the feature position is outside the range of the track segment, +ignore it without raising an error. +
+
+ TYPE:
+ |
+
patch_kws |
+
+
+
+ Exon patch properties (e.g.
+
+ TYPE:
+ |
+
intron_patch_kws |
+
+
+
+ Intron patch properties (e.g.
+
+ TYPE:
+ |
+
text_kws |
+
+
+
+
+
+ TYPE:
+ |
+
FeatureTrack(
+ name: str,
+ seg_name2range: Mapping[str, tuple[int, int]],
+ *,
+ ratio: float = 1.0,
+ space: float | list[float] = 0.01,
+ offset: int | TrackAlignType = "left",
+ 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
+)
+
+ Bases: Track
Feature Track Class
+ + + +PARAMETER | +DESCRIPTION | +
---|---|
name |
+
+
+
+ Track name +
+
+ TYPE:
+ |
+
seg_name2range |
+
+
+
+ Segment name & range dict +
+
+ TYPE:
+ |
+
ratio |
+
+
+
+ Track size ratio +
+
+ TYPE:
+ |
+
space |
+
+
+
+ Space ratio between segments +
+
+ 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:
+ |
+
property
+
+
+Track label (By default, track.label
= track.name
)
property
+
+
+Subtracks
+property
+
+
+Total segment size
+property
+
+
+Max track total segment size (Use space calculation)
+property
+
+
+Plot x size (total_seg_size
+ sum(spaces)
)
Set max track total segment size
+This method is expected to be called within the GenomeViz instance +to update track status. General users should not use this method.
+ + +PARAMETER | +DESCRIPTION | +
---|---|
max_track_total_seg_size |
+
+
+
+ Max track total segment size +
+
+ TYPE:
+ |
+
Set track label (By default, track.label
= track.name
)
PARAMETER | +DESCRIPTION | +
---|---|
label |
+
+
+
+ Track label +
+
+ TYPE:
+ |
+
set_segment_sep(
+ sep: bool | list[bool] = True,
+ *,
+ symbol: str = "//",
+ size: float = 20,
+ color: str = "grey",
+ **kwargs
+) -> None
+
Set segment separator symbol text
+ + +PARAMETER | +DESCRIPTION | +
---|---|
sep |
+
+
+
+ If True, insert separator text between all segments. +If list[bool], insert separator text between segments where True. +
+
+ TYPE:
+ |
+
symbol |
+
+
+
+ Separator symbol text +
+
+ TYPE:
+ |
+
size |
+
+
+
+ Separator symbol size +
+
+ TYPE:
+ |
+
color |
+
+
+
+ Separator symbol color +
+
+ TYPE:
+ |
+
**kwargs |
+
+
+
+ Text properties +https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html +
+
+ TYPE:
+ |
+
add_subtrack(
+ name: str | None = None, *, ratio: float = 1.0, ylim: tuple[int, int] = (0, 100)
+) -> FeatureSubTrack
+
Add subtrack for user-defined plot axes
+ + +PARAMETER | +DESCRIPTION | +
---|---|
name |
+
+
+
+ Track name +
+
+ TYPE:
+ |
+
ratio |
+
+
+
+ Subtrack size ratio to feature track +
+
+ TYPE:
+ |
+
ylim |
+
+
+
+ Axes ylim +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ subtrack
+ |
+
+
+
+ Subtrack +
+
+ TYPE:
+ |
+
Get subtrack by name
+If no subtrack found, raise error.
+ + +PARAMETER | +DESCRIPTION | +
---|---|
name |
+
+
+
+ Target subtrack name. If None, first subtrack is returned. +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ subtrack
+ |
+
+
+
+ Target subtrack +
+
+ TYPE:
+ |
+
Get segment by name
+ + +PARAMETER | +DESCRIPTION | +
---|---|
name |
+
+
+
+ Target segment name. If None, first segment is returned. +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ segment
+ |
+
+
+
+ Target segment +
+
+ TYPE:
+ |
+
add_text(
+ x: float,
+ text: str,
+ *,
+ target_seg: str | None = None,
+ size: float = 15,
+ vpos: VPos = "top",
+ hpos: HPos = "left",
+ ymargin: float = 0.2,
+ rotation: float = 45,
+ **kwargs
+) -> None
+
Add text to track segment
+ + +PARAMETER | +DESCRIPTION | +
---|---|
x |
+
+
+
+ Text x coordinate +
+
+ TYPE:
+ |
+
text |
+
+
+
+ Text content +
+
+ TYPE:
+ |
+
target_seg |
+
+
+
+ Target segment name. If None, first segment is selected. +
+
+ TYPE:
+ |
+
size |
+
+
+
+ Text size +
+
+ TYPE:
+ |
+
vpos |
+
+
+
+ Vertical position (
+
+ TYPE:
+ |
+
hpos |
+
+
+
+ Horizontal position (
+
+ TYPE:
+ |
+
ymargin |
+
+
+
+ Y margin +
+
+ TYPE:
+ |
+
rotation |
+
+
+
+ Text rotation +
+
+ TYPE:
+ |
+
**kwargs |
+
+
+
+
+
+ TYPE:
+ |
+
add_sublabel(
+ text: str | None = None,
+ *,
+ target_seg: str | None = None,
+ size: float = 12,
+ pos: str = "bottom-left",
+ ymargin: float = 0.2,
+ rotation: float = 0,
+ **kwargs
+) -> None
+
Add sublabel to corners of the track segment
+ + +PARAMETER | +DESCRIPTION | +
---|---|
text |
+
+
+
+ Text content +
+
+ TYPE:
+ |
+
target_seg |
+
+
+
+ Target segment name. If None, first segment is selected. +
+
+ TYPE:
+ |
+
size |
+
+
+
+ Text size +
+
+ TYPE:
+ |
+
pos |
+
+
+
+ Label position ([
+
+ TYPE:
+ |
+
ymargin |
+
+
+
+ Y margin +
+
+ TYPE:
+ |
+
rotation |
+
+
+
+ Text rotation +
+
+ TYPE:
+ |
+
**kwargs |
+
+
+
+
+
+ TYPE:
+ |
+
add_feature(
+ start: int,
+ end: int,
+ strand: int = 1,
+ *,
+ target_seg: str | None = None,
+ plotstyle: PlotStyle = "arrow",
+ arrow_shaft_ratio: float = 0.5,
+ label: str = "",
+ text_kws: dict[str, Any] | None = None,
+ **kwargs
+) -> None
+
Add feature
+ + +PARAMETER | +DESCRIPTION | +
---|---|
start |
+
+
+
+ Start position +
+
+ TYPE:
+ |
+
end |
+
+
+
+ End position +
+
+ TYPE:
+ |
+
strand |
+
+
+
+ Feature strand +
+
+ TYPE:
+ |
+
target_seg |
+
+
+
+ Target segment name. If None, first segment is selected. +
+
+ TYPE:
+ |
+
plotstyle |
+
+
+
+ Feature plot style (
+
+ TYPE:
+ |
+
arrow_shaft_ratio |
+
+
+
+ Arrow shaft size ratio +
+
+ TYPE:
+ |
+
label |
+
+
+
+ Feature label +
+
+ TYPE:
+ |
+
text_kws |
+
+
+
+
+
+ TYPE:
+ |
+
**kwargs |
+
+
+
+ Patch properties (e.g.
+
+ TYPE:
+ |
+
add_features(
+ features: SeqFeature | list[SeqFeature],
+ *,
+ target_seg: str | None = None,
+ plotstyle: PlotStyle = "arrow",
+ arrow_shaft_ratio: float = 0.5,
+ label_type: str | None = None,
+ label_handler: Callable[[str], str] | None = None,
+ extra_tooltip: dict[str, str] | None = None,
+ ignore_outside_range: bool = False,
+ text_kws: dict[str, Any] | None = None,
+ **kwargs
+) -> None
+
Add features (BioPython SeqFeature)
+ + +PARAMETER | +DESCRIPTION | +
---|---|
features |
+
+
+
+ BioPython SeqFeature or SeqFeature list +
+
+ TYPE:
+ |
+
target_seg |
+
+
+
+ Target segment name. If None, first segment is selected. +
+
+ TYPE:
+ |
+
plotstyle |
+
+
+
+ Feature plot style (
+
+ TYPE:
+ |
+
arrow_shaft_ratio |
+
+
+
+ Arrow shaft size ratio +
+
+ TYPE:
+ |
+
label_type |
+
+
+
+ Label type (e.g.
+
+ TYPE:
+ |
+
label_handler |
+
+
+
+ Label handler function to customize label display.
+If None, set label handler to exclude labels containing
+
+ TYPE:
+ |
+
extra_tooltip |
+
+
+
+ Extra tooltip dict for html figure +
+
+ TYPE:
+ |
+
ignore_outside_range |
+
+
+
+ If True and the feature position is outside the range of the track segment, +ignore it without raising an error. +
+
+ TYPE:
+ |
+
text_kws |
+
+
+
+
+
+ TYPE:
+ |
+
**kwargs |
+
+
+
+ Patch properties (e.g.
+
+ TYPE:
+ |
+
add_exon_feature(
+ locs: list[tuple[int, int]],
+ strand: int = 1,
+ *,
+ target_seg: str | None = None,
+ plotstyle: PlotStyle = "arrow",
+ arrow_shaft_ratio: float = 0.5,
+ label: str = "",
+ patch_kws: dict[str, Any] | None = None,
+ intron_patch_kws: dict[str, Any] | None = None,
+ text_kws: dict[str, Any] | None = None
+) -> None
+
Add exon feature
+ + +PARAMETER | +DESCRIPTION | +
---|---|
locs |
+
+
+
+ Exon locations (e.g.
+
+ TYPE:
+ |
+
strand |
+
+
+
+ Feature strand +
+
+ TYPE:
+ |
+
target_seg |
+
+
+
+ Target segment name. If None, first segment is selected. +
+
+ TYPE:
+ |
+
plotstyle |
+
+
+
+ Feature plot style (
+
+ TYPE:
+ |
+
arrow_shaft_ratio |
+
+
+
+ Arrow shaft size ratio +
+
+ TYPE:
+ |
+
label |
+
+
+
+ Feature label +
+
+ TYPE:
+ |
+
patch_kws |
+
+
+
+ Exon patch properties (e.g.
+
+ TYPE:
+ |
+
intron_patch_kws |
+
+
+
+ Intron patch properties (e.g.
+
+ TYPE:
+ |
+
text_kws |
+
+
+
+
+
+ TYPE:
+ |
+
add_exon_features(
+ features: SeqFeature | list[SeqFeature],
+ *,
+ target_seg: str | None = None,
+ plotstyle: PlotStyle = "arrow",
+ arrow_shaft_ratio: float = 0.5,
+ label_type: str | None = None,
+ label_handler: Callable[[str], str] | None = None,
+ extra_tooltip: dict[str, str] | None = None,
+ ignore_outside_range: bool = False,
+ patch_kws: dict[str, Any] | None = None,
+ intron_patch_kws: dict[str, Any] | None = None,
+ text_kws: dict[str, Any] | None = None
+) -> None
+
Add exon features
+ + +PARAMETER | +DESCRIPTION | +
---|---|
features |
+
+
+
+ BioPython SeqFeature or SeqFeature list +
+
+ TYPE:
+ |
+
target_seg |
+
+
+
+ Target segment name. If None, first segment is selected. +
+
+ TYPE:
+ |
+
plotstyle |
+
+
+
+ Feature plot style (
+
+ TYPE:
+ |
+
arrow_shaft_ratio |
+
+
+
+ Arrow shaft size ratio +
+
+ TYPE:
+ |
+
label_type |
+
+
+
+ Label type (e.g.
+
+ TYPE:
+ |
+
label_handler |
+
+
+
+ Label handler function to customize label display.
+If None, set label handler to exclude labels containing
+
+ TYPE:
+ |
+
extra_tooltip |
+
+
+
+ Extra tooltip dict for html figure +
+
+ TYPE:
+ |
+
ignore_outside_range |
+
+
+
+ If True and the feature position is outside the range of the track segment, +ignore it without raising an error. +
+
+ TYPE:
+ |
+
patch_kws |
+
+
+
+ Exon patch properties (e.g.
+
+ TYPE:
+ |
+
intron_patch_kws |
+
+
+
+ Intron patch properties (e.g.
+
+ TYPE:
+ |
+
text_kws |
+
+
+
+
+
+ TYPE:
+ |
+
transform_coord(
+ x: int | float | NDArray, *, target_seg: str | None = None
+) -> int | float | NDArray[np.float64]
+
Transform segment-level coordinate to track-level coordinate
+ + +PARAMETER | +DESCRIPTION | +
---|---|
x |
+
+
+
+ Segment-level coordinate(s) +
+
+ TYPE:
+ |
+
target_seg |
+
+
+
+ Target segment name. If None, first segment is selected. +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ transform_x
+ |
+
+
+
+ Track-level coordinate(s) +
+
+ TYPE:
+ |
+
Plot all objects (Expected to be called in gv.plotfig()
)
PARAMETER | +DESCRIPTION | +
---|---|
fast_render |
+
+
+
+ Enable fast rendering using PatchCollection plot style. +
+
+ TYPE:
+ |
+
Color Cycler Class
+ + + + +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:
+ |
+
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:
+ |
+
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_genbank_dataset(
+ name: GenbankDatasetName,
+ *,
+ cache_dir: str | Path | None = None,
+ overwrite_cache: bool = False,
+ quiet: bool = True
+) -> 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:
+ |
+
quiet |
+
+
+
+ If True, no print log on screen. +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ gbk_files
+ |
+
+
+
+ Genbank files +
+
+ TYPE:
+ |
+
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.gff
mycoplasma_mycoides.gff
escherichia_coli.gff.gz
saccharomyces_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(
+ 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 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:
+ |
+
Check target feature is pseudo or not from qualifiers tag
+ + +PARAMETER | +DESCRIPTION | +
---|---|
feature |
+
+
+
+ Target feature +
+
+ TYPE:
+ |
+
RETURNS | +DESCRIPTION | +
---|---|
+ check_result
+ |
+
+
+
+ pseudo check result +
+
+ TYPE:
+ |
+