ChIPseeker
ChIPseeker copied to clipboard
col parameter in plotAnnopie
when input col
parameter, plotAnnopie create an error
library(TxDb.Hsapiens.UCSC.hg19.knownGene)
files <- getSampleFiles()
txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene
peakAnno <- annotatePeak(files[[4]],
tssRegion=c(-3000, 3000),
TxDb=txdb, annoDb="org.Hs.eg.db")
nrow <- nrow(peakAnno@annoStat)
col <- c("#8dd3c7", "#ffffb3", "#bebada",
"#fb8072", "#80b1d3", "#fdb462",
"#b3de69", "#fccde5", "#d9d9d9",
"#bc80bd", "#ccebc5", "#ffed6f")
cols <- col[1:nrow]
plotAnnoPie(peakAnno,col = col[1:nrow])
come with following error
> plotAnnoPie(peakAnno,col = col[1:nrow])
Error in if (is.na(col)) { : the condition has length > 1
this bug come from https://github.com/YuLab-SMU/ChIPseeker/blob/6161ead8a0497b9d9302d6be114640094b68a39f/R/plotAnno.R#L86-L88
when the col parameter is inputed
> is.na(col[1:nrow])
[1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
the bug come from above
bug fix via 8f82281