for (j in 1:max(clusterindex)) { tmp <- dat[clusterindex == j, ] tmpmem <- memship[clusterindex == j, j] if (((j - 1)%%(mfrow[1] * mfrow[2])) == 0) { if (!is.na(filename)) { pdf(filename, height=3*mfrow[1],width=3*mfrow[2]) } par(mfrow = mfrow, cex=0.5) if (sum(clusterindex == j) == 0) { ymin <- -1 ymax <- +1 } else { ymin <- min(tmp) ymax <- max(tmp) } plot.default(x = NA, xlim = c(1, dim(dat)[[2]]), ylim = c(ymin, ymax), xlab = xlab, ylab = ylab, main = paste("Cluster", j), axes = FALSE) if (missing(time.labels)) { axis(1, 1:dim(dat)[[2]], c(1:dim(dat)[[2]])) axis(2) } else { axis(1, 1:dim(dat)[[2]], time.labels) axis(2) } } else { if (sum(clusterindex == j) == 0) { ymin <- -1 ymax <- +1 } else { ymin <- min(tmp) ymax <- max(tmp) } plot.default(x = NA, xlim = c(1, dim(dat)[[2]]), ylim = c(ymin, ymax), xlab = xlab, ylab = ylab, main = paste("Cluster", j), axes = FALSE) if (missing(time.labels)) { axis(1, 1:dim(dat)[[2]], c(1:dim(dat)[[2]])) axis(2) } else { axis(1, 1:dim(dat)[[2]], time.labels) axis(2) } } if (!(sum(clusterindex == j) == 0)) { for (jj in 1:(length(colorseq) - 1)) { tmpcol <- (tmpmem >= colorseq[jj] & tmpmem <= colorseq[jj + 1]) if (sum(tmpcol, na.rm=T) > 0) { tmpind <- which(tmpcol) for (k in 1:length(tmpind)) { lines(tmp[tmpind[k], ], col = colo[jj]) } } } } } if (!is.na(filename)) dev.off() } ## Plot results mfuzz.plot(tData,cl=Bestcl,mfrow=c(round(sqrt(NClust)),ceiling(sqrt(NClust))),min.mem=0.5,colo="fancy") library(vsclust) knitr::opts_chunk$set(echo = TRUE) library(vsclust) require(yaml) require(shiny) require(clusterProfiler) #### Input parameters, only read when now parameter file was provided ##### # All principal parameters for running VSClust can be defined as in the shiny app at computproteomics.bmb.sdu.dk/Apps/VSClust Experiment <- "ProtExample" ## name of study NumReps <- 3###886 ## Number of replicates per NumCond <- 4###12 ## Number of different experimental conditions (e.g. time points) isPaired <- F ## Paired or unpaired statistical tests cores <- 4#4 # Number of cores to use ## 1 is for windows PreSetNumClustVSClust <- 0 # If 0, then automatically take the one from Minimum Centroid Distance PreSetNumClustStand <- 0 # If 0, then automatically take the one from Minimum Centroid Distance maxClust <- 10 ## max. number of clusters when estimating the number of clusters dat <- read.csv(system.file("extdata/ProtExample.csv",package="vsclust"),row.names=1,header=T) dat <- dat[rownames(dat)!="",] #### running statistical analysis and estimation of individual variances statOut <- statWrapper(dat, NumReps, NumCond, isPaired, T) dat <- statOut$dat Sds <- dat[,ncol(dat)] print(paste("Features:",nrow(dat),"<br/>Missing values:", sum(is.na(dat)),"<br/>Median standard deviations:", round(median(Sds,na.rm=T),digits=3))) ## Write output into file write.csv(statOut$statFileOut,paste("",Experiment,"statFileOut.csv",sep="")) #### Estimate number of clusters with maxClust as maximum number clusters to test for clustNumOut <- estimClustNum(dat, maxClust, cores) #### Use estimate cluster number or use own if (PreSetNumClustVSClust == 0) PreSetNumClustVSClust <- clustNumOut$numclust if (PreSetNumClustStand == 0) PreSetNumClustStand <- clustNumOut$numclust ## Create pdf-figure of validation indices "minimum centroid distance" and "Xie-Beni index" #pdf(paste(Experiment,"EstimatedClustNumber.pdf", sep=""),height=6,width=15) print(clustNumOut$p) #dev.off() #### Run clustering (VSClust and standard fcm clustering ClustOut <- runClustWrapper(dat, PreSetNumClustVSClust, proteins, VSClust=T, cores) #### Run clustering (VSClust and standard fcm clustering ClustOut <- runClustWrapper(dat, PreSetNumClustVSClust, proteins, VSClust=T, cores) proteins #### Run clustering (VSClust and standard fcm clustering ClustOut <- runClustWrapper(dat, PreSetNumClustVSClust, NULL, VSClust=T, cores) roxygen2::roxygenize(clean=T) library(vsclust) runClustWrapper knitr::opts_chunk$set(echo = TRUE) library(vsclust) require(yaml) require(shiny) require(clusterProfiler) #### Input parameters, only read when now parameter file was provided ##### # All principal parameters for running VSClust can be defined as in the shiny app at computproteomics.bmb.sdu.dk/Apps/VSClust Experiment <- "ProtExample" ## name of study NumReps <- 3###886 ## Number of replicates per NumCond <- 4###12 ## Number of different experimental conditions (e.g. time points) isPaired <- F ## Paired or unpaired statistical tests cores <- 4#4 # Number of cores to use ## 1 is for windows PreSetNumClustVSClust <- 0 # If 0, then automatically take the one from Minimum Centroid Distance PreSetNumClustStand <- 0 # If 0, then automatically take the one from Minimum Centroid Distance maxClust <- 10 ## max. number of clusters when estimating the number of clusters dat <- read.csv(system.file("extdata/ProtExample.csv",package="vsclust"),row.names=1,header=T) dat <- dat[rownames(dat)!="",] #### running statistical analysis and estimation of individual variances statOut <- statWrapper(dat, NumReps, NumCond, isPaired, T) dat <- statOut$dat Sds <- dat[,ncol(dat)] print(paste("Features:",nrow(dat),"<br/>Missing values:", sum(is.na(dat)),"<br/>Median standard deviations:", round(median(Sds,na.rm=T),digits=3))) ## Write output into file write.csv(statOut$statFileOut,paste("",Experiment,"statFileOut.csv",sep="")) #### Estimate number of clusters with maxClust as maximum number clusters to test for clustNumOut <- estimClustNum(dat, maxClust, cores) #### Use estimate cluster number or use own if (PreSetNumClustVSClust == 0) PreSetNumClustVSClust <- clustNumOut$numclust if (PreSetNumClustStand == 0) PreSetNumClustStand <- clustNumOut$numclust ## Create pdf-figure of validation indices "minimum centroid distance" and "Xie-Beni index" #pdf(paste(Experiment,"EstimatedClustNumber.pdf", sep=""),height=6,width=15) print(clustNumOut$p) #dev.off() #### Run clustering (VSClust and standard fcm clustering ClustOut <- runClustWrapper(dat, PreSetNumClustVSClust, NULL, VSClust=T, cores) Bestcl <- ClustOut$Bestcl ClustOut$p ## Write clustering results (VSClust) write.csv(data.frame(cluster=Bestcl$cluster,ClustOut$outFileClust,isClusterMember=rowMaxs(Bestcl$membership)>0.5,maxMembership=rowMaxs(Bestcl$membership), Bestcl$membership), paste(Experiment, "FCMVarMResults", Sys.Date(), ".csv", sep="")) ## Write coordinates of cluster centroids write.csv(Bestcl$centers, paste(Experiment,"FCMVarMResultsCentroids", Sys.Date(), ".csv", sep="")) ## Write pdf-figure of clusters #pdf(paste(Experiment,"FCMVarMResults", Sys.Date(), ".pdf", sep=""),height=5*round(sqrt(PreSetNumClustVSClust)),width=5*ceiling(sqrt(PreSetNumClustVSClust))) print(ClustOut$p) #dev.off() # print(ClustOut$ClustInd) ClustOut <- runClustWrapper(dat, PreSetNumClustStand, proteins, VSClust=F, cores) proteins ClustOut <- runClustWrapper(dat, PreSetNumClustStand, NULL, VSClust=F, cores) ClustOut <- runClustWrapper(dat, PreSetNumClustStand, NULL, VSClust=F, cores) Bestcl <- ClustOut$Bestcl ClustOut$p ## Write clustering results (standard fcm) write.csv(data.frame(cluster=Bestcl$cluster,ClustOut$outFileClust,isClusterMember=rowMaxs(Bestcl$membership)>0.5,maxMembership=rowMaxs(Bestcl$membership), Bestcl$membership), paste(Experiment, "FCMResults", Sys.Date(), ".csv", sep="")) ## Write coordinates of cluster centroids write.csv(Bestcl$centers, paste(Experiment,"FCMResultsCentroids", Sys.Date(), ".csv", sep="")) ## Write pdf-figure of clusters #pdf(paste(Experiment,"FCMResults", Sys.Date(), ".pdf", sep=""),height=5*round(sqrt(PreSetNumClustStand)),width=5*ceiling(sqrt(PreSetNumClustStand))) print(ClustOut$p) ClustOut$p ## Write pdf-figure of clusters #pdf(paste(Experiment,"FCMVarMResults", Sys.Date(), ".pdf", sep=""),height=5*round(sqrt(PreSetNumClustVSClust)),width=5*ceiling(sqrt(PreSetNumClustVSClust))) ClustOut$p ClustOut <- runClustWrapper(dat, PreSetNumClustStand, NULL, VSClust=F, cores) ClustOut <- runClustWrapper(dat, PreSetNumClustStand, NULL, VSClust=F, cores) Bestcl <- ClustOut$Bestcl ClustOut$p ## Write clustering results (standard fcm) write.csv(data.frame(cluster=Bestcl$cluster,ClustOut$outFileClust,isClusterMember=rowMaxs(Bestcl$membership)>0.5,maxMembership=rowMaxs(Bestcl$membership), Bestcl$membership), paste(Experiment, "FCMResults", Sys.Date(), ".csv", sep="")) ## Write coordinates of cluster centroids write.csv(Bestcl$centers, paste(Experiment,"FCMResultsCentroids", Sys.Date(), ".csv", sep="")) ## Write coordinates of cluster centroids write.csv(Bestcl$centers, paste(Experiment,"FCMResultsCentroids", Sys.Date(), ".csv", sep="")) ## Write pdf-figure of clusters #pdf(paste(Experiment,"FCMResults", Sys.Date(), ".pdf", sep=""),height=5*round(sqrt(PreSetNumClustStand)),width=5*ceiling(sqrt(PreSetNumClustStand))) print(Clus Out$p) #dev.off() print(ClustOut$ClustInd) knitr::opts_chunk$set(echo = TRUE) library(vsclust) require(yaml) require(shiny) require(clusterProfiler) #### Input parameters, only read when now parameter file was provided ##### # All principal parameters for running VSClust can be defined as in the shiny app at computproteomics.bmb.sdu.dk/Apps/VSClust Experiment <- "ProtExample" ## name of study NumReps <- 3###886 ## Number of replicates per NumCond <- 4###12 ## Number of different experimental conditions (e.g. time points) isPaired <- F ## Paired or unpaired statistical tests cores <- 4#4 # Number of cores to use ## 1 is for windows PreSetNumClustVSClust <- 0 # If 0, then automatically take the one from Minimum Centroid Distance PreSetNumClustStand <- 0 # If 0, then automatically take the one from Minimum Centroid Distance maxClust <- 10 ## max. number of clusters when estimating the number of clusters dat <- read.csv(system.file("extdata/ProtExample.csv",package="vsclust"),row.names=1,header=T) dat <- dat[rownames(dat)!="",] #### running statistical analysis and estimation of individual variances statOut <- statWrapper(dat, NumReps, NumCond, isPaired, T) dat <- statOut$dat Sds <- dat[,ncol(dat)] print(paste("Features:",nrow(dat),"<br/>Missing values:", sum(is.na(dat)),"<br/>Median standard deviations:", round(median(Sds,na.rm=T),digits=3))) ## Write output into file write.csv(statOut$statFileOut,paste("",Experiment,"statFileOut.csv",sep="")) #### Estimate number of clusters with maxClust as maximum number clusters to test for clustNumOut <- estimClustNum(dat, maxClust, cores) #### Use estimate cluster number or use own if (PreSetNumClustVSClust == 0) PreSetNumClustVSClust <- clustNumOut$numclust if (PreSetNumClustStand == 0) PreSetNumClustStand <- clustNumOut$numclust ## Create pdf-figure of validation indices "minimum centroid distance" and "Xie-Beni index" #pdf(paste(Experiment,"EstimatedClustNumber.pdf", sep=""),height=6,width=15) print(clustNumOut$p) #dev.off() #### Run clustering (VSClust and standard fcm clustering ClustOut <- runClustWrapper(dat, PreSetNumClustVSClust, NULL, VSClust=T, cores) Bestcl <- ClustOut$Bestcl ClustOut$p ## Write clustering results (VSClust) write.csv(data.frame(cluster=Bestcl$cluster,ClustOut$outFileClust,isClusterMember=rowMaxs(Bestcl$membership)>0.5,maxMembership=rowMaxs(Bestcl$membership), Bestcl$membership), paste(Experiment, "FCMVarMResults", Sys.Date(), ".csv", sep="")) ## Write coordinates of cluster centroids write.csv(Bestcl$centers, paste(Experiment,"FCMVarMResultsCentroids", Sys.Date(), ".csv", sep="")) ClustOut$p ClustOut <- runClustWrapper(dat, PreSetNumClustStand, NULL, VSClust=F, cores) Bestcl <- ClustOut$Bestcl ClustOut$p ## Write clustering results (standard fcm) write.csv(data.frame(cluster=Bestcl$cluster,ClustOut$outFileClust,isClusterMember=rowMaxs(Bestcl$membership)>0.5,maxMembership=rowMaxs(Bestcl$membership), Bestcl$membership), paste(Experiment, "FCMResults", Sys.Date(), ".csv", sep="")) ## Write coordinates of cluster centroids write.csv(Bestcl$centers, paste(Experiment,"FCMResultsCentroids", Sys.Date(), ".csv", sep="")) ClustOut$p ClustOut <- runClustWrapper(dat, PreSetNumClustStand, NULL, VSClust=F, cores) ClustOut <- runClustWrapper(dat, PreSetNumClustStand, NULL, VSClust=F, cores) Bestcl <- ClustOut$Bestcl ## Write clustering results (standard fcm) write.csv(data.frame(cluster=Bestcl$cluster,ClustOut$outFileClust,isClusterMember=rowMaxs(Bestcl$membership)>0.5,maxMembership=rowMaxs(Bestcl$membership), Bestcl$membership), paste(Experiment, "FCMResults", Sys.Date(), ".csv", sep="")) ## Write coordinates of cluster centroids write.csv(Bestcl$centers, paste(Experiment,"FCMResultsCentroids", Sys.Date(), ".csv", sep="")) #### Run clustering (VSClust and standard fcm clustering ClustOut <- runClustWrapper(dat, PreSetNumClustVSClust, NULL, VSClust=T, cores) Bestcl <- ClustOut$Bestcl #ClustOut$p ## Write clustering results (VSClust) write.csv(data.frame(cluster=Bestcl$cluster,ClustOut$outFileClust,isClusterMember=rowMaxs(Bestcl$membership)>0.5,maxMembership=rowMaxs(Bestcl$membership), Bestcl$membership), paste(Experiment, "FCMVarMResults", Sys.Date(), ".csv", sep="")) ## Write coordinates of cluster centroids write.csv(Bestcl$centers, paste(Experiment,"FCMVarMResultsCentroids", Sys.Date(), ".csv", sep="")) shiny::runApp('inst/shiny') data(Pima.tr2) # the data.frame is in the Pima.tr2 object dim(Pima.tr2) # add your code here: plot(Pima.tr2) library(MASS) data(DNase) a <- data(DNase) a a force(DNase) AirPassengers gene.values <- c(-0.156779906618839, -1.19258492462641, -0.584097898869027, -1.05973269590046, 0.241034604602436, 0.622092984491641, 0.429889283129897, 1.21134263252275) plot(gene.values) mean1 <- mean(gene.values[1:4]) mean2 <- mean(gene.values[5:8]) mean1 mean2 abline(h=mean1) abline(h=mean2) sd1 <- sd(gene.values[1:4]) sd1 <- sd(gene.values[5:8]) sd1 <- sd(gene.values[1:4]) sd2 <- sd(gene.values[5:8]) sd1 sd2 meansds <- mean(c(sd1, sd2)) t.val <- (mean1 - means2) * sqrt(16/8) / meansds t.val <- (mean1 - mean2) * sqrt(16/8) / meansds t.val x <- seq(-10,10,0.01) plot(x, dt(x, df=6)) plot(x, dt(x, df=6), type="L") plot(x, dt(x, df=6), type="l") plot(x, dt(x, df=6), type="l") abline(v=t.val) plot(x ,pt(x, df=6), type="l") pt(t.val, df=6) plot(gene.values) plot(x, dt(x, df=6), type="l") abline(v=t.val) abline(v=-t.val) 2 * pt(t.val, df=6) t.test(gene.values[1:4], gene.values[5:8], var.equal = T) data(ToothGrowth) ?ToothGrowth ToothGrowth sapply(ToothGrowth, class) ToothGrowth$dose <- as.factor(ToothGrowth$dose) interaction.plot(ToothGrowth$supp,ToothGrowth$dose,ToothGrowth$len) interaction.plot(ToothGrowth$dose,ToothGrowth$supp,ToothGrowth$len) plot(len ~ supp + dose, data=ToothGrowth) lm.out <- lm(len ~ supp + dose, data=ToothGrowth) summary(lm.out) lm.out <- lm(len ~ supp * dose, data=ToothGrowth) lm.out <- lm(len ~ supp + dose, data=ToothGrowth) summary(lm.out) lm.out_i <- lm(len ~ supp * dose, data=ToothGrowth) summary(lm.out_i) anova(lm.out, lm.out_i) library(vsclust) set.seed(0) data("artificial_clusters") dat <- averageCond(artificial_clusters, 5, 10) dat <- scale(dat) dat <- cbind(dat, 1) ClustInd <- estimClustNum(dat, 10) optimalClustNum(ClustInd, index="MinCentroidDist", method="VSClust") expect_equal(optimalClustNum(ClustInd, index="MinCentroidDist", method="VSClust"), 6) estimClust.plot(ClustInd) library(vsclust) ```{r echo=F} library(vsclust) require(yaml) require(shiny) require(clusterProfiler) require(matrixStats) ``` ## Initialization ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` knitr::opts_chunk$set(echo = TRUE) data(protein_expressions) dat <- protein_expressions #### running statistical analysis and estimation of individual variances statOut <- PreparedForVSClust(dat, NumReps, NumCond, isPaired, TRUE) #### Estimate number of clusters with maxClust as maximum number clusters to run #### the estimation with ClustInd <- estimClustNum(dat, maxClust, cores) #### Use estimate cluster number or use own if (PreSetNumClustVSClust == 0) PreSetNumClustVSClust <- optimalClustNum(ClustInd) if (PreSetNumClustStand == 0) PreSetNumClustStand <- optimalClustNum(ClustInd, method="FCM") #### Visualize estimClust.plot(ClustInd) ClustInd par(mfrow=c(1,3)) maxClust <- ncol(ClustInd)-2 plot(3:maxClust,ClustInd[1:nrow(ClustInd),"MinCentroidDist_VSClust"],col=2 , type="b", main="Min. centroid distance\n(Highest jump is best)", xlab="Number of clusters", ylab="Index", ylim=c(min(ClustInd[,grep("MinCentroidDist", colnames(ClustInd))],na.rm=T), max(ClustInd[,grep("MinCentroidDist", colnames(ClustInd))],na.rm=T))) ClustInd[1:nrow(ClustInd),"MinCentroidDist_VSClust"] 3:maxClust library(vsclust) par(mfrow=c(1,3)) maxClust <- nrow(ClustInd)-2 plot(3:maxClust,ClustInd[1:nrow(ClustInd),"MinCentroidDist_VSClust"],col=2 , type="b", main="Min. centroid distance\n(Highest jump is best)", xlab="Number of clusters", ylab="Index", ylim=c(min(ClustInd[,grep("MinCentroidDist", colnames(ClustInd))],na.rm=T), max(ClustInd[,grep("MinCentroidDist", colnames(ClustInd))],na.rm=T))) plot(3:maxClust,ClustInd[1:nrow(ClustInd),"MinCentroidDist_VSClust"]) 3:maxClust maxClust <- nrow(ClustInd)+2 plot(3:maxClust,ClustInd[1:nrow(ClustInd),"MinCentroidDist_VSClust"],col=2 , type="b", main="Min. centroid distance\n(Highest jump is best)", xlab="Number of clusters", ylab="Index", ylim=c(min(ClustInd[,grep("MinCentroidDist", colnames(ClustInd))],na.rm=T), max(ClustInd[,grep("MinCentroidDist", colnames(ClustInd))],na.rm=T))) library(vsclust) #### Estimate number of clusters with maxClust as maximum number clusters to run #### the estimation with ClustInd <- estimClustNum(dat, maxClust, cores) library(vsclust) require(yaml) require(shiny) require(clusterProfiler) require(matrixStats) ## at computproteomics.bmb.sdu.dk/Apps/VSClust # name of study Experiment <- "ProtExample" # Number of replicates/sample per different experimental condition (sample type) NumReps <- 3 # Number of different experimental conditions (e.g. time points or sample types) NumCond <- 4 # Paired or unpaired statistical tests when carrying out LIMMA for statistical testing isPaired <- FALSE # Number of threads to accelerate the calculation (use 1 in doubt) cores <- 2 # If 0 (default), then automatically estimate the cluster number for the vsclust run # from the Minimum Centroid Distance PreSetNumClustVSClust <- 0 # If 0 (default), then automatically estimate the cluster number for the original # fuzzy c-means from the Minimum Centroid Distance PreSetNumClustStand <- 0 # max. number of clusters when estimating the number of clusters. Higher numbers # can drastically extend the computation time. maxClust <- 10 data(protein_expressions) dat <- protein_expressions #### running statistical analysis and estimation of individual variances statOut <- PrepareForVSClust(dat, NumReps, NumCond, isPaired, TRUE) dat <- statOut$dat Sds <- dat[,ncol(dat)] print(paste("Features:",nrow(dat),"<br/>Missing values:", sum(is.na(dat)),"<br/>Median standard deviations:", round(median(Sds,na.rm=T),digits=3))) ## Write output into file write.csv(statOut$statFileOut,paste("",Experiment,"statFileOut.csv",sep="")) #### Estimate number of clusters with maxClust as maximum number clusters to run #### the estimation with ClustInd <- estimClustNum(dat, maxClust, cores) #### Use estimate cluster number or use own if (PreSetNumClustVSClust == 0) PreSetNumClustVSClust <- optimalClustNum(ClustInd) if (PreSetNumClustStand == 0) PreSetNumClustStand <- optimalClustNum(ClustInd, method="FCM") #### Visualize #### Use estimate cluster number or use own if (PreSetNumClustVSClust == 0) PreSetNumClustVSClust <- optimalClustNum(ClustInd) if (PreSetNumClustStand == 0) PreSetNumClustStand <- optimalClustNum(ClustInd, method="FCM") #### Visualize estimClust.plot(ClustInd) if (PreSetNumClustVSClust == 0) PreSetNumClustVSClust <- optimalClustNum(ClustInd) if (PreSetNumClustStand == 0) PreSetNumClustStand <- optimalClustNum(ClustInd, method="FCM") estimClust.plot(ClustInd) ClustInd colnames(ClustInd) library(vsclust) library(vsclust) test_that("estimate_clust_num", { set.seed(0) data("artificial_clusters") dat <- averageCond(artificial_clusters, 5, 10) dat <- scale(dat) dat <- cbind(dat, 1) ClustInd <- estimClustNum(dat, 10) expect_equal(optimalClustNum(ClustInd, index="MinCentroidDist", method="VSClust"), 6) }) set.seed(0) data("artificial_clusters") dat <- averageCond(artificial_clusters, 5, 10) dat <- scale(dat) dat <- cbind(dat, 1) ClustInd <- estimClustNum(dat, 10) expect_equal(optimalClustNum(ClustInd, index="MinCentroidDist", method="VSClust"), 6) optimalClustNum(ClustInd, index="MinCentroidDist", method="VSClust") library(testthat) test_that("estimate_clust_num", { set.seed(0) data("artificial_clusters") dat <- averageCond(artificial_clusters, 5, 10) dat <- scale(dat) dat <- cbind(dat, 1) ClustInd <- estimClustNum(dat, 10) expect_equal(optimalClustNum(ClustInd, index="MinCentroidDist", method="VSClust"), 6) }) optimalClustNum(ClustInd, index="MinCentroidDist", method="VSClust") unlist(optimalClustNum(ClustInd, index="MinCentroidDist", method="VSClust")) optimalClustNum(ClustInd, index="MinCentroidDist", method="VSClust") ?expect_equal expect_equal(as.numeric(optimalClustNum(ClustInd, index="MinCentroidDist", method="VSClust")), 6) roxygen2::roxygenise() roxygen2::roxygenise() library(vsclust) roxygen2::roxygenise() library(vsclust) roxygen2::roxygenise() library(vsclust) roxygen2::roxygenise() BiocCheck::BiocCheck() ?seq_len seq_len(1,10) seq_len(10) library(shiny) ??inputPanel install.packages("DT") q()