run track_plot function but return NULL
ChaoXu1997 opened this issue · 1 comments
ChaoXu1997 commented
This is my code
source("https://hub.fastgit.org/PoisonAlien/trackplot/blob/master/R/trackplot.R?raw=true")
# 安装
# devtools::install_github(repo = "poisonalien/trackplot")
# library(trackplot)
#Path to bigWig files
#bigWigs = file.path("./bw",list.files("./bw"))
bigWigs = file.path("./bw",list.files("./bw/",pattern = "IP"))
bigWigs
#Step-1. Extract the siganl for your loci of interst
?track_extract
track_data = track_extract(bigWigs = bigWigs, loci = "chrX:125,042,879-125,055,766")
track_data = track_extract(bigWigs = bigWigs, loci = "3:187,715,903-187,752,003")
#Step-1a (optional). Summarize trcks by condition
library(stringr)
library(dplyr)
condation <- list.files("./bw/",pattern = "IP")
condation <- str_split(condation,"\\.",simplify = T)[,1]
condation
?track_summarize
track_data = track_summarize(summary_list = track_data, condition = condation, stat = "median")
#Heighlight regions of interest
markregions = data.frame(
#chr = c("chrX"),
# start = c(125036101),
# end = c(125036943),
# name = c("Differentially methylated RNA region")
)
# Plot
#ERROR 1146 (42S02) at line 1: Table 'susScr11.cytoBand' doesn't exist
?track_plot
track_plot(summary_list = track_data)
gtf_path <- "./Sus_scrofa.Sscrofa11.1.95_UCSC.gtf"
p <- track_plot(
summary_list = track_data,
# draw_gene_track = TRUE,
# #show_ideogram = TRUE,
gene_model = gtf_path, isGTF = TRUE,
# regions = markregions
)
ggplot2::ggsave(p,filename = "./p.pdf")
print(p)
#NULL
PoisonAlien commented
Hi,
All the plots are generated with base graphics. You can not store or save them like ggplot.