changeset 1:20395c0079ae draft

Uploaded
author marie-tremblay-metatoul
date Mon, 30 Jul 2018 07:47:12 -0400
parents c5f11e6f8f99
children 826a2a145147
files galaxy/asca_wrapper.R
diffstat 1 files changed, 15 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/galaxy/asca_wrapper.R	Mon Jul 30 07:29:40 2018 -0400
+++ b/galaxy/asca_wrapper.R	Mon Jul 30 07:47:12 2018 -0400
@@ -164,11 +164,11 @@
 			barplot(eigenvalues[,2], names.arg=eigenvalues[,1], ylab="% of explained variance", xlab="Principal component")
 			noms <- levels(as.factor(samDF[, listArguments$factor1]))
 			ASCA.PlotScoresPerLevel_w4m(result[[1]], ee="1", interaction=0, factorName=listArguments$factor1, factorModalite=noms)
-			Date.loadings <- data.matrix(result[[5]][,2:3])
-			Date.loadings.leverage <- diag(Date.loadings%*%t(Date.loadings))
-			names(Date.loadings.leverage) <- colnames(xMN)
-			Date.loadings.leverage <- sort(Date.loadings.leverage, decreasing=TRUE)
-			barplot(Date.loadings.leverage[Date.loadings.leverage > 0.001], main="PC1 loadings")
+			f1.loadings <- data.matrix(result[[5]][,2:3])
+			f1.loadings.leverage <- diag(f1.loadings%*%t(f1.loadings))
+			names(f1.loadings.leverage) <- colnames(xMN)
+			f1.loadings.leverage <- sort(f1.loadings.leverage, decreasing=TRUE)
+			barplot(f1.loadings.leverage[f1.loadings.leverage > 0.001], main="PC1 loadings")
 		}
 		if (data.asca.permutation[2] < as.numeric(listArguments[["threshold"]]))
 		{
@@ -177,11 +177,11 @@
 			barplot(eigenvalues[,2], names.arg=eigenvalues[,1], ylab="% of explained variance", xlab="Principal component")    
 			noms <- levels(as.factor(samDF[, listArguments$factor2]))
 			ASCA.PlotScoresPerLevel_w4m(result[[1]], ee="2", interaction=0, factorName=listArguments$factor2, factorModalite=noms)
-			Date.loadings <- data.matrix(result[[5]][,4:5])
-			Date.loadings.leverage <- diag(Date.loadings%*%t(Date.loadings))
-			names(Date.loadings.leverage) <- colnames(xMN)
-			Date.loadings.leverage <- sort(Date.loadings.leverage, decreasing=TRUE)
-			barplot(Date.loadings.leverage[Date.loadings.leverage > 0.001], main="PC1 loadings")
+			f2.loadings <- data.matrix(result[[5]][,4:5])
+			f2.loadings.leverage <- diag(f2.loadings%*%t(f2.loadings))
+			names(f2.loadings.leverage) <- colnames(xMN)
+			f2.loadings.leverage <- sort(f2.loadings.leverage, decreasing=TRUE)
+			barplot(f2.loadings.leverage[f2.loadings.leverage > 0.001], main="PC1 loadings")
 		}
   	if (data.asca.permutation[3] < as.numeric(listArguments[["threshold"]]))
   	{
@@ -193,11 +193,11 @@
   	  noms <- apply(noms1, 1, FUN=function(x){paste(x, "-", noms2, sep="")})
   	  noms <- apply(noms, 1, FUN=function(x){c(noms)})
   	  ASCA.PlotScoresPerLevel_w4m(result[[1]], ee="12", interaction=1, factorModalite=noms[,1])
-  	  Date.loadings <- data.matrix(result[[5]][,6:7])
-  	  Date.loadings.leverage <- diag(Date.loadings%*%t(Date.loadings))
-  	  names(Date.loadings.leverage) <- colnames(xMN)
-  	  Date.loadings.leverage <- sort(Date.loadings.leverage, decreasing=TRUE)
-  	  barplot(Date.loadings.leverage[Date.loadings.leverage > 0.001], main="PC1 loadings")
+  	  f1f2.loadings <- data.matrix(result[[5]][,6:7])
+  	  f1f2.loadings.leverage <- diag(f1f2.loadings%*%t(f1f2.loadings))
+  	  names(f1f2.loadings.leverage) <- colnames(xMN)
+  	  f1f2.loadings.leverage <- sort(f1f2.loadings.leverage, decreasing=TRUE)
+  	  barplot(f1f2.loadings.leverage[f1f2.loadings.leverage > 0.001], main="PC1 loadings")
   	}
     dev.off()
 	}