trackc.pl.virtual4C#
- trackc.pl.virtual4C(clr: ~cooler.api.Cooler | str, ax: ~matplotlib.axes._axes.Axes | None = None, balance: bool = False, target: str | None = None, regions: ~typing.Sequence[str] | str | None = None, track_type: str | None = 'line', color: str | None = 'tab:blue', cmap: ~typing.Sequence[~matplotlib.colors.Colormap] | str | None = <matplotlib.colors.LinearSegmentedColormap object>, target_color: str | None = None, target_name: str | None = None, logdata: bool = False, trim_range: float = 0.98, minrange: float | None = None, maxrange: float | None = None, label: str | None = None, label_rotation: int | None = 0, label_fontsize: int | None = 12)[source]#
Plot virtual4C track, support for multiple or reverse genome regions.
- Parameters:
ax (
matplotlib.axes.Axesobject) –clr (cooler.Cooler | str) – cool format Hi-C matrix (open2c/cooler) or cool file path cooler.Cooler e.g. GM12878=cooler.Cooler(‘./GM12878.chr18.mcool::/resolutions/50000’) str e.g. ‘GM12878.chr18.mcool::/resolutions/50000’ or ‘GM12878.chr18.cool’
balance (bool) – The
'balance'parameters ofcoolMat.matrix(balance=False).fetch('chr6:119940450-123940450')target (str) – Coordinates of the viewpoint. e.g. ‘chr8:127735434-127735435’
regions (str | str list) – The genome regions, which contact to the viewpoint e.g.
"chr6:1000000-2000000"or["chr6:1000000-2000000", "chr3:5000000-4000000", "chr5"]The start can be larger than the end (eg."chr6:2000000-1000000"), which means you want to get the reverse region contactstrack_type (str) – virtual4C types, you can choose one of [‘line’, ‘bar’, ‘heatmap’]
color (str) – line or bar type virtual4C color
cmap (str | matplotlib.colors.Colormap) – if track_type set heatmap, the cmap
target_color (str) – virtual4C viewpoint color
target_name (str) – viewpoint label
logdata (bool) – do you want to log the data before plotting
trim_range (float) – remove the extreme values by trimming the counts.[0,1]
minrange (float) – the minimum range of values used to define the ylim or color palette
maxrange (float) – the maximum range of values used to define the ylim or color palette
label (str) – the title of the track, will show on the left
label_rotation (int) – the label text rotation
label_fontsize (int) – the label text fontsize
Example
>>> import trackc as tc >>> regions = ['chr8:127000000-129200000', 'chr14:96500000-99300000'] >>> MYC_TSS = 'chr8:127735434-127735435' >>> ten = tc.tenon(figsize=(8,1)) >>> ten.add(pos='bottom', height=1, hspace=0.1) >>> AML_1360 = cooler.Cooler('./GSM4604287_1360.iced.mcool::/resolutions/10000') >>> tc.pl.virtual4C(ax=ten.axs(0), clr=AML_1360, target=MYC_TSS, regions=regions, track_type='line', label='Virtual 4C', target_color='r') >>> tc.savefig('trackc_virtual4c.pdf')