Integrate view() family functions for interactive 3D structure visualization

Issue #186 new
Barry Grant created an issue

Interactive 3D structure visualization functions for pdb, pdbs, enma, nma and pca results/objects.

Comments (12)

  1. Lars Skjærven

    What is the current status on the visualize branch? Is it open for contributions? I have some minor fixes, e.g. all references to 3dalign should be renamed to pdbs. There should also be a option to color atoms by their atom type (i.e. as VMD coloring called "name") in my opinion.

    Otherwise I think the view.pdb function is nice. I would wish for a higher degree of flexibility, e.g something in the direction of:

    # open the RGL device
    dev <- view.pdb(pdb)
    
    show(dev, "sidechains")
    color(dev, atom="name")
    
    show(dev, "ribbon")
    

    but perhaps there is a limitation of the rgl related functions for this kind of updating?

  2. Barry Grant reporter

    Great, I would like to see contributions here. The feature_visualize_dataframe branch has been somewhat dormant and needs energy from others to finish of I think.

    The show() functions you mention above should be possible (we have some limited add=TRUE functionality in the view() functions already). Updating an already drawn object is a little more tricky but still possible by deleting and re-drawing. However, we don't have wrappers for this yet and would need to delve into rgl to see how to do this effectively.

  3. Barry Grant reporter

    We will revisit these 'show' and 'color' option suggestions. The 'pdbs' has been fixed recently and adding a color by name should be straightforward. Happy to hear more suggestions for improvements here especially as we utilize these with shiny.

  4. Barry Grant reporter

    Some recent improvements of view.pdb() on the feature_visualize_dataframe branch

    > pdb<-read.pdb("4q21")
    ## Color by atom type, SSE, color, vector
    > view(pdb, "all", col="atom")
    > view(pdb, "back", col="atom")
    > view(pdb, "calpha", col="sse")
    > view(pdb, "calpha", col="red")
    > view(pdb, "calpha", col=c("green","white","orange")) ## not working properly yet
    

    Still some things to implement and then role out to view.xyz() for trajectory display

  5. Barry Grant reporter

    Updates for view.xyz(), view.pdbs() and view.pdb() are now complete in the feature_visualize_dataframe branch.

    Do we need specialized functions for enma and pca results or will view.xyz() be sufficient?

  6. Lars Skjærven

    Nice ! I think it would be great to have wrapper functions for mktrj and view.xyz. should be nma, pca, and enma, perhaps?

    We could consider differentiating between as and and sele. e.g:

    view(pdb, as="ribbon", sele="calpha")
    view(pdb, as="lines", sele="ligand", add=TRUE)
    

    Not essential at the moment though.

  7. Barry Grant reporter

    Thanks Lars! I will add these methods. What would you like to see for enma?

    The sele separation would be nice and we can add this for view.pdb() but not any of the other methods, which may lead to confusion perhaps (as we don't have objects to pass to atom.select() with xyz class objects). Do you think this inconsistency would be a problem? This is the same reason we dont have an as= in view.xyz() currently, which annoys me and I might add based on elesy if available. Eventually changing this to sele= would be good though.

  8. Lars Skjærven

    For enma, I was thinking simple mode visualization (as in the shiny pca-app), e.g. a function with similar arguments as mktrj.enma, with s.ind (structure number) and m.ind (mode number) arguments. In mktrj.enma, the pdbs object is also required but this should be possible to leave out I guess.

  9. Barry Grant reporter

    See also bug report #246

    Fixing this and adding a view.nma() that also works as a view.enma() are still to do.

    A simple view.ma() could just call mktrj.nma() and view.xyz() internally, e.g.

    n <- nma( read.pdb("4q21") )
    m7 <- mktrj.nma(n, mode=7, file="~/Downloads/mode_7.pdb")
    view(m7)
    

    Set file to NULL and have mode as a function input.

  10. Barry Grant reporter

    Just needs someone who has a bit more time to dig in and test (i.e. not me). We already have enough changes for this minor release though. Feels like a major feature to me!

  11. Log in to comment