schrodinger / pymol-open-source

Open-source foundation of the user-sponsored PyMOL molecular visualization system.
https://pymol.org/
Other
1.16k stars 276 forks source link

Error with cube file position and orientation #59

Closed ryjmacdonell closed 4 years ago

ryjmacdonell commented 4 years ago

I am trying to display molecular orbitals with PyMOL and not having much success. Because PyMOL doesn't support any form of molecular orbital input, I first generate cube files with Molden, then load an xyz file and cube file with PyMOL to display the orbitals. When I view both, the orbitals (isosurfaces) are significantly displaced from the molecule. I have tried playing with the origin and axes in the cube file but there is no obvious scaling or change of axes that works. Even if I adjust the origin manually, the orbital orientation is incorrect and changing the sign of the axes does not change the orientation.

This does not appear to be a problem with Molden's cube file generation because I can load both molecular orbital files and cube files with JMol and they match in position and orientation.

comp

It might be an issue with PyMOL assuming a certain format, so here are the header lines from the cube file:

Molden generated cube file                                                      
Orbital    8                                                                    
    7    5.777096   -7.576246   -0.409315                                       
   61   -0.152913    0.031570    0.069615                                          
   61    0.057324    0.150353    0.057732                                          
   61   -0.050565    0.074983   -0.145072                                          
    0    0.000000    0.183783    0.380474   -0.390800                               
    6    0.000000    1.454406    0.692527   -0.672382                               
    6    0.000000   -1.086840    0.068420   -0.109218                               
    1    0.000000    2.539292   -0.680210   -1.760037                               
    1    0.000000    1.624238   -0.472236    1.215533                               
    1    0.000000   -1.797982   -1.836261    0.197003                               
    1    0.000000   -2.431271    1.531131    0.356624
speleo3 commented 4 years ago

Looks like we should not call cube_buildrotmat here, as it aligns the map to the xy-plane: contrib/uiuc/plugins/molfile_plugin/src/cubeplugin.cpp#L234