Issue with Regular Expression:
The function uses a regex pattern (paste0("^", l)) in the highlight.sector call, which is too broad. For example, when a cell type like "Tregs" is present, the pattern "^T" inadvertently matches both "Tregs" and any cell type starting with "T". This leads to incorrect grouping and displaying incorrect colored sectors in the final circos plot.
Recommended Modification:
highlight.sector(segments[str_detect(segments, paste0("^", l))], track.index = 2, col = cell_cols[l]) should be ->
highlight.sector(segments[str_detect(segments, paste0("^", l, "\|"))], track.index = 2, col = cell_cols[l])
Issue with Regular Expression:
The function uses a regex pattern (paste0("^", l)) in the highlight.sector call, which is too broad. For example, when a cell type like "Tregs" is present, the pattern "^T" inadvertently matches both "Tregs" and any cell type starting with "T". This leads to incorrect grouping and displaying incorrect colored sectors in the final circos plot.
Recommended Modification:
highlight.sector(segments[str_detect(segments, paste0("^", l))], track.index = 2, col = cell_cols[l]) should be ->
highlight.sector(segments[str_detect(segments, paste0("^", l, "\|"))], track.index = 2, col = cell_cols[l])