]> git.donarmstrong.com Git - rsem.git/blobdiff - EBSeq/R/PoolMatrix.R
Included EBSeq for downstream differential expression analysis
[rsem.git] / EBSeq / R / PoolMatrix.R
diff --git a/EBSeq/R/PoolMatrix.R b/EBSeq/R/PoolMatrix.R
new file mode 100644 (file)
index 0000000..4c80785
--- /dev/null
@@ -0,0 +1,25 @@
+PoolMatrix <-
+function(Data,reads,type)
+{
+poolnames=names(Data)
+poolM=NULL
+for (po in 1:8)
+       poolM=cbind(poolM,Data[[po]][,1])
+rownames(poolM)=rownames(Data[[1]])
+colnames(poolM)=poolnames
+
+#poolValue=poolM*reads
+poolValue=poolM
+for (col in 1:8)
+       poolValue[,col]=poolM[,col]*reads[col]
+poolValue=round(poolValue)
+if (type=="G")
+       {
+               poolM=cbind(Data[[1]][,2],poolM)
+               poolValue=cbind(Data[[1]][,2],poolValue)
+               colnames(poolM)=c("Groups",poolnames)
+               colnames(poolValue)=c("Groups",poolnames)
+       }
+poolOutput=list(poolM=poolM,poolValue=poolValue)
+}
+