This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Circos.heatmap not displaying zero values in R

I have a wide dataframe of a single row with a binary present absence dataset encoded in 1s and 0s:

dim(preMicroCazyme_wide)
[1]    1 1970

I am wanting to do this as i will layer several circos.heatmaps to show the presence absence in different systems. However the plots just come out all one colour and seemingly ignore the 0 values:

Each of the below have the same dimensions just different profiles of 1s and 0s.

    cols1 = colorRamp2(c(0, 1), c("white", "blue"))
    cols2 = colorRamp2(c(0, 1), c("white", "pink"))

    circos.heatmap(preMicroCazyme_wide, cols1 = cols, split = FALSE, cluster = FALSE)
    circos.heatmap(wide_termite_cazy, col = cols2, split = FALSE, cluster = FALSE)

    # Showing the output is not correct for some reason
    length(preMicroCazyme_wide[preMicroCazyme_wide == 0])
    [1] 281
    > length(wide_termite_cazy[wide_termite_cazy == 0])
    [1] 1289

Yet the resulting plot looks like this: circos output

This looks like the 0 values are either being ignored or coloured in regardless. Any idea how I can fix this?

Example data could look like this:

   df = t(data.frame(row1 = rep(c(0,1), 100,)))
visualisation r

1 answer

I had the data frame wide when i needed it to be long t(my_df) solved the issue!

Log in to answer this question.