Skip to content

Commit

Permalink
allow DESeq, DataFrame objs as annot
Browse files Browse the repository at this point in the history
  • Loading branch information
mschubert committed Feb 12, 2025
1 parent ab2eb1e commit ed93cfc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plot/pca.r
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ pca.prcomp = function(obj, aes, annot=NULL, repel=TRUE,
aes$x = quote(PC1)
if (!"y" %in% names(aes))
aes$y = quote(PC2)
if (inherits(annot, "DESeqDataSet") || inherits(annot, "DESeqTransform"))
annot = SummarizedExperiment::colData(annot)
if (inherits(annot, "DataFrame"))
annot = as.data.frame(annot)

# adapted: https://stackoverflow.com/questions/6578355/plotting-pca-biplot-with-ggplot2
data = as.data.frame(cbind(annot, obj$x))
Expand Down

0 comments on commit ed93cfc

Please sign in to comment.