Skip to content

Commit

Permalink
Add simplified layer labels as new column instead of modifiing layer_…
Browse files Browse the repository at this point in the history
…label (this preserves match with refernce data)
  • Loading branch information
lahuuki committed Dec 11, 2024
1 parent c371907 commit 9028592
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions R/annotate_registered_clusters.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,6 @@ annotate_registered_clusters <-
cutoff_merge_ratio = cutoff_merge_ratio
)

if (all(colnames(cor_stats_layer) %in% c("WM", paste0("Layer", seq_len(6))))) {
## Simplify names when working with the default data
annotated <- gsub("ayer", "", annotated)
annotated <- gsub("\\/L", "\\/", annotated)
annotated <- gsub("^WM\\/", "WM\\/L", annotated)
}

confidence <- apply(cor_stats_layer, 1, max) > confidence_threshold

result <- data.frame(
Expand All @@ -83,6 +76,16 @@ annotate_registered_clusters <-
result$layer_label,
ifelse(result$layer_confidence == "good", "", "*")
)

## Add simplified label for WM/Layer annotations
if (all(colnames(cor_stats_layer) %in% c("WM", paste0("Layer", seq_len(6))))) {
result$layer_label_simple <- result$layer_label
## Simplify names when working with the default data
result$layer_label_simple <- gsub("ayer", "", result$layer_label_simple )
result$layer_label_simple <- gsub("\\/L", "\\/", result$layer_label_simple )
result$layer_label_simple <- gsub("^WM\\/", "WM\\/L", result$layer_label_simple )
}

return(result)
}

Expand Down

0 comments on commit 9028592

Please sign in to comment.