Mercurial > repos > md-anderson-bioinformatics > heat_map_creation
diff CHM.R @ 32:16593e40c2cd draft
Version 2.0.5
author | insilico-bob |
---|---|
date | Thu, 20 Jul 2017 15:31:06 -0400 |
parents | 603d5c39e8dc |
children | 605ec840a06b |
line wrap: on
line diff
--- a/CHM.R Fri Feb 03 13:20:50 2017 -0500 +++ b/CHM.R Thu Jul 20 15:31:06 2017 -0400 @@ -21,17 +21,12 @@ rowOrder <- createOrdering(dataMatrix, rowOrderMethod, "row", rowDistanceMeasure, rowAgglomerationMethod) if (rowOrderMethod == "Hierarchical") { writeHCDataTSVs(rowOrder, rowDendroFile, rowOrderFile) - writeHCCut(rowOrder, rowCut, paste(rowOrderFile,".cut", sep="")) - } else { - writeOrderTSV(rowOrder, rownames(dataMatrix), rowOrderFile) } colOrder <- createOrdering(dataMatrix, colOrderMethod, "col", colDistanceMeasure, colAgglomerationMethod) if (colOrderMethod == "Hierarchical") { writeHCDataTSVs(colOrder, colDendroFile, colOrderFile) writeHCCut(colOrder, colCut, paste(colOrderFile,".cut", sep="")) - } else { - writeOrderTSV(colOrder, colnames(dataMatrix), colOrderFile) } } @@ -51,18 +46,6 @@ write.table(data, file = outputHCOrderFileName, append = FALSE, quote = FALSE, sep = "\t", row.names=FALSE) } -#creates order file for non-clustering methods -writeOrderTSV<-function(newOrder, originalOrder, outputHCOrderFileName) -{ - data=matrix(,length(originalOrder),2); - for (i in 1:length(originalOrder)) { - data[i,1] = originalOrder[i]; - data[i,2] = which(newOrder==originalOrder[i]); - } - colnames(data)<-c("Id", "Order") - write.table(data, file = outputHCOrderFileName, append = FALSE, quote = FALSE, sep = "\t", row.names=FALSE) -} - #creates a classification file based on user specified cut of dendrogram writeHCCut<-function(uDend, cutNum, outputCutFileName) {