Closed maxc2020 closed 11 months ago
Do you want the arcs themselves to be colored, or just the text of the ligand?
Ideally both, but either would be ok. I would like to focus attention on the interactions of interest.
Thanks for helping! Max
As far as I know, it's very difficult to change or highlight specific arcs because the whole plot is drawn with circlize::chordDiagram
. Changing the text color is possible but requires you to modify the make_circos_lr
wrapper function a little bit.
You can find the function in R/differential_nichenet_plotting.R
. There's two things you have to do:
ligands_oi = NULL
if
statement under the circos.track
where the text is being written: circos.track(track.index = 1, panel.fun = function(x, y) {
if (CELL_META$sector.index %in% ligands_oi){
circos.text(CELL_META$xcenter, CELL_META$ylim[1], CELL_META$sector.index,
facing = "clockwise", niceFacing = TRUE, adj = c(0, 0.5), cex = 1, col ="red")
} else {
circos.text(CELL_META$xcenter, CELL_META$ylim[1], CELL_META$sector.index,
facing = "clockwise", niceFacing = TRUE, adj = c(0, 0.5), cex = 1)
}
}, bg.border = NA)
This will change the text color to red if the current ligand is in the ligands_oi
vector.
So I will get the following plot if I run the code from the Differential NicheNet vignette:
ligands_oi <- c("Apoa1", "Lsamp")
circos_output = make_circos_lr(prioritized_tbl_oi, colors_sender, colors_receiver, ligands_oi = ligands_oi)
Thank you
Hello NicheNetr Community,
I've used NicheNetr to look at differential receptor/ligand pairs from a control vs treated condition and generated helpful data. Thanks! I am looking for input on how to improve my data visualization. I have used code from a vignette, with minimal adaption to provide a custom list for the sender coloring:
My question is: how can I select specific ligands for a distinct color? I would like to highlight a select few that are most interesting, so that they are easily visible to the casual viewer. Ideally I could manually code it as a list of selected ligands to color red. After re-reviewing the NicheNetr and Circlize vignettes & past questions, I am not sure how to proceed and could use some help. thank you.