How to make the differences of residue cross correlation more obvious?

Issue #585 resolved
Cheng created an issue

The Residue Cross Correlation outputs the plot on the left, in which the blue and red colours are not sufficiently different.

This paper introduced a method to enhance the small differences by scaling the cij with a sigmoildal function, which outputs the plot on the right.

Can I ask if this scaling method is reasonable? Thank you!

201849-220253.jpg

Picture2.png

Comments (3)

  1. Shahryar Alavi

    I think it's a matter of colour.

    In such heatmap plots, the white colour of middle range usually lighten colours of two opposite sides. To overcome this invisibility, I change colour-scaling using library(ggplot2).

    1.png 2.png

    The plots above are created by same codes/objects, but differ only in their gradient colour scales:

    library(bio3d)
    library(reshape)
    library(ggplot2)
    
    dc <- dccm(fit, ncore = 4)
    mlt.dc <- melt(dc)
    
    # Code for the first (conventional) plot:
    ggplot(mlt.dc, aes(x = factor(Var1), y = factor(Var2), fill = value)) + geom_tile() + 
      scale_fill_gradient2(low = "red", high = "blue", mid = "white", midpoint = 0, limit = c(-1,1), name="Affinity") + 
      coord_fixed() + labs(x = "Residue", y = "Residue", title = "Residue Cross-Correlation Map")
    
    # Code for the second (two-scale colour) plot:
    ggplot(mlt.dc, aes(x = factor(Var1), y = factor(Var2), fill = value)) + geom_tile() + 
      scale_fill_gradient(low = "yellow", high = "blue", limit = c(-1,1), name="Affinity") + 
      coord_fixed() + labs(x = "Residue", y = "Residue", title = "Residue Cross-Correlation Map")
    
    ## Note the difference in the second line of each plotting code.
    

    The plotting codes are different in one function:

    scale_fill_gradient2() for three-colour scale.

    scale_fill_gradient() for two-colour scale.

    Seems that the sigmoidal function results in an artificial DCCM with magnified numeral values. I suggest try different colour scales, which may make sense.

  2. Barry Grant

    I agree. There are some beautiful color schemes out there that will more clearly show things than the defaults of the current generation bio3d plot functions. Many folks, including myself, increasingly go down the ggplot2 route for these types of figures now...

  3. Log in to comment