FeatureSegment Class
FeatureSegment
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:
|
gid2feature_dict
property
gid & feature dict (Sort by start coordinate)
transform_features
property
Coordinate transformed features
Segment-level coordinate is transformed to track-level coordinate.
transform_exon_features
property
Coordinate transformed exon features
Segment-level coordinate is transformed to track-level coordinate.
transform_ax_method2kws_list
property
Coordinate transformed axes method & keywords list
is_within_range
Check target pos is within segment range
transform_coord
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
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_annotation
add_annotation(
x: float,
text: str,
*,
y: tuple[float, float] = (1.0, 1.5),
size: float = 12,
line_kws: dict[str, Any] | None = None,
**kwargs
) -> None
Add annotation
| PARAMETER | DESCRIPTION |
|---|---|
x
|
Text x coordinate
TYPE:
|
text
|
Text content
TYPE:
|
y
|
Annotation line y coordinate tuple
TYPE:
|
size
|
Text size
TYPE:
|
line_kws
|
FancyArrowPatch properties (e.g.
TYPE:
|
**kwargs
|
Text properties (e.g.
TYPE:
|
add_sublabel
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
add_feature(
start: int,
end: int,
strand: int = 1,
*,
plotstyle: PlotStyle = "arrow",
arrow_shaft_ratio: float = 0.5,
extra_tooltip: dict[str, str] | None = None,
annotation: bool = False,
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:
|
extra_tooltip
|
Extra tooltip dict for html figure
TYPE:
|
annotation
|
If True, add annotation instead of text
TYPE:
|
label
|
Feature label text
TYPE:
|
text_kws
|
TYPE:
|
**kwargs
|
Patch properties (e.g.
TYPE:
|
add_features
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,
annotation: bool = False,
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:
|
annotation
|
If True, add annotation instead of text
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
add_exon_feature(
locs: list[tuple[int, int]],
strand: int = 1,
*,
plotstyle: PlotStyle = "arrow",
arrow_shaft_ratio: float = 0.5,
label: str = "",
annotation: 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 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:
|
annotation
|
If True, add annotation instead of text
TYPE:
|
patch_kws
|
Exon patch properties (e.g.
TYPE:
|
intron_patch_kws
|
Intron patch properties (e.g.
TYPE:
|
text_kws
|
TYPE:
|
add_exon_features
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,
annotation: bool = False,
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:
|
annotation
|
If True, add annotation instead of text
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:
|
add_lollipop
add_lollipop(
x: float,
*,
y: float = 1.0,
size: float = 6.0,
line_kws: dict[str, Any] | None = None,
point_kws: dict[str, Any] | None = None
) -> None
Add lollipop
| PARAMETER | DESCRIPTION |
|---|---|
x
|
X coordinate
TYPE:
|
y
|
Y coordinate lollipop height
TYPE:
|
size
|
Point size
TYPE:
|
line_kws
|
Axes.vlines properties (e.g.
TYPE:
|
point_kws
|
Axes.scatter properties (e.g.
TYPE:
|
add_promoter
add_promoter(
x: float,
length: float = 0.02,
*,
y: float = 1.0,
strand: Strand = 1,
head_length: float = 1.0,
head_width: float = 0.5,
**kwargs
) -> None
Add promoter arrow
| PARAMETER | DESCRIPTION |
|---|---|
x
|
X coordinate
TYPE:
|
length
|
Arrow length (If
TYPE:
|
y
|
Y coordinate promoter height
TYPE:
|
strand
|
Arrow strand direction (1 or -1)
TYPE:
|
head_length
|
Arrow head length
TYPE:
|
head_width
|
Arrow head width
TYPE:
|
kwargs
|
FancyArrowPatch properties (e.g.
TYPE:
|
add_highlight
add_highlight(
x: tuple[float, float],
*,
y: tuple[float, float] = (-1, 1),
color: str = "lime",
alpha: float = 0.2,
**kwargs
) -> None
Add highlight
| PARAMETER | DESCRIPTION |
|---|---|
x
|
X cooridinate range
TYPE:
|
y
|
Y coordinate range
TYPE:
|
color
|
Highlight color
TYPE:
|
alpha
|
Color transparency
TYPE:
|
kwargs
|
Axes.fill_between properties (e.g.
TYPE:
|