trackc.pl.multi_scale_track#
- trackc.pl.multi_scale_track(ax: Axes | None = None, regions: Sequence[str] | str | None = None, colors: Sequence[str] | None = None, alpha: float | None = 1, intervals: int | None = 1, scale_adjust: str | None = 'kb', tick_fl: str | None = '%0.2f', tick_fontsize: int | None = 8, tick_rotation: int | None = 0)[source]#
Plot region scale bar, support for multiple or reverse genome regions.
- Parameters:
ax (
matplotlib.axes.Axesobject) –regions (str list | str) – e.g.
"chr6:1000000-2000000"or["chr6:1000000-2000000", "chr3:5000000-4000000"]The start can be larger than the end (eg."chr6:2000000-1000000"), which means you want to get the reverse regioncolors (str list) – scale bar colors
alpha (float) – scale bar alpha
intervals (int) – rows of the scale bar by region
scale_adjust (str) – options in [‘kb’, ‘Mb’]
tick_fl (str) – ticks retains a few decimal places
tick_fontsize (int) – ticks text fontsize
tick_rotation (int) – ticks text rotation
Example
>>> import trackc as tc >>> regions = ['7:153000000-151000000', '11:118500000-116500000'] >>> ten = tc.tenon(figsize=(8,1)) >>> ten.add(pos='bottom', height=1) >>> tc.pl.multi_scale_track(ten.axs(0), regions=regions, scale_adjust='Mb', intervals=2)