当前位置: 首页 > news >正文

3D基因组工具(HiC可视化)trackc--bioinfomatics tools 35

01 3D genome data analysis guides

茶树三维基因组-文献精读19

https://trackc.readthedocs.io/en/latest/install.html    #官网
https://github.com/seqyuan/trackc           #官网https://trackc.readthedocs.io/en/latest/analysis_guide/index.html   #HiC可视化案例
GridSpec

在基因组区域中可视化多组学数据通常需要结合多个轨迹(tracks)。为了创建适合发表的高质量图像,精细调整每个轨迹的比例非常重要。快速调整轨迹比例以及轻松添加或移除轨迹的能力是一个重要问题。

trackc 提供了两种方法来绘制布局:

  1. trackc.tenon

  2. trackc.make_spec

这些函数为用户提供了一种快速灵活的方法,用于调整每个轨迹的比例,同时方便地在多组学可视化布局中添加或移除轨迹。

1. trackc.tenon
  • trackc.tenon 返回一个对象。例如:

    ten = trackc.tenon(width=5, height=1)

    在此示例中,ten 是一个表示虚拟图形的对象,其宽度为 5,高度为 1。用户可以通过以下方法向该图形添加轨迹:

    ten.add(pos='bottom', height=4, hspace=0.1)
    • height 参数 表示新添加轨迹的相对高度。例如,如果虚拟图形的高度为 1,而新轨迹的高度为 4,则子图的实际高度将为 1 * 4。

    • 使用 ten.add 方法 类似于搭建积木,用户可以通过 pos 参数 选择将新轨迹添加到顶部(top)或底部(bottom)。

    • hspace=0.1 参数 控制新轨迹与相邻轨迹之间的间距。

2. trackc.make_spec
  • trackc.make_spec 定义整个图像的大小,允许用户从上到下或从左到右设置一组子图,可以通过 height_ratioswidth_ratios 控制各部分的比例。

可用轨迹

本节包括多个快速教程,展示了使用 trackc 进行组学数据可视化的功能。

  • GridSpec
    • trackc.tenon
    • trackc.make_spec
  • scale
    • trackc.pl.scale_track
    • trackc.pl.multi_scale_track
  • mapC
    • Get test data
  • mapc_markline
  • Virtual4C
    • Get test Data
  • gene
    • convert GTF to BED12
    • trackc.pl.scale_track
  • bigwig
    • Get test data
  • bed
    • bed styles
  • bedGraphMatrix
  • links
    • Get test data
  • zoomin
  • highlight line
02 安装

trackc 运行需要 Python 版本 >= 3.8。

通过 PyPI 安装

使用以下命令安装 trackc:pip install trackc
更新 trackc 的命令:pip install --upgrade trackc
指定版本和安装源的命令:pip install -i https://pypi.org/simple trackc==版本号

开发版本

从 GitHub 安装 trackc 的命令:pip install git+https://github.com/seqyuan/trackc@main
03 heatmap
conf-hicmap_1.yml等很多
trackc:- ax: t1height: 2track_type: hicmaptrack_para:mat:method: extractContactRegionsclr: /path/GSM4417639_SK-N-DZ_C6BC81F2_b38d5.mcool::/resolutions/5120000row_regions:- chr6- chr8mapC:cmap: plasma
运行
trackc cli conf-hicmap_1.yml -s 4,1 -o chr6_chr8.pdf

conf-hicmap_4.yml

trackc:- ax: t1height: 1track_type: hicmaptrack_para:mat:method: extractCisContactclr: ./github/seqyuan/trackc_data/examples/HPDE6C7.chr18.mcool::/resolutions/25000mapC:map_type: triheight: 50label: tri- ax: t2height: 1hspace: 0.3track_type: hicmaptrack_para:mat2:method: extractCisContactclr: ./github/seqyuan/trackc_data/examples/HPDE6C7.chr18.mcool::/resolutions/25000mapC:map_type: triheight: 50label: tri-mat2- ax: t3height: 2hspace: 0.3track_type: hicmaptrack_para:mat:method: extractCisContactclr: ./github/seqyuan/trackc_data/examples/HPDE6C7.chr18.mcool::/resolutions/25000mapC:map_type: triheight: 50label: tri-symmetricsymmetric: True- ax: t4height: 1hspace: 0.3track_type: hicmaptrack_para:mat:method: extractCisContactclr:./github/seqyuan/trackc_data/examples/BxPC3.chr18.mcool::/resolutions/25000extend: 50mapC:cmap: PuBumap_type: recheight: 50label: rec- ax: t5height: 1hspace: 0.3track_type: hicmaptrack_para:mat2:method: extractCisContactclr: ./github/seqyuan/trackc_data/examples/BxPC3.chr18.mcool::/resolutions/25000extend: 50mapC:cmap: cividismap_type: recheight: 50label: rec-mat2- ax: t6height: 2hspace: 0.3track_type: hicmaptrack_para:mat2:method: extractCisContactclr: ./github/seqyuan/trackc_data/examples/BxPC3.chr18.mcool::/resolutions/25000extend: 50mapC:cmap: magmamap_type: recheight: 50symmetric: Truelogdata: Truelabel: rec-symmetric- ax: t1track_type: scale_tracktrack_para:scale_adjust: Mbtick_pos: topratio2ax: 1

运行

trackc cli conf-hicmap_4.yml -r 18:10000000-14500000

 

04 rearranged_interactions

ectopic_interactions.yaml

trackc:- ax: t1height: 2track_type: hicmaptrack_para:mat:method: extractContactRegionsclr: ./github/seqyuan/trackc_data/examples/BxPC3.chr18.mcool::/resolutions/50000balance: Falserow_regions: 18:45000000-78077248mapC:map_type: trilabel: tumor res=50kcmap: PuBumaxrange: 70ax_on: False- ax: t1track_type: scale_tracktrack_para:region: 18:45000000-78077248scale_adjust: Mbtick_pos: topratio2ax: 0.3space: 0.01tick_fontsize: 6label_fontsize: 7- ax: t2height: 0.2track_type: zoomintrack_para:raw_regions: 18:45000000-78077248zoomin_regions:- 18:47340000-50370000- 18:61140000-63630000- 18:74030000-77560000line_on: Falsefill: Truealpha: 0.5- ax: t3height: 0.4track_type: multi_scale_tracktrack_para:regions:- 18:47340000-50370000- 18:61140000-63630000- 18:74030000-77560000scale_adjust: Mbintervals: 2tick_fontsize: 7- ax: t4height: 2track_type: hicmaptrack_para:mat2:method: extractContactRegionsclr: ./github/seqyuan/trackc_data/examples/BxPC3.chr18.mcool::/resolutions/25000balance: Falserow_regions:- 18:47340000-50370000- 18:61140000-63630000- 18:74030000-77560000mapC:map_type: trilabel: ectopic interactionscmap: PuBuax_on: Falsemaxrange: 100- ax: t5height: 0.2track_type: zoomintrack_para:raw_regions:- 18:47340000-50370000- 18:61140000-63630000- 18:74030000-77560000zoomin_regions:- 18:47400000-48280000- 18:75280000-74030000line_on: Falsefill: Truealpha: 0.5- ax: t6height: 0.4track_type: multi_scale_tracktrack_para:regions:- 18:47400000-48280000- 18:75280000-74030000scale_adjust: Mbintervals: 2tick_fontsize: 7- ax: t7height: 1.25track_type: hicmaptrack_para:mat:method: extractContactRegionsclr: ./github/seqyuan/trackc_data/examples/BxPC3.chr18.mcool::/resolutions/25000balance: Falserow_regions:- 18:47400000-48280000- 18:75280000-74030000mapC:map_type: trilabel: neo tadcmap: PuBuheight: 40ax_on: Falsemaxrange: 200minrange: 10- ax: t8height: 0.5track_type: bw_tracktrack_para:bw: ./github/seqyuan/trackc_data/examples/GSM3178671_BxPC3_H3K27ac.bigwigregions:- 18:47400000-48280000- 18:75280000-74030000label: H3K27acbinsize: 2000color:- '#5B7695'- ax: t9height: 2.8track_type: gene_tracktrack_para:bed12: ./github/seqyuan/trackc_data/examples/hg19_chr18.gene.bed12regions:- 18:47400000-48280000- 18:75280000-74030000line: 12gene_fontszie: 8

运行

trackc cli ectopic_interactions.yaml -s 5,1


 

05 Virtual 4C

4C.yaml

trackc:- ax: t1height: 4track_type: hicmaptrack_para:mat:method: extractContactRegionsclr: ./github/seqyuan/trackc_data/tutorials/4C/GSM4604287_1360.sub.coolbalance: FalsemapC:map_type: trilabel: AML 1360cmap: PuBumaxrange: 6minrange: -6- ax: t2height: 0.7track_type: gene_tracktrack_para:bed12: ./github/seqyuan/trackc_data/tutorials/4C/GRCh38.gene.chr8chr14.bed12line: 3gene_fontszie: 10show_label:- MYC- ax: t3height: 0.7track_type: bw_tracktrack_para:bw: ./github/seqyuan/trackc_data/tutorials/4C/GSM4604189_H3K27ac.bwmaxrange: 10label: H3K27acbinsize: 10000invert_y: False- ax: t4height: 0.6track_type: virtual4Ctrack_para:clr: ./github/seqyuan/trackc_data/tutorials/4C/GSM4604287_1360.sub.coolmaxrange: 10label: Virtual 4Ctarget_color: tab:redtrack_type: linetarget: chr8:127735434-127735435- ax: t5height: 0.6track_type: multi_scale_tracktrack_para:scale_adjust: Mbintervals: 1tick_fontsize: 8

运行

trackc cli 4C.yaml -s 6,0.75 -r 'chr8:127000000-129200000 chr14:96500000-99300000'

06 常用命令行
import trackc as tcten = tc.tenon(figsize=(8,1))
ten.add(pos='bottom', height=3.6)
ten.add(pos='bottom', height=1)chr6_len = clr.chromsizes['chr6']
chr8_len = clr.chromsizes['chr8']mat = tc.tl.extractContactRegions(clr='GSM4417639_SK-N-DZ_C6BC81F2_b38d5.mcool::/resolutions/5120000', row_regions=['chr6', 'chr8'])
tc.pl.mapC(ax=ten.axs(0), mat=mat.cmat, map_type='triangle', maxrange=5000)tc.pl.multi_scale_track(ax=ten.axs(1), regions=['chr6:0-{0}'.format(chr6_len), 'chr8:0-{0}'.format(chr8_len)],scale_adjust='Mb', intervals=2, tick_rotation=0)
# tc.savefig('hicmap.pdf')

http://www.lryc.cn/news/496470.html

相关文章:

  • 【大模型微调】图片转pdf
  • Linux-Ubuntu16.04摄像头 客户端抓取帧并保存为PNG
  • 手机ip地址取决于什么?可以随便改吗
  • 计算机网络:TCP/IP协议的五大重要特性介绍
  • Java与AWS S3的文件操作
  • 详解 YOLOv5 模型运行参数含义以及设置及在 PyCharm 中的配置方法
  • Vue根据Div内容的高度给其Div设置style height
  • 驱动篇的开端
  • OpenSSL 自建CA 以及颁发证书(网站部署https双向认证)
  • 吾杯网络安全技能大赛WP(部分)
  • 按vue组件实例类型实现非侵入式国际化多语言翻译
  • Java入门:22.集合的特点,List,Set和Map集合的使用
  • 重生之我在异世界学编程之C语言:深入指针篇(下)
  • 理解Parquet文件和Arrow格式:从Hugging Face数据集的角度出发
  • 下载 M3U8 格式的视频
  • Tomcat使用教程
  • LabVIEW氢气纯化控制系统
  • 现在的电商风口已经很明显了
  • Uniapp触底刷新
  • 开源项目 - face parsing 人脸区域分割 人像区域分割 人脸分割 人像区域分割 BiSeNet
  • python游戏设计---飞机大战
  • 13TB的StarRocks大数据库迁移过程
  • HTTP代理有那些常见的安全协议?
  • Kylin Server V10 下基于Kraft模式搭建Kafka集群
  • tauri使用github action打包编译多个平台arm架构和inter架构包踩坑记录
  • Python爬虫与窗口实现翻译小工具(仅限学习交流)
  • 紫光展锐联合上汽海外发布量产车型,赋能汽车智能化
  • Maven 打包出现问题解决方案
  • 第四话:JS中的eval函数
  • 歇一歇,写写段子