schrodinger / pymol-open-source

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

Imported PLY file is scaled up 100-fold in cgo.py, why? #286

Closed aszilagyi closed 1 year ago

aszilagyi commented 1 year ago

Hi! I used the external program EDTsurf to generate a solvent accessible surface of a protein as a PLY file, which can be imported into Pymol. However, upon importing, I found that the surface is much larger than the molecule itself. Upon examining the Pymol code, I found that the importer scales up the coordinates in the PLY file by a factor of 100. Lines 608-611 in the file modules/pymol/cgo.py:

                    obj.append(VERTEX)
                    obj.append(vertex['x'] * 100)
                    obj.append(vertex['y'] * 100)
                    obj.append(vertex['z'] * 100)

There may be a reason why this scaling is done in Pymol, but I don't see it. If there is no good reason for it, I suggest that it should be removed. As a workaround, I can pre-process the PLY file by dividing each coordinate by 100.

Andras

JarrettSJohnson commented 1 year ago

I see the same thing for other files too and can't discover what the original reasoning was either. I think this request is reasonable.

speleo3 commented 1 year ago

I agree, a reasonable request. I implemented the PLY importer and I can't remember the reasoning for the factor 100 either. It was based on an example file which I suppose was scaled that way. There is an example file in pymol-testing (test_PHE_pentamer.ply.gz) which also supports that the factor 100 should be removed.