Chip-seq peak annontation



Chip-seq peak annontation

PeRl

narrowPeak/boardPeak

narrowPeak/boardPeak 是ENCODE可提供下载的两种 Chip-seq 经过参考人类基因组mapping后的关于peak的数据.
其他类型的seq数据储存个数可以参看FAQformat

narrowPeak

数据按照以下规则储存:

1. string chrom: "Reference sequence chromosome or scaffold"
2. uint chromStart: "Start position in chromosome"
3. uint chromEnd: "End position in chromosome"
4. string name: "Name given to a region (preferably unique). Use . if no name is assigned"
5. uint score: "Indicates how dark the peak will be displayed in the browser (0-1000) "
6. char[1] strand: "+ or - or . for unknown"
7. float signalValue: "Measurement of average enrichment for the region"
8. float pValue: "Statistical significance of signal value (-log10). Set to -1 if not used."
9. float qValue: "Statistical significance with multiple-test correction applied (FDR -log10). Set to -1 if n-ot used."
10. int peak: "Point-source called for this peak; 0-based offset from chromStart. Set to -1 if no point-sour-ce called."

boardPeak

数据按照以下规则储存:

1. string chrom: "Reference sequence chromosome or scaffold"
2. uint chromStart: "Start position in chromosome"
3. uint chromEnd: "End position in chromosome"
4. string name: "Name given to a region (preferably unique). Use . if no name is assigned"
5. uint score: "Indicates how dark the peak will be displayed in the browser (0-1000) "
6. char[1] strand: "+ or - or . for unknown"
7. float signalValue: "Measurement of average enrichment for the region"
8. float pValue: "Statistical significance of signal value (-log10). Set to -1 if<BR> not used."
9. float qValue: "Statistical significance with multiple-test correction applied (FDR -log10). Set to -1 if n-ot used."

在接下去的peak annotation中,只演示narrowPeak.bed格式数据.

示例数据

演示数据来自ENCODEH3K9me3 的Chip-seq,样本ID为ENCFF199BLM.

样本的基本信息:

  • Homo sapiens liver male adult (32 years)

    • Target: H3K9me3
    • Lab: Bing Ren, UCSD
    • Project: Roadmap

narrowPeak 数据基本信息:

##   seqnames     start       end       name score strand signalValue  pValue
## 1 chr10 100134639 100134831 Peak_7974 178 . 4.41261 6.68330
## 2 chr10 100446376 100446664 Peak_4189 244 . 5.13248 8.41215
## 3 chr10 100779568 100779699 Peak_32369 101 . 3.34436 4.50936
## 4 chr10 10088147 10088346 Peak_28509 112 . 4.05830 4.84890
## 5 chr10 101149252 101149594 Peak_6146 211 . 4.89252 7.53305
## 6 chr10 101173156 101173424 Peak_32985 94 . 3.45278 4.33257
## qValue peak
## 1 2.96490 132
## 2 4.37217 165
## 3 1.47374 105
## 4 1.69566 90
## 5 3.67439 174
## 6 1.30993 237

构建注释文件

在peak annotation中需要一个用于参考的注释文件,需要包括一下信息: 1. 染色体名 2. 转录本起始位点 3. 转录本终止位点 4. gene的名字 5. 正反链

注释文件可以直接从外部导入,也可以利用biomaRt 生成

library(ChIPpeakAnno)
library(biomaRt)
mart <- useMart("ensembl")
datasets <- listDatasets(mart)
mart <- useDataset("hsapiens_gene_ensembl",mart)
# 需要筛选的特征
props <- c("ensembl_gene_id", "external_gene_name", "transcript_biotype", "chromosome_name", "start_position", "end_position", "strand") # 筛选染色体号
lincRNA <- subset(
getBM(attributes=props, mart=mart, filters = "chromosome_name", values = c(1:22,"X","Y")),
transcript_biotype == "lincRNA"
)
# 在染色体前加"chr"保持和narrowPeak数据一致
lincRNA[,4] <- paste0("chr", lincRNA[,4])

得到的数据包含以下信息:

##   ensembl_gene_id external_gene_name transcript_biotype chromosome_name
## 1 ENSG00000276255 RP5-881P19.7 lincRNA chr1
## 2 ENSG00000234277 LINC01641 lincRNA chr1
## 3 ENSG00000238107 RP11-495P10.5 lincRNA chr1
## 4 ENSG00000274020 LINC01138 lincRNA chr1
## 5 ENSG00000225620 RP11-569A11.2 lincRNA chr1
## 6 ENSG00000237520 RP11-443B7.2 lincRNA chr1
## start_position end_position strand
## 1 228073909 228076550 -1
## 2 227393591 227431035 1
## 3 148295180 148297556 1
## 4 148290889 148519604 -1
## 5 202632428 202632911 1
## 6 234957231 234959989 1

进行peak annotation

有了这个注释文件以后,我们就可以根据我们想要的筛选规则对peak进行注释,主要用到的包是 ChIPpeakAnno.用到的函数为annotatePeakInBatch.

# 将前面得到的注释文件转换为RangedData对象
library(ChIPpeakAnno)
myCustomAnno <- RangedData(
IRanges(
start=lincRNA[,"start_position"],
end=lincRNA[,"end_position"],
names=lincRNA[,"ensembl_gene_id"]),
space=lincRNA[,"chromosome_name"],
strand=lincRNA[,"strand"])
# 读入需要注释的narrowPeak数据
bed_file <- read.table("ENCFF199BLM.bed", header = T, sep = "\t", stringsAsFactors = F)
# 将peak数据转换为GRanges
peaks <- toGRanges(bed_file, format="narrowPeak", colNames = colnames(bed_file))
# 根据需要进行筛选
anno <- annotatePeakInBatch(peaks, AnnotationData=myCustomAnno,
output="overlapping",
FeatureLocForDistance="TSS",
bindingRegion=c(-2000, 2000))

anno中提取我们需要的lincRNA的ID

result_lincRNA <- anno@elementMetadata$feature
head(result_lincRNA)
## [1] "ENSG00000237579" "ENSG00000235180" "ENSG00000232259" "ENSG00000204365"
## [5] "ENSG00000226578" "ENSG00000260137"

Chip-seq peak annontation的更多相关文章

  1. 测序深度和覆盖度(Sequencing depth and coverage)

    总是跑数据,却对数据一无所知,这说不过去吧. 看几篇文章吧 Sequencing depth and coverage: key considerations in genomic analyses( ...

  2. getopt两个模块getopt 和gun_getopt 的异同

    getopt的两个模块getopt和gun_getopt都可以接收参数,但是又有不同; 先看 getopt.getopt这个模块: import sys import getopt def main( ...

  3. ChIP-seq技术介绍|易基因

    大家好,这里是专注表观组学十余年,多组学科研服务领跑者的易基因. 染色质免疫沉淀后测序(ChIP seq)是一种针对DNA结合蛋白.组蛋白修饰或核小体的全基因组分析技术.由于二代测序技术的巨大进步,C ...

  4. [LeetCode] Find Peak Element 求数组的局部峰值

    A peak element is an element that is greater than its neighbors. Given an input array where num[i] ≠ ...

  5. LeetCode 162 Find Peak Element

    Problem: A peak element is an element that is greater than its neighbors. Given an input array where ...

  6. Find Peak Element

    A peak element is an element that is greater than its neighbors. Given an input array where num[i] ≠ ...

  7. [LintCode] Find Peak Element 求数组的峰值

    There is an integer array which has the following features: The numbers in adjacent positions are di ...

  8. BZOJ1798: [Ahoi2009]Seq 维护序列seq[线段树]

    1798: [Ahoi2009]Seq 维护序列seq Time Limit: 30 Sec  Memory Limit: 64 MBSubmit: 5504  Solved: 1937[Submit ...

  9. a chip multiprocessor

    COMPUTER OR GANIZATION AND ARCHITECTURE DESIGNING FOR PERFORMANCE NINTH EDITION A multicore computer ...

随机推荐

  1. IEEP部署企业级网络工程-OSPF邻居关系故障排除

    OSPF邻居关系故障-现象与排除 一.OSPF邻居关系故障-现象与排除 1.OSPF建立邻居关系时,将检验hello报文中的Area ID .Autype.Authentication.network ...

  2. phpstorm2017使用快捷键

    切换到的是NetBeans的皮肤: 1.在行添加一个书签, ctrl+鼠标左键 2.查找添加的书签, ctrl+shift+M 3.关闭项目 选择file->close project

  3. shell-day1

    shell概述:这里说的是命令行shell,例如"bash/sh/ksh/csh"(Unix/Linux系统).cmd.exe命令提示字符(windwos系统),这里主要介绍Uni ...

  4. 玩转Metasploit系列(第一集)

    "如果我有七个小时的时间来砍树,那么我一定会花6个小时来磨我的斧头." –Abraham Lincoln ??这句话一直引导着我做事的思路,而且从未改变过.这篇文章翻译自Offen ...

  5. 搞定INTEL快速存储技术(用SSD硬盘做缓存加速)

    给朋友买了个联想 ideapad s400超级本,还真是锻炼我的idea啊,原机不带WIN7系统,所以只好自己动手装WIN7,并打开24G SSD硬盘做缓存. 一.用常规方法GHOST了一个WIN7系 ...

  6. backtrack渗透测试中常用的命令总结

    ping 域名/ip 测试本机到远端主机是否联通. dig 域名/ip 查看域名解析的详细信息. host -l 域名 dns服务器 传输zone. 扫描 nmap: -sS 半开扫描TCP和SYN扫 ...

  7. Html5的本地储存 Web Storage

      Html5 中的存储包括两种:sessionStorage 和 localStorage   sessionStorage 用于本地存储一个会话(session)中的数据,这些数据只有在同一个会话 ...

  8. 【luogu P3366 最小生成树】 题解 Prim

    include include include include using namespace std; const int maxn = 505000; int n, m, dis[maxn], v ...

  9. UITableView控件Protocell的Identifier设置 注意事项

    1.  注意:如果想使用Subtitle类型的单元格,需在Storyboard中将Protocell设置为subtitle类型,且Protocell的identifier必须与ViewControll ...

  10. [转载]对iOS开发中内存管理的一点总结与理解

    对iOS开发中内存管理的一点总结与理解   做iOS开发也已经有两年的时间,觉得有必要沉下心去整理一些东西了,特别是一些基础的东西,虽然现在有ARC这种东西,但是我一直也没有去用过,个人觉得对内存操作 ...