view.cnapath() shortest path color

Issue #167 resolved
Former user created an issue

Is there an option to change the color of the shortest path in .vmd file saved via view.cnapath?

Comments (4)

  1. Xinqiu Yao

    We don't have options to adjust colors presently. The quickest way to achieve it is to modify the plot function a little bit and call it in an R session. For example, to display all paths as red

    myfun <- edit(bio3d::view.cnapath)
    # an editor will be invoked 
    # change the line 'cols <- colorRampPalette(c("blue", "red"))(256)' to
    # 'cols <- colorRampPalette(c("red", "red"))(256)'
    # save the file and quit the editor
    
    myfun(path, pdb, launch=TRUE)
    

    You can do similar things for other colors.

    Let me know if it works...

  2. Xinqiu Yao

    Hi,

    A new option "colors" has been added to the function in the latest commit (commit).

    For example,

    # show all paths in red
    view.cnapath(pa, pdb=pdb, colors="red", launch=TRUE)
    
    # show paths from blue (longest) to green (shortest)
    view.cnapath(pa, pdb, colors=c("blue", "green"), launch=TRUE)
    
  3. Log in to comment