Mercurial > repos > md-anderson-bioinformatics > heat_map_creation
comparison CHM.R @ 38:605ec840a06b draft
Uploaded
author | insilico-bob |
---|---|
date | Thu, 20 Jun 2019 11:30:12 -0400 |
parents | 16593e40c2cd |
children |
comparison
equal
deleted
inserted
replaced
37:f2272e907f1b | 38:605ec840a06b |
---|---|
15 ### rowCut - For rows the number of classifications to automatically generate based on dendrogram into a classification file. 0 for turned off. | 15 ### rowCut - For rows the number of classifications to automatically generate based on dendrogram into a classification file. 0 for turned off. |
16 ### colCut - For columns the number of classifications to automatically generate based on dendrogram into a classification file. 0 for turned off. | 16 ### colCut - For columns the number of classifications to automatically generate based on dendrogram into a classification file. 0 for turned off. |
17 | 17 |
18 performDataOrdering<-function(dataFile, rowOrderMethod, rowDistanceMeasure, rowAgglomerationMethod, colOrderMethod, colDistanceMeasure, colAgglomerationMethod,rowOrderFile, colOrderFile, rowDendroFile, colDendroFile, rowCut, colCut) | 18 performDataOrdering<-function(dataFile, rowOrderMethod, rowDistanceMeasure, rowAgglomerationMethod, colOrderMethod, colDistanceMeasure, colAgglomerationMethod,rowOrderFile, colOrderFile, rowDendroFile, colDendroFile, rowCut, colCut) |
19 { | 19 { |
20 dataMatrix = read.table(dataFile, header=TRUE, sep = "\t", row.names = 1, as.is=TRUE, na.strings=c("NA","N/A","-","?")) | 20 dataMatrix = read.table(dataFile, header=TRUE, sep = "\t", check.names = FALSE, row.names = 1, as.is=TRUE, na.strings=c("NA","N/A","-","?")) |
21 rowOrder <- createOrdering(dataMatrix, rowOrderMethod, "row", rowDistanceMeasure, rowAgglomerationMethod) | 21 rowOrder <- createOrdering(dataMatrix, rowOrderMethod, "row", rowDistanceMeasure, rowAgglomerationMethod) |
22 if (rowOrderMethod == "Hierarchical") { | 22 if (rowOrderMethod == "Hierarchical") { |
23 writeHCDataTSVs(rowOrder, rowDendroFile, rowOrderFile) | 23 writeHCDataTSVs(rowOrder, rowDendroFile, rowOrderFile) |
24 } | 24 } |
25 | 25 |
37 colnames(data)<-c("A", "B", "Height") | 37 colnames(data)<-c("A", "B", "Height") |
38 write.table(data, file = outputHCDataFileName, append = FALSE, quote = FALSE, sep = "\t", row.names=FALSE) | 38 write.table(data, file = outputHCDataFileName, append = FALSE, quote = FALSE, sep = "\t", row.names=FALSE) |
39 | 39 |
40 data=matrix(,length(uDend$labels),2); | 40 data=matrix(,length(uDend$labels),2); |
41 for (i in 1:length(uDend$labels)) { | 41 for (i in 1:length(uDend$labels)) { |
42 print(uDend$labels[i]) | |
42 data[i,1] = uDend$labels[i]; | 43 data[i,1] = uDend$labels[i]; |
43 data[i,2] = which(uDend$order==i); | 44 data[i,2] = which(uDend$order==i); |
44 } | 45 } |
45 colnames(data)<-c("Id", "Order") | 46 colnames(data)<-c("Id", "Order") |
46 write.table(data, file = outputHCOrderFileName, append = FALSE, quote = FALSE, sep = "\t", row.names=FALSE) | 47 write.table(data, file = outputHCOrderFileName, append = FALSE, quote = FALSE, sep = "\t", row.names=FALSE) |