Skip to content

Commit 9028592

Browse files
committed
Add simplified layer labels as new column instead of modifiing layer_label (this preserves match with refernce data)
1 parent c371907 commit 9028592

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

R/annotate_registered_clusters.R

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,6 @@ annotate_registered_clusters <-
5959
cutoff_merge_ratio = cutoff_merge_ratio
6060
)
6161

62-
if (all(colnames(cor_stats_layer) %in% c("WM", paste0("Layer", seq_len(6))))) {
63-
## Simplify names when working with the default data
64-
annotated <- gsub("ayer", "", annotated)
65-
annotated <- gsub("\\/L", "\\/", annotated)
66-
annotated <- gsub("^WM\\/", "WM\\/L", annotated)
67-
}
68-
6962
confidence <- apply(cor_stats_layer, 1, max) > confidence_threshold
7063

7164
result <- data.frame(
@@ -83,6 +76,16 @@ annotate_registered_clusters <-
8376
result$layer_label,
8477
ifelse(result$layer_confidence == "good", "", "*")
8578
)
79+
80+
## Add simplified label for WM/Layer annotations
81+
if (all(colnames(cor_stats_layer) %in% c("WM", paste0("Layer", seq_len(6))))) {
82+
result$layer_label_simple <- result$layer_label
83+
## Simplify names when working with the default data
84+
result$layer_label_simple <- gsub("ayer", "", result$layer_label_simple )
85+
result$layer_label_simple <- gsub("\\/L", "\\/", result$layer_label_simple )
86+
result$layer_label_simple <- gsub("^WM\\/", "WM\\/L", result$layer_label_simple )
87+
}
88+
8689
return(result)
8790
}
8891

0 commit comments

Comments
 (0)