用DiffBind自带数据包做ChIP SEQ差异分析

在做完peak calling之后,我们就可以做样品间的差异分析了,常用的包是DiffBind,现在,先用自带的数据包做一个差异分析。

一、加载软件

1
2
library(DiffBind)
library(tidyverse)

二、工作路径

1
2
3
4
5
6
7
setwd(system.file("extra", package="DiffBind")) # 设置工作路径,在软件包DiffBind下的extra文件夹;
list.files() # 这是工作目录,其中,peaks和testdata是文件夹;
[1] "config.csv" "peaks" "tamoxifen.csv"
[4] "tamoxifen_allfields.csv" "tamoxifen_GEO.csv" "tamoxifen_GEO.R"
[7] "testdata"
getwd()
[1] "C:/Users/***/Documents/R/win-library/3.6/DiffBind/extra"

三、样品信息与文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
> read.csv("tamoxifen.csv")
SampleID Tissue Factor Condition Treatment Replicate bamReads ControlID bamControl
1 BT4741 BT474 ER Resistant Full-Media 1 reads/Chr18_BT474_ER_1.bam BT474c reads/Chr18_BT474_input.bam
2 BT4742 BT474 ER Resistant Full-Media 2 reads/Chr18_BT474_ER_2.bam BT474c reads/Chr18_BT474_input.bam
3 MCF71 MCF7 ER Responsive Full-Media 1 reads/Chr18_MCF7_ER_1.bam MCF7c reads/Chr18_MCF7_input.bam
4 MCF72 MCF7 ER Responsive Full-Media 2 reads/Chr18_MCF7_ER_2.bam MCF7c reads/Chr18_MCF7_input.bam
5 MCF73 MCF7 ER Responsive Full-Media 3 reads/Chr18_MCF7_ER_3.bam MCF7c reads/Chr18_MCF7_input.bam
6 T47D1 T47D ER Responsive Full-Media 1 reads/Chr18_T47D_ER_1.bam T47Dc reads/Chr18_T47D_input.bam
7 T47D2 T47D ER Responsive Full-Media 2 reads/Chr18_T47D_ER_2.bam T47Dc reads/Chr18_T47D_input.bam
8 MCF7r1 MCF7 ER Resistant Full-Media 1 reads/Chr18_TAMR_ER_1.bam TAMRc reads/Chr18_TAMR_input.bam
9 MCF7r2 MCF7 ER Resistant Full-Media 2 reads/Chr18_TAMR_ER_2.bam TAMRc reads/Chr18_TAMR_input.bam
10 ZR751 ZR75 ER Responsive Full-Media 1 reads/Chr18_ZR75_ER_1.bam ZR75c reads/Chr18_ZR75_input.bam
11 ZR752 ZR75 ER Responsive Full-Media 2 reads/Chr18_ZR75_ER_2.bam ZR75c reads/Chr18_ZR75_input.bam
Peaks PeakCaller
1 peaks/BT474_ER_1.bed.gz bed
2 peaks/BT474_ER_2.bed.gz bed
3 peaks/MCF7_ER_1.bed.gz bed
4 peaks/MCF7_ER_2.bed.gz bed
5 peaks/MCF7_ER_3.bed.gz bed
6 peaks/T47D_ER_1.bed.gz bed
7 peaks/T47D_ER_2.bed.gz bed
8 peaks/TAMR_ER_1.bed.gz bed
9 peaks/TAMR_ER_2.bed.gz bed
10 peaks/ZR75_ER_1.bed.gz bed
11 peaks/ZR75_ER_2.bed.gz bed

> list.files("peaks")
[1] "BT474_ER_1.bed.gz" "BT474_ER_2.bed.gz" "MCF7_ER_1.bed.gz"
[4] "MCF7_ER_2.bed.gz" "MCF7_ER_3.bed.gz" "T47D_ER_1.bed.gz"
[7] "T47D_ER_2.bed.gz" "TAMR_ER_1.bed.gz" "TAMR_ER_2.bed.gz"
[10] "ZR75_ER_1.bed.gz" "ZR75_ER_2.bed.gz"

dba函数用于创建DBA(Differential Binding Affinity)对象

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
> ta <- dba(sampleSheet="tamoxifen.csv")
BT4741 BT474 ER Resistant Full-Media 1 bed
BT4742 BT474 ER Resistant Full-Media 2 bed
MCF71 MCF7 ER Responsive Full-Media 1 bed
MCF72 MCF7 ER Responsive Full-Media 2 bed
MCF73 MCF7 ER Responsive Full-Media 3 bed
T47D1 T47D ER Responsive Full-Media 1 bed
T47D2 T47D ER Responsive Full-Media 2 bed
MCF7r1 MCF7 ER Resistant Full-Media 1 bed
MCF7r2 MCF7 ER Resistant Full-Media 2 bed
ZR751 ZR75 ER Responsive Full-Media 1 bed
ZR752 ZR75 ER Responsive Full-Media 2 bed

> ta
11 Samples, 2845 sites in matrix (3795 total): # 在11个样品中,总计3795个unique peaks,其中,2602个sites overlap in at least two of the samples
ID Tissue Factor Condition Treatment Replicate Caller Intervals
1 BT4741 BT474 ER Resistant Full-Media 1 bed 1080
2 BT4742 BT474 ER Resistant Full-Media 2 bed 1122
3 MCF71 MCF7 ER Responsive Full-Media 1 bed 1556
4 MCF72 MCF7 ER Responsive Full-Media 2 bed 1046
5 MCF73 MCF7 ER Responsive Full-Media 3 bed 1339
6 T47D1 T47D ER Responsive Full-Media 1 bed 527
7 T47D2 T47D ER Responsive Full-Media 2 bed 373
8 MCF7r1 MCF7 ER Resistant Full-Media 1 bed 1438
9 MCF7r2 MCF7 ER Resistant Full-Media 2 bed 930
10 ZR751 ZR75 ER Responsive Full-Media 1 bed 2346
11 ZR752 ZR75 ER Responsive Full-Media 2 bed 2345

> names(ta)
[1] "config" "chrmap" "peaks" "class" "masks"
[6] "samples" "called" "totalMerged" "merged" "binding"
[11] "attributes" "minOverlap"
  • 本文作者:括囊无誉
  • 本文链接: CHIPSEQ/chip_diffBind/
  • 版权声明: 本博客所有文章均为原创作品,转载请注明出处!
------ 本文结束 ------
坚持原创文章分享,您的支持将鼓励我继续创作!