Sector Class
pycirclizely.sector.Sector
Sector(
name: str,
size: float | tuple[float, float],
rad_lim: tuple[float, float],
clockwise: bool = True,
)
Circos Sector Class
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Sector name. |
required |
size
|
float | tuple[float, float]
|
Sector size (or range). |
required |
rad_lim
|
tuple[float, float]
|
Sector radian limit region. |
required |
clockwise
|
bool
|
Sector coordinate direction (clockwise or anti-clockwise). |
True
|
Methods:
Name | Description |
---|---|
add_track |
Args: |
axis |
Plot axis shapes for the sector. |
get_lowest_r |
Get lowest radius position of sector from tracks data. |
get_track |
Get track instance by name. |
line |
Plot line with sector-relative coordinates. |
rect |
Plot a rectangle spanning angular and radial ranges. |
text |
Plot text within a sector. Uses genomic coordinates (x) mapped to radians. |
x_to_rad |
Convert x coordinate to radian in sector start-end range. |
Attributes
Functions
add_track
add_track(
r_lim: tuple[float, float],
*,
r_pad_ratio: float = 0,
name: str | None = None
) -> Track
Parameters:
Name | Type | Description | Default |
---|---|---|---|
r_lim
|
tuple[float, float]
|
Radius limit region. |
required |
r_pad_ratio
|
float
|
Track padding ratio for plot data. |
0
|
name
|
str | None
|
Track name. If None, a default name is generated. |
None
|
axis
Plot axis shapes for the sector.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Any
|
Shape properties. https://plotly.com/python/reference/layout/shapes/ |
{}
|
line
line(
*,
r: float | tuple[float, float],
start: float | None = None,
end: float | None = None,
arc: bool = True,
**kwargs: Any
) -> None
Plot line with sector-relative coordinates.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
r
|
float | tuple[float, float]
|
Radius position(s). If float, creates constant-radius line. |
required |
start
|
float | None
|
Genomic start position. Uses sector start if None. |
None
|
end
|
float | None
|
Genomic end position. Uses sector end if None. |
None
|
arc
|
bool
|
If True, creates curved arc line (polar projection). If False, creates straight chord line. |
True
|
**kwargs
|
Any
|
Shape properties
(e.g. |
{}
|
rect
rect(
start: int | float | None = None,
end: int | float | None = None,
r_lim: tuple[float, float] | None = None,
**kwargs: Any
) -> None
Plot a rectangle spanning angular and radial ranges.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start
|
int | float | None
|
Start position (x coordinate). If None, |
None
|
end
|
int | float | None
|
End position (x coordinate). If None, |
None
|
r_lim
|
tuple[float, float] | None
|
Radius limit region. If None, (0, 100) is set. |
None
|
**kwargs
|
Any
|
Shape properties
(e.g. |
{}
|
text
text(
text: str,
x: float | None = None,
r: float = 107,
*,
adjust_rotation: bool = True,
orientation: str = "horizontal",
ignore_range_error: bool = False,
**kwargs: Any
) -> None
Plot text within a sector. Uses genomic coordinates (x) mapped to radians.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
text
|
str
|
Text content. |
required |
x
|
float | None
|
Genomic position. If None, sector center is used. |
None
|
r
|
float
|
Radius position (default: 105, outer edge). |
107
|
adjust_rotation
|
bool
|
If True, text rotation auto based on |
True
|
orientation
|
str
|
Text orientation ( |
'horizontal'
|
ignore_range_error
|
bool
|
If True, ignores x position outside sector bounds. |
False
|
**kwargs
|
Any
|
Annotation properties (e.g. |
{}
|