HiC数据实战解析入门(第一篇)
首先需要明白数据分析流程,可以查看第一讲:三维基因组学习笔记,提炼流程如下:
- Hi-C标准分析流程(比对及过滤,原始互作图谱构建)
- 下载参考基因组及构建bowtie2索引
- 把fq测序数据比对都参考基因组
- 过滤及挑选符合要求的比对结果
- 原始互作图谱构建
- 互作图谱迭代校正
- Compartment分析
- TAD分析
- 显著互作Loops分析
实战数据
来自于Tung B. K. Le et al. Science 2013 :https://www.ncbi.nlm.nih.gov/sra/?term=srr824846
Study: High-resolution mapping of the spatial organization of Caulobacter crescentus chromosome by chromosome conformation capture in conjunction with next-generation sequencing (Hi-C)
数据下载后转为fq文件如下:
858M Jul 3 16:21 SRR824846_Q20L10_1.fastq.gz
857M Jul 3 16:22 SRR824846_Q20L10_2.fastq.gz
如果想看其它数据:PRJNA196826 • SRP020913 • All experiments • All runs
下载参考基因组并且构建bowtie2的索引
物种是:新月柄杆菌 Caulobacter crescentus,它是一种经常用于实验室实验中的细菌,通常含有扁平囊泡(绿色),包裹着贮存颗粒(橙色)。
WC Nierman - 2001的文章就发表了该物种的基因组 - 被引用次数:500 The complete genome sequence of Caulobacter crescentus was determined to be 4,016,942 base pairs in a single circular chromosome encoding 3,767 genes.
mkdir -p ~/project/hic/ref
cd ~/project/hic/ref
wget ftp://ftp.ensemblgenomes.org/pub/bacteria/release-40/fasta/bacteria_20_collection/caulobacter_crescentus_na1000/dna/Caulobacter_crescentus_na1000.ASM2200v1.dna.toplevel.fa.gz
gunzip Caulobacter_crescentus_na1000.ASM2200v1.dna.toplevel.fa.gz
bowtie2-build Caulobacter_crescentus_na1000.ASM2200v1.dna.toplevel.fa bacteria
得到
5.3M Jul 25 19:28 bacteria.1.bt2
988K Jul 25 19:28 bacteria.2.bt2
17 Jul 25 19:28 bacteria.3.bt2
988K Jul 25 19:28 bacteria.4.bt2
5.3M Jul 25 19:28 bacteria.rev.1.bt2
988K Jul 25 19:28 bacteria.rev.2.bt2
这个参考基因组fa文件节选如下:
>Chromosome dna:chromosome chromosome:ASM2200v1:Chromosome:1:4042929:1 REF
GAATTCTTAACGTCCTGAGACACGACAGCGACCTCTGACCGGACTCGTTCCGCGTCTTTG
GACAATCGGGATTCAGACTTCGGGGGATGCGGCGCAGGCTTGGGGATGATAGGCGAGCAA
TGCGACCGTTGATCACAGCGGCGCCGTGTCACGACGCTGTTGGGGCCGTTCGGCGCCCGG
下载必备软件
软件大全来源于:https://omictools.com/3c-4c-5c-hi-c-chia-pet-category
如果没有conda就先安装咯:
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
source ~/.bashrc
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
conda config --set show_channel_urls yes
然后安装一系列软件哈:
conda create -n hic python=2 bowtie2
conda info --envs
source activate hic
conda search hiclab
conda install -y sra-tools samtools
有些软件不在conda里面,需要自行查看软件说明书文档,主要是:
- https://bitbucket.org/mirnylab/hiclib
- https://github.com/nservant/HiC-Pro
其中特别值得推荐,可以处理各种各样的hic数据,包括:
- Hi-C
- in situ Hi-C
- DNase Hi-C
- Micro-C
- capture-C
- capture Hi-C
- HiChip
安装hiclib代码如下:
source activate hic
conda install numpy scipy matplotlib h5py cython numexpr statsmodels scikit-learn pandas
pip install https://bitbucket.org/mirnylab/mirnylib/get/tip.tar.gz
pip install https://bitbucket.org/mirnylab/hiclib/get/tip.tar.gz ## 17.7MB 44kB/s
安装hiclib代码如下:
# conda install numpy scipy matplotlib h5py cython numexpr statsmodels scikit-learn pandas
## 依赖软件比较多
source activate hic
conda install -y pysam bx-python numpy scipy
conda install -y R
R -e "install.packages(c('ggplot2','RColorBrewer') repos='https://mirrors.tuna.tsinghua.edu.cn/CRAN/')"
R -e "library(ggplot2)"
R -e "library(RColorBrewer)"
mkdir -p ~/biosoft/hicpro
cd ~/biosoft/hicpro
git clone https://github.com/nservant/HiC-Pro.git
cd HiC-Pro/
which bowtie2
which R
which samtools
which python
cat config-install.txt
mkdir /home/zengjianming/biosoft/hicpro/bin
这个时候一定要根据自己的系统环境,修改目录下的config-install.txt
文件哦:
PREFIX =/home/zengjianming/biosoft/hicpro/bin
BOWTIE2_PATH =/home/zengjianming/miniconda3/envs/hic/bin/bowtie2
SAMTOOLS_PATH =/home/zengjianming/miniconda3/envs/hic/bin/samtools
R_PATH =/home/zengjianming/miniconda3/envs/hic/bin/R
PYTHON_PATH =/home/zengjianming/miniconda3/envs/hic/bin/python
CLUSTER_SYS =SGE
然后就可以编译自己的软件啦:
make configure
make install
依赖非常多,但是用心安装还是问题不大的哦!
/home/zengjianming/biosoft/hicpro/bin/HiC-Pro_2.10.0/bin/HiC-Pro -h
这样如果输出了帮助文档,说明安装成功哦。
hiclib教程
先看官网readme,如下:
- 0. Download software and data
- 1. Map reads to the genome
- 2. Filter the dataset at the restriction fragment level
- 3. Filter and iteratively correct heatmaps.
打开才发现,居然清一色的python代码,而不是打包好的软件,命令行加上参数的模式来走这个流程,感觉有点难用,先放弃,后续再更新这个使用记录。
Hic-pro教程
其说明书完全不逊于hiclib,详见:http://nservant.github.io/HiC-Pro
大体上看就6个步骤,比对、过滤HiC比对结果、检测有效HiC序列、结果合并、构建HiC关联图谱以及关联图谱标准化。而行使这些不同功能只需要更改参数即可:
[-s|--step ANALYSIS_STEP] : run only a subset of the HiC-Pro workflow; if not specified the complete workflow is run
mapping: perform reads alignment - require fast files
proc_hic: perform Hi-C filtering - require BAM files
quality_checks: run Hi-C quality control plots
merge_persample: merge multiple inputs and remove duplicates if specified - require .validPairs files
build_contact_maps: Build raw inter/intrachromosomal contact maps - require _allValidPairs files
ice_norm : run ICE normalization on contact maps - require .matrix files
只使用s 参数才
会分步运行,因为5步中还是mapping花的时间最多,如果其它步骤需要调整参数,分步运行还是会快很多,比如调整BIN_SIZE等等。
当然,不得不提的是其特色功能:位基因特异性HiC分析
今天有点晚了,明天继续实战哦。
其它实战数据集
上面的是细菌基因组,测序文件也小很多,适合练手,如果熟练了也可以找其它数据集,比如Rose基因组的HiC原始数据下载地址:
- http://sra-download.ncbi.nlm.nih.gov/srapub/SRR6189546
- http://sra-download.ncbi.nlm.nih.gov/srapub/SRR6189547
每个数据都12G左右。
还可以是 An Osteoporosis Risk SNP at 1p36.12 Acts as an Allele-Specific Enhancer to Modulate LINC00339 Expression via Long-Range Loop Formation 文章的数据,等等。
推荐阅读
-
入门级C语言函数解析(第一篇)
-
轻松入门大数据:从HDFS开始(详尽解析)
-
玩转MySQL数据库存储过程:全面解析游标操作(包括声明、开启、读取和关闭,实战案例)
-
搞定MySQL基础知识,让你秒变数据库小能手 - MySQL入门八股文解析
-
升级版408计算机组成基础深度解析:数据运算实战及大题详解(上篇)
-
入门JWT(一):探索常见身份验证方法,解析JWT工作原理并实战应用
-
入门与实战:使用g2o和位姿图进行精确定位与姿态优化 - SLAM技术解析
-
入门到精通:从理解图优化g2o代码到实战编程——SLAM技术的全程解析(详述)
-
大疆文档第一篇:入门指南 - 概念解析
-
【2022新手指南】Java编程进阶之路 - 六、技术架构篇 ### MySQL索引底层解析与优化实战 - 你会讲解MySQL索引的数据结构吗?性能调优技巧知多少? - Redis深度揭秘:你知道多少?从基础到哨兵、主从复制全梳理 - Redis持久化及哨兵模式详解,还有集群搭建和Leader选举黑箱打开 - Zookeeper是个啥?特性和应用场景大公开 - ZooKeeper集群搭建攻略及 Leader选举、读写一致性、共享锁实现细节 - 探究ZooKeeper中的Leader选举机制及其在分布式环境中的作用 - Zab协议深入剖析:原理、功能与在Zookeeper中的核心地位 - RabbitMQ全方位解读:工作模式、消费限流、可靠投递与配置策略 - 设计者视角:RabbitMQ过期时间、死信队列与延时队列实践指南 - RocketMQ特性和应用场景揭示:理解其精髓与差异化优势 - Kafka详细介绍:特性及广泛应用于实时数据处理的场景解析 - ElasticSearch实力揭秘:特性概述与作为搜索引擎的广泛应用 - MongoDB认知升级:非关系型数据库的优势阐述,安装与使用实战教学 - BIO/NIO/AIO网络模型对比:掌握它们的区别与在网络编程中的实际应用 - Netty带你飞:理解其超快速度背后的秘密,包括线程模型分析 - 网络通信黑科技:Netty编解码原理与常用编解码器的应用,Protostuff实战演示 - 解密Netty粘包与拆包现象,怎样有效应对这一常见问题 - 自定义Netty心跳检测机制,轻松调整检测间隔时间的艺术 - Dubbo轻骑兵介绍:核心特性概览,服务降级实战与其实现益处 - Dubbo三大神器解读:本地存根与本地伪装的实战运用与优势呈现 ----------------------- 七、结语与回顾