mirror of
				https://github.com/johrpan/geposanui.git
				synced 2025-10-26 19:27:24 +01:00 
			
		
		
		
	Always use the largest cluster
This commit is contained in:
		
							parent
							
								
									1c88458ce7
								
							
						
					
					
						commit
						b69b3e9d2d
					
				
					 1 changed files with 8 additions and 1 deletions
				
			
		|  | @ -35,7 +35,14 @@ process_input <- function(input) { | ||||||
| 
 | 
 | ||||||
|         clusters <- hclust(dist(distances[, distance])) |         clusters <- hclust(dist(distances[, distance])) | ||||||
|         clusters_cut <- cutree(clusters, h = 1000000) |         clusters_cut <- cutree(clusters, h = 1000000) | ||||||
|         cluster <- distances[which(clusters_cut == 1)] | 
 | ||||||
|  |         # Find the largest cluster | ||||||
|  |         cluster_indices <- unique(clusters_cut) | ||||||
|  |         cluster_index <- cluster_indices[ | ||||||
|  |             which.max(tabulate(match(clusters_cut, cluster_indices))) | ||||||
|  |         ] | ||||||
|  | 
 | ||||||
|  |         cluster <- distances[which(clusters_cut == cluster_index)] | ||||||
| 
 | 
 | ||||||
|         results[ |         results[ | ||||||
|             gene == gene_id, |             gene == gene_id, | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue