本篇数据完全来源公众号“老俊俊的生信笔记”XCEL
数据来自参考文档:https://github.com/junjunlab/tackPlotR/wiki
#下载参考基因组
下载地址:
```
wget http://ftp.ensembl.org/pub/release-102/fasta/mus_musculus/dna/Mus_musculus.GRCm38.dna.primary_assembly.fa.gz
wget http://ftp.ensembl.org/pub/release-102/gtf/mus_musculus/Mus_musculus.GRCm38.102.gtf.gz
#不能使用压缩格式的基因组和注释,先解压
gunzip Mus_musculus.GRCm38.102.gtf.gz Mus_musculus.GRCm38.dna.primary_assembly.fa.gz
```
参考链接:https://www.jianshu.com/p/ca6aada5cbf1
#
```{R}
install.packages("devtools")
devtools::install_github("dzhang32/ggtranscript")
devtools::install_github('junjunlab/tackPlotR')
library(tackPlotR)
library(ggsci)
library(rtracklayer)
# 1.load gtf
gtf <- import.gff('Mus_musculus.GRCm38.102.gtf') %>%
data.frame()
# help
?loadBWfile
file <- c(
"control.input.bw", "control.ip.bw",
"t1.input.bw", "t1.ip.bw",
"t2.input.bw", "t2.ip.bw"
)
samp <- c(
"control.input", "control.ip",
"t1.input", "t1.ip",
"t2.input", "t2.ip"
)
group1 <- c(rep(c("Input", "IP"), 3))
group2 <- c(rep("Control", 2), rep("T1", 2), rep("T2", 2))
# 2.load bw files
allBw <- loadBWfile(file = file, sample = samp, group1 = group1, group2 = group2)
# check
head(allBw,3)
# seqnames start end score sample group1 group2
# 1 1 1 3001485 0.0000 control.input Input Control
# 2 1 3001486 3001490 12.5599 control.input Input Control
# 3 1 3001491 3001510 25.1199 control.input Input Control
plotTrack(
gtfFile = gtf,
gene = "Actb",
arrowCol = "black",
bigwigFile = allBw,
sampleAes = "group1",
facetVars = "sample"
)
```