我正在尝试解决为什么Drake
情节没有出现readd()
- 管道的其余部分似乎已经奏效。
不确定这是由其他原因引起的minfi::densityPlot
还是其他原因;我的想法是后者,因为它也不适用于barplot
基于 R 的功能。
在 RMarkdown 报告中,我在块中有readd(dplot1)
等,但输出是NULL
这是我R/setup.R
文件中的代码:
library(drake)
library(tidyverse)
library(magrittr)
library(minfi)
library(DNAmArray)
library(methylumi)
library(RColorBrewer)
library(minfiData)
pkgconfig::set_config("drake::strings_in_dots" = "literals") # New file API
# Your custom code is a bunch of functions.
make_beta <- function(rgSet){
rgSet_betas = minfi::getBeta(rgSet)
}
make_filter <- function(rgSet){
rgSet_filtered = DNAmArray::probeFiltering(rgSet)
}
这是我的R/plan.R
文件:
# The workflow plan data frame outlines what you are going to do
plan <- drake_plan(
baseDir = system.file("extdata", package = "minfiData"),
targets = read.metharray.sheet(baseDir),
rgSet = read.metharray.exp(targets = targets),
mSetSq = preprocessQuantile(rgSet),
detP = detectionP(rgSet),
dplot1 = densityPlot(rgSet, sampGroups=targets$Sample_Group,main="Raw", legend=FALSE),
dplot2 = densityPlot (getBeta (mSetSq), sampGroups=targets$Sample_Group, main="Normalized", legend=FALSE),
pal = RColorBrewer::brewer.pal (8,"Dark2"),
dplot3 = barplot (colMeans (detP[,1:6]), col=pal[ factor (targets$Sample_Group[1:6])], las=2, cex.names=0.8, ylab="Mean detection p-values"),
report = rmarkdown::render(
knitr_in("report.Rmd"),
output_file = file_out("report.html"),
quiet = TRUE
)
)
使用后make(plan)
看起来一切都很顺利:
config <- drake_config(plan)
vis_drake_graph(config)
我可以用来loadd()
加载这些绘图之一所需的对象,然后制作绘图,如下所示:
loadd(rgSet)
loadd(targets)
densityPlot(rgSet, sampGroups=targets$Sample_Group,main="Raw", legend=FALSE)
但是readd()
命令不起作用?
.html
for dplot3中的输出看起来很奇怪......