FeatureTrack Class
FeatureTrack
FeatureTrack(
name: str,
size: int,
start_pos: int = 0,
labelsize: int = 20,
labelcolor: str = "black",
labelmargin: float = 0.01,
linewidth: int = 1,
linecolor: str = "black",
spines: bool = False,
ratio: float = 1.0,
)
Bases: Track
FeatureTrack Class
PARAMETER | DESCRIPTION |
---|---|
name |
Track name
TYPE:
|
size |
Track size
TYPE:
|
start_pos |
Track start position. Track start-end range is defined as (start_pos, start_pos + size).
TYPE:
|
labelsize |
Track label size
TYPE:
|
labelcolor |
Track label color
TYPE:
|
labelmargin |
Track label margin
TYPE:
|
linewidth |
Track line width
TYPE:
|
linecolor |
Track line color
TYPE:
|
spines |
Display track spines
TYPE:
|
ratio |
Track height ratio
TYPE:
|
add_feature
add_feature(
start: int,
end: int,
strand: LiteralTypes.STRAND = 1,
label: str = "",
labelsize: int = 15,
labelcolor: str = "black",
plotstyle: LiteralTypes.PLOTSTYLE = "bigarrow",
facecolor: str = "orange",
edgecolor: str = "black",
linewidth: float = 0,
labelrotation: int = 45,
labelvpos: LiteralTypes.LABELVPOS = "strand",
labelhpos: LiteralTypes.LABELHPOS = "center",
labelha: LiteralTypes.LABELHA = "left",
arrow_shaft_ratio: float = 0.5,
size_ratio: float = 1.0,
patch_kws: dict[str, Any] | None = None,
) -> None
Add feature to track
PARAMETER | DESCRIPTION |
---|---|
start |
Featrue start position
TYPE:
|
end |
Feature end position
TYPE:
|
strand |
Feature strand
TYPE:
|
label |
Feature label
TYPE:
|
labelsize |
Feature label size
TYPE:
|
labelcolor |
Feature label color
TYPE:
|
plotstyle |
Feature plot style (
TYPE:
|
facecolor |
Feature facecolor
TYPE:
|
edgecolor |
Feature edgecolor
TYPE:
|
linewidth |
Feature edge linewidth
TYPE:
|
labelrotation |
Feature label rotation
TYPE:
|
labelvpos |
Feature label vertical position (
TYPE:
|
labelhpos |
Feature label horizontal position (
TYPE:
|
labelha |
Feature label horizontal alignment (
TYPE:
|
arrow_shaft_ratio |
Feature arrow shaft ratio
TYPE:
|
size_ratio |
Feature size ratio to track
TYPE:
|
patch_kws |
Patch properties (e.g.
TYPE:
|
add_exon_feature
add_exon_feature(
exon_regions: list[tuple[int, int]],
strand: LiteralTypes.STRAND = 1,
label: str = "",
labelsize: int = 15,
labelcolor: str = "black",
plotstyle: LiteralTypes.PLOTSTYLE = "bigarrow",
facecolor: str = "orange",
edgecolor: str = "black",
linewidth: float = 0,
labelrotation: int = 45,
labelvpos: LiteralTypes.LABELVPOS = "strand",
labelhpos: LiteralTypes.LABELHPOS = "center",
labelha: LiteralTypes.LABELHA = "left",
arrow_shaft_ratio: float = 0.5,
size_ratio: float = 1.0,
exon_labels: list[str] | None = None,
exon_label_kws: dict[str, Any] | None = None,
patch_kws: dict[str, Any] | None = None,
intron_patch_kws: dict[str, Any] | None = None,
) -> None
Add exon feature to track
PARAMETER | DESCRIPTION |
---|---|
exon_regions |
Exon feature start-end postion list
TYPE:
|
strand |
Feature strand
TYPE:
|
label |
Feature label
TYPE:
|
labelsize |
Feature label size
TYPE:
|
labelcolor |
Feature label color
TYPE:
|
plotstyle |
Feature plot style (
TYPE:
|
facecolor |
Feature facecolor
TYPE:
|
edgecolor |
Feature edgecolor
TYPE:
|
linewidth |
Feature edge linewidth
TYPE:
|
labelrotation |
Feature label rotation
TYPE:
|
labelvpos |
Feature label vertical position (
TYPE:
|
labelhpos |
Feature label horizontal position (
TYPE:
|
labelha |
Feature label horizontal alignment (
TYPE:
|
arrow_shaft_ratio |
Feature arrow shaft ratio
TYPE:
|
size_ratio |
Feature size ratio to track
TYPE:
|
exon_labels |
Exon labels. Array length must be same as
TYPE:
|
exon_label_kws |
Text properties (e.g.
TYPE:
|
patch_kws |
Exon patch properties (e.g.
TYPE:
|
intron_patch_kws |
Intron patch properties (e.g.
TYPE:
|
add_features
add_features(
features: list[SeqFeature],
label_type: str | None = None,
label_handle_func: Callable[[str], str] | None = None,
labelsize: int = 15,
labelcolor: str = "black",
plotstyle: LiteralTypes.PLOTSTYLE = "bigarrow",
facecolor: str = "orange",
edgecolor: str = "black",
linewidth: float = 0,
labelrotation: int = 45,
labelvpos: LiteralTypes.LABELVPOS = "strand",
labelhpos: LiteralTypes.LABELHPOS = "center",
labelha: LiteralTypes.LABELHA = "left",
arrow_shaft_ratio: float = 0.5,
size_ratio: float = 1.0,
patch_kws: dict[str, Any] | None = None,
) -> None
Add features (BioPython's SeqFeature list)
PARAMETER | DESCRIPTION |
---|---|
features |
BioPython's SeqFeature list
TYPE:
|
label_type |
Label type (e.g.
TYPE:
|
label_handle_func |
User defined function to handle label.
Useful for filtering out unnecesary labels such as
TYPE:
|
labelsize |
Feature label size
TYPE:
|
labelcolor |
Feature label color
TYPE:
|
plotstyle |
Feature plot style (
TYPE:
|
facecolor |
Feature facecolor.
If Genbank qualifiers has facecolor key (e.g.
TYPE:
|
edgecolor |
Feature edgecolor
TYPE:
|
linewidth |
Feature edge linewidth
TYPE:
|
labelrotation |
Feature label rotation
TYPE:
|
labelvpos |
Feature label vertical position (
TYPE:
|
labelhpos |
Feature label horizontal position (
TYPE:
|
labelha |
Feature label horizontal alignment (
TYPE:
|
arrow_shaft_ratio |
Feature arrow shaft ratio
TYPE:
|
size_ratio |
Feature size ratio to track
TYPE:
|
patch_kws |
Patch properties (e.g.
TYPE:
|
add_genbank_features
add_genbank_features(
gbk: Genbank,
feature_type: str = "CDS",
label_type: str | None = None,
label_handle_func: Callable[[str], str] | None = None,
allow_partial: bool = False,
pseudogene: bool = False,
labelsize: int = 15,
labelcolor: str = "black",
plotstyle: LiteralTypes.PLOTSTYLE = "bigarrow",
facecolor: str = "orange",
facecolor_handle_func: Callable[[SeqFeature], str] | None = None,
edgecolor: str = "black",
linewidth: float = 0,
labelrotation: int = 45,
labelvpos: LiteralTypes.LABELVPOS = "strand",
labelhpos: LiteralTypes.LABELHPOS = "center",
labelha: LiteralTypes.LABELHA = "left",
arrow_shaft_ratio: float = 0.5,
size_ratio: float = 1.0,
patch_kws: dict[str, Any] | None = None,
) -> None
Add features from genbank record
PARAMETER | DESCRIPTION |
---|---|
gbk |
Genbank object
TYPE:
|
feature_type |
Feature type (e.g.
TYPE:
|
label_type |
Label type (e.g.
TYPE:
|
label_handle_func |
User defined function to handle label.
Useful for filtering out unnecesary labels such as
TYPE:
|
allow_partial |
If True, features that are partially included in range are also extracted
TYPE:
|
pseudogene |
If True and
TYPE:
|
labelsize |
Feature label size
TYPE:
|
labelcolor |
Feature label color
TYPE:
|
plotstyle |
Feature plot style (
TYPE:
|
facecolor |
Feature facecolor.
If Genbank qualifiers has facecolor key (e.g.
TYPE:
|
facecolor_handle_func |
User defined function to handle feature facecolor.
TYPE:
|
edgecolor |
Feature edgecolor
TYPE:
|
linewidth |
Feature edge linewidth
TYPE:
|
labelrotation |
Feature label rotation
TYPE:
|
labelvpos |
Feature label vertical position (
TYPE:
|
labelhpos |
Feature label horizontal position (
TYPE:
|
labelha |
Feature label horizontal alignment (
TYPE:
|
arrow_shaft_ratio |
Feature arrow shaft ratio
TYPE:
|
size_ratio |
Feature size ratio to track
TYPE:
|
patch_kws |
Patch properties (e.g.
TYPE:
|
add_gff_features
add_gff_features(
gff: Gff,
feature_type: str = "CDS",
parse_exon_intron: bool = False,
label_type: str | None = None,
label_handle_func: Callable[[str], str] | None = None,
labelsize: int = 15,
labelcolor: str = "black",
plotstyle: LiteralTypes.PLOTSTYLE = "bigarrow",
facecolor: str = "orange",
facecolor_handle_func: Callable[[SeqFeature], str] | None = None,
edgecolor: str = "black",
linewidth: float = 0,
labelrotation: int = 45,
labelvpos: LiteralTypes.LABELVPOS = "strand",
labelhpos: LiteralTypes.LABELHPOS = "center",
labelha: LiteralTypes.LABELHA = "left",
arrow_shaft_ratio: float = 0.5,
size_ratio: float = 1.0,
patch_kws: dict[str, Any] | None = None,
intron_patch_kws: dict[str, Any] | None = None,
) -> None
Add features from GFF record
PARAMETER | DESCRIPTION |
---|---|
gff |
GFF object
TYPE:
|
feature_type |
Feature type (e.g.
TYPE:
|
parse_exon_intron |
If True, try to parse and add exon-intron structured feature
(Expected to be used for eukaryote with feature_type=
TYPE:
|
label_type |
Label type in attributes column (e.g.
TYPE:
|
label_handle_func |
User defined function to handle label.
Useful for filtering out unnecesary labels such as
TYPE:
|
labelsize |
Feature label size
TYPE:
|
labelcolor |
Feature label color
TYPE:
|
plotstyle |
Feature plot style (
TYPE:
|
facecolor |
Feature facecolor.
If GFF attributes column has facecolor tag (e.g.
TYPE:
|
facecolor_handle_func |
User defined function to handle feature facecolor.
TYPE:
|
edgecolor |
Feature edgecolor
TYPE:
|
linewidth |
Feature edge linewidth
TYPE:
|
labelrotation |
Feature label rotation
TYPE:
|
labelvpos |
Feature label vertical position (
TYPE:
|
labelhpos |
Feature label horizontal position (
TYPE:
|
labelha |
Feature label horizontal alignment (
TYPE:
|
arrow_shaft_ratio |
Feature arrow shaft ratio
TYPE:
|
size_ratio |
Feature size ratio to track
TYPE:
|
patch_kws |
Patch properties (e.g.
TYPE:
|
intron_patch_kws |
Intron patch properties (e.g.
TYPE:
|
add_subtrack
Add subtrack to feature track
PARAMETER | DESCRIPTION |
---|---|
name |
Subtrack name. If None, subtrack name is automatically set.
TYPE:
|
ratio |
Subtrack size ratio to feature track
TYPE:
|
position |
Subtrack position (
TYPE:
|
get_subtrack
Get subtrack by name
PARAMETER | DESCRIPTION |
---|---|
name |
Target subtrack name
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
subtrack
|
Target subtrack
TYPE:
|
set_sublabel
set_sublabel(
text: str | None = None,
size: int = 15,
color: str = "black",
position: str = "bottom-left",
ymargin: float = 0.2,
sublabel_kws: dict[str, Any] | None = None,
) -> None
Set sublabel to feature track
PARAMETER | DESCRIPTION |
---|---|
text |
Sublabel text. If None,
TYPE:
|
size |
Sublabel size
TYPE:
|
color |
Sublabel color
TYPE:
|
position |
Sublabel position (
TYPE:
|
ymargin |
Sublabel y-margin
TYPE:
|
sublabel_kws |
Text properties (e.g.
TYPE:
|