Thank you @Bastien Hervé I tried the same thing in my own way. The 'split' argument i tried using in circos.heatmap function only, it solved the graph.degree error but gave another new error.
Also I didn't want to transpose my data, so I went ahead without transposing it.
here is the script that I used:
# Step 1: Clear previous plots
circos.clear()
# Step 2: Set gap.after for 17 groups of 3 sectors (51 sectors total)
# 17 groups × 3 genes = 51 sectors
group_gaps <- rep(c(2, 2, 10), 17) # Gives 51 elements: 2, 2, 10, 2, 2, 10, ..., 10
length(group_gaps)
# Step 3: Set circos parameters
circos.par(start.degree = 90, gap.after = group_gaps)
# Step 4: Draw the circular heatmap
circos.heatmap(
vst_matrix_scaled,
col = col_fun,
na.col = na_col,
cluster = FALSE,
dend.side = "inside",
dend.track.height = 0.15,
track.height = 0.08,
rownames.side = "outside",
show.sector.labels = TRUE,
heatmap_limits = c(-3, 3),
split = rownames(vst_matrix_scaled) # this ensures sectors align correctly
)
but there is new error pop up:
Error in circos.trackPlotRegion(...) :
unused argument (heatmap_limits = c(-3, 3))
and this is the heatmap generated :