library('SummarizedExperiment')
res <- quantify(faahko, value = "into", method = "sum")
res
rowData(res)
colData(res)
assayNames(res)
assay(res) |> head()
ssays(res)$raw_nofill <- featureValues(faahko, filled = FALSE, method = "sum")
## Extract the features and log2 transform them
ft_ints <- log2(assay(res, "raw"))
## Perform the PCA omitting all features with an NA in any of the
## samples. Also, the intensities are mean centered.
pc <- prcomp(t(na.omit(ft_ints)), center = TRUE)
## Plot the PCA
pcSummary <- summary(pc)
par(mfrow = c(1, 1),mar = c(4.5, 4.2, 1, 4))
plot(pc$x[, 1], pc$x[,2], pch = 21, main = "",
xlab = paste0("PC1: ", format(pcSummary$importance[2, 1] * 100,
digits = 3), " % variance"),
ylab = paste0("PC2: ", format(pcSummary$importance[2, 2] * 100,
digits = 3), " % variance"),
col = "darkgrey", bg = sample_colors, cex = 2)
grid()
text(pc$x[, 1], pc$x[,2], labels = res$sample_name, col = "darkgrey",
pos = 3, cex = 2)
PCA plot
网友评论