@sjcrh/proteinpaint-server 2.53.0 → 2.55.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/utils/hclust.R CHANGED
@@ -42,10 +42,10 @@ input <- fromJSON(json)
42
42
  #print (dim(normalized_matrix))
43
43
 
44
44
  # For Rows (i.e genes)
45
- RowDist <- dist(input$matrix, method = "euclidean") # Transposing the matrix
45
+ RowDist <- dist(input$matrix, method = tolower(input$distance_method)) # Transposing the matrix
46
46
  # Hierarchical clustering
47
- RowDend <- hclust(RowDist, method = tolower(input$cluster_method))
48
- #RowDend <- flashClust(RowDist, method = tolower(input$cluster_method))
47
+ RowDend <- hclust(RowDist, method = input$cluster_method)
48
+ #RowDend <- flashClust(RowDist, method = input$cluster_method)
49
49
  RowDendMergeDf <- as.data.frame(RowDend$merge)
50
50
  colnames(RowDendMergeDf) <- c("n1","n2")
51
51
  #print ("merge")
@@ -57,12 +57,12 @@ colnames(RowDendOrderHeight) <- "height"
57
57
  #print (RowDendOrderHeight)
58
58
 
59
59
  # For columns (i.e samples)
60
- ColumnDist <- dist(t(input$matrix), method = "euclidean") # Transposing the matrix
60
+ ColumnDist <- dist(t(input$matrix), method = tolower(input$distance_method)) # Transposing the matrix
61
61
 
62
62
  # Hierarchical clustering
63
63
 
64
- ColumnDend <- hclust(ColumnDist, method = tolower(input$cluster_method))
65
- #ColumnDend <- flashClust(ColumnDist,method = tolower(input$cluster_method))
64
+ ColumnDend <- hclust(ColumnDist, method = input$cluster_method)
65
+ #ColumnDend <- flashClust(ColumnDist,method = input$cluster_method)
66
66
 
67
67
  ColumnDendMergeDf <- as.data.frame(ColumnDend$merge)
68
68
  colnames(ColumnDendMergeDf) <- c("n1","n2")