@sjcrh/proteinpaint-server 2.17.0 → 2.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/genome/hg38.js +5 -3
- package/package.json +8 -7
- package/server.js +1 -1
- package/utils/fastclust.R +16 -6
package/utils/fastclust.R
CHANGED
|
@@ -66,13 +66,14 @@ RowDend <- hclust(RowDist, method = tolower(input$cluster_method))
|
|
|
66
66
|
RowDendro <- as.dendrogram(RowDend)
|
|
67
67
|
#print ("Attributes as.dendrogram")
|
|
68
68
|
#attributes(RowDendro)
|
|
69
|
-
plot(RowDendro)
|
|
69
|
+
#plot(RowDendro)
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
row_node_coordinates <- get_nodes_xy(
|
|
72
72
|
RowDendro,
|
|
73
73
|
type = "rectangle"
|
|
74
74
|
)
|
|
75
|
-
print (
|
|
75
|
+
print ("RowCoordinates")
|
|
76
|
+
print (row_node_coordinates)
|
|
76
77
|
|
|
77
78
|
# For columns (i.e samples)
|
|
78
79
|
ColumnDist <- dist(t(input$matrix), method = "euclidean") # Transposing the matrix
|
|
@@ -82,8 +83,16 @@ ColumnDist <- dist(t(input$matrix), method = "euclidean") # Transposing the matr
|
|
|
82
83
|
ColumnDend <- hclust(ColumnDist, method = tolower(input$cluster_method))
|
|
83
84
|
#ColumnDend <- flashClust(ColumnDist,method = tolower(input$cluster_method))
|
|
84
85
|
ColumnDendro <- as.dendrogram(ColumnDend)
|
|
85
|
-
plot (ColumnDendro)
|
|
86
|
+
#plot (ColumnDendro)
|
|
86
87
|
|
|
88
|
+
col_node_coordinates <- get_nodes_xy(
|
|
89
|
+
ColumnDendro,
|
|
90
|
+
type = "rectangle"
|
|
91
|
+
)
|
|
92
|
+
print ("ColumnCoordinates")
|
|
93
|
+
print (col_node_coordinates)
|
|
94
|
+
|
|
95
|
+
print ("Done")
|
|
87
96
|
# Sorting the matrix
|
|
88
97
|
|
|
89
98
|
SortedMatrix <- input$matrix[RowDend$order, ColumnDend$order]
|
|
@@ -93,12 +102,13 @@ SortedColumnNames <- input$col_names[ColumnDend$order]
|
|
|
93
102
|
m <- matrix(SortedMatrix,length(SortedRowNames),length(SortedColumnNames))
|
|
94
103
|
colnames(m) <- SortedColumnNames
|
|
95
104
|
rownames(m) <- SortedRowNames
|
|
105
|
+
cat("rownames",RowDend$order,"\n",sep="\t")
|
|
106
|
+
cat("colnames",ColumnDend$order,"\n",sep="\t")
|
|
96
107
|
|
|
97
108
|
df <- melt(m)
|
|
98
109
|
colnames(df) <- c("Genes", "Samples", "value")
|
|
99
110
|
|
|
100
|
-
ggplot(df, aes(x = Genes, y = Samples, fill = value)) +
|
|
101
|
-
geom_tile() + scale_fill_gradient(low="blue", high="red")
|
|
111
|
+
#ggplot(df, aes(x = Genes, y = Samples, fill = value)) + geom_tile() + scale_fill_gradient(low="blue", high="red") + theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1))
|
|
102
112
|
|
|
103
113
|
#ggsave("heatmap.png")
|
|
104
114
|
|