本篇數(shù)據(jù)完全來源公眾號“老俊俊的生信筆記”XCEL
數(shù)據(jù)來自參考文檔: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
```
參考鏈接:http://www.reibang.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"
)
```