knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE ) resultsV2 <- params$resultsxx parameterV2 <- params$parametersxx
Cluster profiling aims to group the proteins based on protein expression information. More biological conditions in your dataset lead to more informative clusterings.
if (nrow(resultsV2$prot$factors()) < 8){ cat('<font color="red">WARNING: the number of samples in your dataset is less than 8, possibly because the number of conditions is low.\n Although the clustering algorithm will still produce clusters, these will arise because of random correlation among the proteins.</font>\n\n') } else cat("") if (resultsV2$nrCluster == 1 || resultsV2$dataDims["nrPortNoNas"] < 2000){ cat('<font color="red">WARNING: be aware that the clustering algorithm can not explain all data variability, if the number of proteins is not enough to get statistically significant results.\n If the clustering results do not discriminate between the expected classes consider to increase the number of proteins if possible.</font>\n\n') } else cat("")
r parameter$projectID
r as.character(parameter$workunitID)
r basename(parameterV2$inputMQfile)
r parameterV2$clustering
r resultsV2$dataDims["nrPort"]
r resultsV2$dataDims["nrPortNoNas"]
r resultsV2$dataDims["UniprotExtract"]
r resultsV2$dataDims["ENTREZGENEID"]
r nrow(resultsV2$prot$factors())
r resultsV2$nrCluster
r resultsV2$nr.of.GS.025
r resultsV2$nr.of.GS.01
r resultsV2$CV.50
r resultsV2$SD.50
r resultsV2$id.mapping.service
prot <- resultsV2$prot pl <- prot$get_Plotter() pl$intensity_distribution_density() pNa <- pl$NA_heatmap() p <- pl$heatmap() pc <- pl$heatmap_cor()
print(pNa)
print(p)
pl$pca()
isclust <- if(resultsV2$nrCluster > 1) {TRUE} else {FALSE} validScaledM <- if(nrow(resultsV2$scaledM) > 1) {TRUE} else {FALSE}
plot(resultsV2$dendrogram, leaflab = "none" )
scaledM <- resultsV2$scaledM bb <- as_tibble(scaledM,rownames = "protein_Id") bb <- bb %>% pivot_longer(-"protein_Id", names_to = "sampleName", values_to = "transformedIntensity") toplot <- inner_join(resultsV2$clusterAssignment, bb) neword <- labels(as.dendrogram(stats::hclust(dist(t(scaledM))))) toplot$sampleName <- fct_relevel(toplot$sampleName, neword) ggplot(toplot, aes(x = sampleName,y = transformedIntensity, group = protein_Id)) + geom_line(color = "lightgrey") + theme_bw() + theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1)) + facet_wrap(~Cluster)
figWIncrease <- 0.5 figHeightIncrease <- 0.2 P <- resultsV2$resGOEnrich$BP figwidth <- 10 figheight <- 5 if (!is.null(P$clustProf)) { dt <- as.data.frame(P$clustProf) nrOra <- min(10, length(unique(dt$ID))) nrClust <- length(unique(dt$Cluster)) figwidth <- max(figwidth, 6 + nrClust*figWIncrease) figheight <- max(figheight, 3 + nrClust*nrOra*figHeightIncrease) } print(c(figwidth,figheight)) isthere <- !is.null(P$clustProf)
clusterProfiler::dotplot(P$clustProf, title = P$mt, showCategory = nrOra)
DT::datatable(as.data.frame(P$clustProf),caption = mt)
P <- resultsV2$resGOEnrich$MF figwidth <- 10 figheight <- 5 if (!is.null(P$clustProf)) { dt <- as.data.frame(P$clustProf) nrOra <- min(10,length(unique(dt$ID))) nrClust <- length(unique(dt$Cluster)) figwidth <- max(figwidth, 6 + nrClust*figWIncrease) figheight <- max(figheight, 3 + nrClust*nrOra*figHeightIncrease) } isthere <- !is.null(P$clustProf)
print(nrOra) dotplot(P$clustProf,title = P$mt, showCategory = nrOra)
DT::datatable(as.data.frame(P$clustProf),caption = mt)
P <- resultsV2$resGOEnrich$CC figwidth <- 10 figheight <- 5 if (!is.null(P$clustProf)) { dt <- as.data.frame(P$clustProf) nrOra <- min(10,length(unique(dt$ID))) nrClust <- length(unique(dt$Cluster)) figwidth <- max(figwidth, 6 + nrClust*figWIncrease) figheight <- max(figheight, 3 + nrClust*nrOra*figHeightIncrease) } isthere <- !is.null(P$clustProf)
dotplot(P$clustProf,title = P$mt, showCategory = nrOra)
DT::datatable(as.data.frame(P$clustProf),caption = mt)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.