学习使用用 tackPlotR可视化Bigwig

本篇数据完全来源公众号“老俊俊的生信笔记”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"

)

```


©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容