Hi all,
I'm currently making a Chort Diagram, and have no idea how to change the order of it.
Like showed on below picture, I want to change those two elements so that elements with grey colors are gathered together as they are from same group.
This is my code to make it:
set.seed(123) circos.clear() chordDiagram(input_mat, grid.col = color_grid.col, col = col_fun, annotationTrack = "grid", big.gap = 3, small.gap = 0.3, group = temp_group, symmetric = F, link.target.prop = F, preAllocateTracks = list( track.height = mm_h(3) ))
I've tried put "input_mat[wanted_order,wanted_order]" instead of "input_mat", but that doesn't work. Input_mat is a matrix; rownames and colnames are exactly same and values are count.
Does anyone have any idea?
It would be helpful if you provided a minimal reproducible example so others can test and troubleshoot your issue. Without knowing the structure/contents of
input_mat
,color_grid.col
,col_fun
, andtemp_group
, it’s difficult to determine whyinput_mat[wanted_order, wanted_order]
isn’t working as you expect.A small example with a dummy matrix and some mock values for the parameters would make it easier for people to play around with the code and suggest a fix. For example, something like this:
In case it helps, here’s a general guide on making an MRE: stackoverflow.com/help/minimal-reproducible-example.
Here's some info on formatting code on this site too: biostars.org/p/346537/#9584651.