correlation analysis

Issue #681 closed
Aiswarya Pawar created an issue

Hi all,

I was going through one of the Bio3d papers https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1006364# . In this paper figure3 where they are referring to correlation between protein in GDP and GTP state. As far i realised we need to concatenate the GDP bound and GTP bound simulations. But if we do that how do we know which state is in upper side of the diagonal and vice versa. It would be really helpful if i could get the commands to this query.

Comments (6)

  1. Xinqiu Yao

    What did you mean by “concatenate … simulations”? The correlations should be calculated independently for GDP and GTP.

  2. Aiswarya Pawar reporter

    Hi,

    I got it wrong then. So basically i should have two dcd files one for wildtype and other for mutant. So how do i proceed further to do a correlation between these two simulations ie having the correlate been highlighted with GDP on the lower diagonal of the plot and the GTP on the upper. Can you provide me with the commands.

  3. Xinqiu Yao

    You can’t calculate correlations between separated simulations. The meaning of the figure is to show two independent correlation matrices, one for GTP and the other for GDP. Since a correlation matrix is symmetric, you only need the upper or lower triangle to show the full information. So, the trick is: pick up the upper from one simulation and the lower from the other, and put the two together to make one full matrix. An example of codes looks like:

    ## suppose correlation for GTP is in the matrix a
    ## and GDP in b
    
    ## build a dummy matrix, c
    c <- matrix(1, nrow=nrow(a), ncol=ncol(a))))
    
    ## make the upper triangle of c the same as the upper of a  
    c[upper.tri(c)] <- a[upper.tri(a)]
    
    ## make the lower triangle of c the same as the lower of b  
    c[lower.tri(c)] <- b[lower.tri(b)]
    
    ## plot c
    plot.dccm(c)
    
  4. Aiswarya Pawar reporter

    Hi,

    It worked. One more query I have, can we change the colormap from the default. col command doesnt work for dccm?

  5. Xinqiu Yao

    Use col.regions to change. See the example of plot.dccm(). The argument belongs to the levelplot() function of the lattice package.

  6. Log in to comment