Entering edit mode
John
▴
30
@john-9676
Last seen 6.5 years ago
dds = makeExampleDESeqDataSet(betaSD=1) vsd = varianceStabilizingTransformation(dds) p = plotPCA(vsd) print(p) ## Add text labels (for presentation graphics, consider additional ## layout operations that avoid overplotting, such as the FField package on CRAN) names = colData(vsd)$sample p = update(p, panel = function(x, y, ...) { lattice::panel.xyplot(x, y, ...); lattice::ltext(x=x, y=y, labels=names, pos=1, offset=1, cex=0.8) }) print(p)
This doesn't work:
Error in update.default(p, panel = function(x, y, ...) { :
need an object with call component
How can I make this work?
Thank you for the help.
J.
A quick answer would be something like this:
Thanks Mike.
Also for others viewing the thread, if you get stuck trying to customize this plot, you can also directly use ggplot().
In the DESeq2 vignette search for the text: "It is also possible to customize the PCA plot using the ggplot function."