引言
有用户在使用了 omicScope 的 coverage_plot 提了建议,然后进行了补充和优化。
支持 bigwig 数据。
显示 UTR 区域。
高亮显示特定区域。
安装
Install from GitHub
if (!requireNamespace(“devtools”, quietly = TRUE)) {
install.packages(“devtools”)
}
devtools::install_github(“junjunlab/omicScope”)
Or using pak (recommended)
if (!requireNamespace(“pak”, quietly = TRUE)) {
install.packages(“pak”)
}
pak::pak(“junjunlab/omicScope”)
示例
加入你有 bigwig 文件,下面进行绘图 Nanog 基因的信号分布:
library(omicScope)
gtf <- rtracklayer::import(“../../index-data/Mus_musculus.GRCm38.102.gtf.gz”)
coverage_plot(bw_file = c(“../7.bw-data/scrinput.bw”,”../7.bw-data/scrDinput.bw”),
sample_name = c(“dmso”,”treat”),
gtf_file = gtf,
target_gene = “Nanog”)
指定区间绘图:
coverage_plot(bw_file = c(“../7.bw-data/scrinput.bw”,”../7.bw-data/scrDinput.bw”),
sample_name = c(“dmso”,”treat”),
gtf_file = gtf,
target_region = “5:76176615-76376575”)
上面你可以看到 UTR 区域比 CDS 区域线会细一些,你可以设置show_utr = FALSE 来关闭显示 UTR:
coverage_plot(bw_file = c(“../7.bw-data/scrinput.bw”,”../7.bw-data/scrDinput.bw”),
sample_name = c(“dmso”,”treat”),
gtf_file = gtf,
target_gene = “Nanog”,
show_utr = FALSE)
高亮区域,需要一个区间的数据框,这里比如我们高亮 Nanog 基因这几个外显子:
g <- data.frame(gtf) |>
dplyr::filter(gene_name == “Nanog” & type == “exon” & transcript_id == “ENSMUST00000012540”) |>
dplyr::arrange(dplyr::desc(width)) |>
dplyr::select(seqnames,start,end) |>
dplyr::mutate(type = factor(1:n()))
g
seqnames start end type
1 6 122713142 122714633 1
2 6 122707568 122707933 2
3 6 122711538 122711803 3
4 6 122712629 122712715 4
绘图:
coverage_plot(bam_file = c(“scrinput.bam”,”scrinput.bam”),
sample_name = c(“dmso”,”treat”),
gtf_file = gtf,
target_gene = “Nanog”,
highlight_region = g)
修改颜色:
coverage_plot(bam_file = c(“scrinput.bam”,”scrDinput.bam”),
sample_name = c(“dmso”,”treat”),
gtf_file = gtf,
target_gene = “Nanog”,
highlight_region = g,
highlight_col_aes = “type”)
结尾
路漫漫其修远兮,吾将上下而求索。
欢迎加入生信交流群。加我微信我也拉你进 微信群聊老俊俊生信交流群(微信交流群需收取 20 元入群费用,一旦交费,拒不退还!(防止骗子和便于管理)) 。
声明:来自老俊俊的生信笔记,仅代表创作者观点。链接:https://eyangzhen.com/3796.html
 
                
 
                                     
                                     
                                 
                                