plot.cna viewpoint cannot be adjusted

Issue #566 new
Former user created an issue

This is a minor problem, but it would be nice to get it working. Today I spent the whole day trying to get plot(net,pdb) to adjust the view of the plot, to no avail. From the look of it, it seems that the perspective of plot is the same as in the first trajectory of the multitrj file, NOT the pdb file I used for alignment. The sequence of commands (the "dcd" below is actually the multimodel pdb file from gromacs which is read without problem).

pdb<-read.pdb("prot_calpha.pdb") dcd<-read.pdb("md_nojump_calpha.pdb",multi=TRUE) inds<-atom.select(pdb,elety="CA") trj<-fit.xyz(fixed=pdb$xyz,mobile=dcd,fixed.inds=inds$xyz,mobile.inds=inds$xyz) cij <- dccm(trj) net <- cna(cij)

The offending command is plot(net, pdb) (or plot(net,pdb=pdb) with identical results).

if I further type layout.cna(net, pdb, k=3) the communities are reported corresponding to the "pdb"object, i.e. the correct ("reference") file; but this does not show in the plot - it can't plot 3d. Apparently the incorrect viewpoint comes from the default layout.cna(net, pdb, k=2) 2D coordinates, but I can't verify the 2D coordinates easily.

It would be nice to be able to rotate viewpoint somehow using cmdline, but I would be happy if at least the viewpoint would correspond to the reference file ("pdb" object above).

Comments (5)

  1. Xinqiu Yao

    Hi,

    Try ‘plot(net, pdb, interactive=TRUE)’ to manually adjust the layout. Then, use ‘tk_coords()’ from ‘igraph’ package to save the layout for future use. Let me know if it helps.

  2. visvaldask

    it was me, I posted as Anonymous by accident. I would be nice if interactive=TRUE was really interactive (i.e. mouse sensitive). Right now, the only way to "control" the view in the interactive mode is to use Layout->Random function, which is not really control, because randomly I cannot get the view what I want: my protein is sort of flat rectangle, and randomly I can never get it spread "flat" on screen, I always look at it at some angle. I guess I'll align my raw MD trajectory originally to the view I want and make it the new "raw trajectory" (because that's what plot(net,pdb) seems to look at) , or, alternatively use vmd.cna.

  3. Xinqiu Yao

    ‘interactive=TRUE’ allows you to move nodes by mouse. If it doesn’t work in your case, you might have to check tcl/tk setup of your R...

  4. visvaldask

    I see it now... But I don't want to move individual nodes, I want to move the view... By moving the nodes I distort the picture...

  5. Log in to comment