Contact map and significant atom-atom contact formation

Issue #118 new
Lars Skjærven created an issue

Original post: for better visualization of contact maps. plot.dmat() is not always suitable

Evolved to: Developming a method for determining significant atom-atom contact formation and breakage

Comments (17)

  1. Lars Skjærven reporter

    not a contour plot. perhaps just points. something like Figure 7 in your Structure paper from 2008 ? I can give it a shot some day

  2. Lars Skjærven reporter

    simple solution implemented with function plot.cmap(). see commit 10f3062

    contacmap.png

    We could perhaps add a color scale, e.g. on the actual distance..?

  3. Xinqiu Yao

    Thanks Lars. This is a good start!

    I have a couple suggestions:

    As Barry mentioned above, the 'corrplot' package provides many nice ways to plot a matrix. Maybe we can borrow some ideas here, e.g. toggle between triangular plot (upper or lower) and full plot, plot two structures in one matrix, etc.

    An option to calculate difference contact map (input two PDB) and plot both common and specific contact with difference colors.

    By the way, I would like to keep cmap binary, i.e. 0 or 1, and then we don't need color scale here. For distance map we can still use the plot.dmat(). What do you think?

  4. Lars Skjærven reporter

    Can we just include an add argument (or something equivalent) to enable plotting of multiple matrices in the same plot? Then you can call the function x times to overlay stuff.. ?

    see e.g. ?barplot

         add: logical specifying if bars should be added to an already
              existing plot; defaults toFALSE.
    

    Difference contact maps would be good, but then we should go beyond two PDBs. I think that would require a separate function. no?

  5. Xinqiu Yao

    "Add" would be good. Thanks!

    You are right, difference cmap could be a separate function. I have written a script recently for this task and will find it tomorrow to see if it fits.

  6. Xinqiu Yao

    Hi,

    I've uploaded a simple script for difference cmap plot under new_funs/ (See the commit). Below is an example of the plot. Let me know what you think, thanks.

    example.png

  7. Lars Skjærven reporter

    Updated with argument add=TRUE in commit

    pdb <- read.pdb( system.file("examples/1hel.pdb", package="bio3d") )
    
    ##- Calcualte contact map
    cm <- cmap(pdb)
    
    ##- Plot contact map
    plot.cmap(cm, sse=pdb)
    
    ##- Add to plot
    plot.cmap(t(cm), col=3, pch=17, add=TRUE)
    

    contactmap.png

    The difference contact map looks good. Could perhaps update it now to use the add=TRUE.

    How about a separate function for calculating differential contacts from more complex input (e.g. a PDBs object, or two MD simulations)? An example of PDBs input would be the GTP and GDP structures of the transducin data. For the MD simulation, the dmap() function should provide an array of contact maps (one for each frame), which would then be provided to the differential contacts function.

  8. Xinqiu Yao

    What is the purpose of differential contacts calculation here? Is it to count the frequency of each contact over all frames and then keep it in the output if the frequency above some threshold? If it is true, cmap.xyz() can do it with an option "pcut" to set the frequency cutoff. For example:

    cm1 = cmap(traj1, grpby = pdb$atom[, "resno"], pcut=0.75)
    cm2 = cmap(traj2, grpby = pdb$atom[, "resno"], pcut=0.75)
    plot.diff.cmap(cm1, cm2, sse=pdb)
    

    Or, maybe you are thinking about something else? Btw, we may still need cmap.pdbs() for calculating consensus contact over crystal structure ensembles.

  9. Lars Skjærven reporter

    Hmm.. I'm thinking that we could use the actual distances more actively for statistical reasons, but also for determining the relevance of the magnitudes. e.g. if your contact cutoff is 4Å, simulation A shows 3.9Å for a specific interaction while simulation B shows 4.1Å for the same interaction, it would show as a difference contact between these two residues. But in fact the amplitude is so small that you wouldn't claim it be relevant. On the other if you use statistics on the measured distances, perhaps they would indeed be significant. hmm...

  10. Barry Grant

    We have been thinking about similar sorts things in relation to correlations - where we are currently forced to use a cutoff on the absolute magnitude whilst comparing across multiple replicate simulations for network building. Distances/contacts should also be done across multiple replicate sims also.

    Willy Wriggers implemented some very nice ideas for monitoring significant 'contact formation' and 'contact breaking' events. You might want to check out his approach in the TimeScapes package for inspiration if this is something you want to dig into further.

  11. Log in to comment