6 Fig5
::opts_chunk$set(warning=FALSE, message=FALSE) knitr
suppressMessages(library(ggplot2))
options(stringsAsFactors = F)
= read.table('data/hela-hic-rDNA')
hic = read.table('data/hela-nhic-rDNA')
nhic = read.table('data/hela-hic-actd-rDNA')
hic_actd = read.table('data/hela-nhic-actd-rDNA') nhic_actd
6.1 Fig 5A
= data.frame(hic=dim(hic)[1]/303984633*4*10^8,hic_actd=dim(hic_actd)[1]/171680362*4*10^8,
counts nhic=dim(nhic)[1]/332710486*4*10^8,nhic_actd=dim(nhic_actd)[1]/333186514*4*10^8)
barplot(as.matrix(counts), main="",
xlab="", col=c("#2BA809","#F97164"),
beside=T,ylim=c(0,3000000),ylab = 'Total interactions with rDNA')
6.2 Fig 5B
= data.frame(hic=c(dim(hic[hic$V3==hic$V7,])[1],dim(hic[hic$V3!=hic$V7,])[1])/dim(hic)[1],hic_actd=c(dim(hic_actd[hic_actd$V3==hic_actd$V7,])[1],dim(hic_actd[hic_actd$V3!=hic_actd$V7,])[1])/dim(hic_actd)[1],nhic=c(dim(nhic[nhic$V3==nhic$V7,])[1],dim(nhic[nhic$V3!=nhic$V7,])[1])/dim(nhic)[1],nhic_actd=c(dim(nhic_actd[nhic_actd$V3==nhic_actd$V7,])[1],dim(nhic_actd[nhic_actd$V3!=nhic_actd$V7,])[1])/dim(nhic_actd)[1])
counts barplot(as.matrix(counts), main="",
xlab="", col=c("#0F7CF4","#CC5C54"),
beside=F,ylab = 'Proportion of cis/trans interactions with rDNA')
6.3 Fig 5C
= read.table('data/nhic')
hela_rDNA_hotspot = read.table('data/nhic_actd')
hela_rDNA_hotspot.ActD = matrix(rep(0,46),nrow = 2,ncol = 23)
hotspot.matrix = read.table('chr_info')
chr_info for(chrom_index in c(1:22)){
= paste0('chr',chrom_index)
chrom_name = hela_rDNA_hotspot[hela_rDNA_hotspot$V1==chrom_name,]
chrom.hotspot.table = hela_rDNA_hotspot.ActD[hela_rDNA_hotspot.ActD$V1==chrom_name,]
chrom.hotspot.ActD.table 1,chrom_index] = sum(chrom.hotspot.table[,3] - chrom.hotspot.table[,2]) / chr_info[chr_info$V1==chrom_name,2]
hotspot.matrix[2,chrom_index] = sum(chrom.hotspot.ActD.table[,3] - chrom.hotspot.ActD.table[,2]) / chr_info[chr_info$V1==chrom_name,2]
hotspot.matrix[
}par(mar=c(3,3,2,1),family="Arial",font=1)
barplot(hotspot.matrix,beside = T,col=c("#42B256","#CC5C55"),border = F,space = c(0,0.8),width = 5,xaxt="n",yaxt="n",ylim=c(0,0.001))
axis(side = 2,at=seq(0,0.001,0.0005),labels = F,cex.axis=2,lwd=1,tck=-0.05)
6.4 Fig 5D
= read.table('data/hic_gene_count')
t = t[t$V5>10,]
t row.names(t) = paste0(t$V1,':',t$V2,'-',t$V3,'-',t$V4)
$id = row.names(t)
t= read.table('data/nhic_gene_count')
tt = tt[tt$V5>20,]
tt row.names(tt) = paste0(tt$V1,':',tt$V2,'-',tt$V3,'-',tt$V4)
$id = row.names(tt)
tt= read.table('DEG2',row.names = 1,header = T)
DEG2 = data.frame(log2FC = c(DEG2[unique(t$V4),2],DEG2[sample(1:12963,1205),2],DEG2[unique(tt$V4),2],DEG2[sample(1:12963,1782),2]),group = c(rep('Hi-C',1205), rep('Hic ActD',1205),rep('nhic',1782),rep('nhic_actd',1782)),dose = c(rep('Hi-C',1205*2),rep('nHi-C',1782*2)))
df library(ggplot2)
<- ggplot(df, aes(x=dose, y=log2FC, fill=group)) +
bp geom_boxplot(width=0.4)+
scale_fill_manual(values=c("#2BA809", "#4D4D51","#2BA809", "#4D4D51"))+
labs(title="",x="", y = "log2FoldChange(ActD/Ctrl)")+ylim(-5,5)
+ theme_classic()+theme(legend.position = 'none') bp