Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error loading .xyz files #306

Closed
a-r-j opened this issue Dec 10, 2021 · 2 comments
Closed

Error loading .xyz files #306

a-r-j opened this issue Dec 10, 2021 · 2 comments

Comments

@a-r-j
Copy link

a-r-j commented Dec 10, 2021

Hiya,

Thanks for a great project!

I'm having some trouble loading .xyz files in both the VScode extension (molstar/VSCoding-Sequence#3) and the online viewer at molstar.org/viewer.

When loading an xyz file:

"viewer.loadStructureFromUrl('https://file%2B.vscod…masb/github/scPDB/octahedron.xyz', format='xyz');"

I get the error:

molstar.js:2 TypeError: Cannot read property 'entry' of undefined
    at lF (molstar.js:2)
    at Object.<anonymous> (molstar.js:2)
    at molstar.js:2
    at Object.next (molstar.js:2)
    at o (molstar.js:2)

Similarly, when using the online viewer & uploading a .xyz I get the same error.

Example .xyz files:

# dodecahedron.xyz
#
         0.57735027      0.57735027      0.57735027
         0.57735027      0.57735027     -0.57735027
         0.57735027     -0.57735027      0.57735027
         0.57735027     -0.57735027     -0.57735027
        -0.57735027      0.57735027      0.57735027
        -0.57735027      0.57735027     -0.57735027
        -0.57735027     -0.57735027      0.57735027
        -0.57735027     -0.57735027     -0.57735027
         0.35682209      0.93417236      0.00000000
        -0.35682209      0.93417236      0.00000000
         0.35682209     -0.93417236      0.00000000
        -0.35682209     -0.93417236      0.00000000
         0.93417236      0.00000000      0.35682209
         0.93417236      0.00000000     -0.35682209
        -0.93417236      0.00000000      0.35682209
        -0.93417236      0.00000000     -0.35682209
         0.00000000      0.35682209      0.93417236
         0.00000000     -0.35682209      0.93417236
         0.00000000      0.35682209     -0.93417236
         0.00000000     -0.35682209     -0.93417236

# cube.xyz
#
0.0 0.0 0.0
1.0 0.0 0.0
1.0 1.0 0.0
0.0 1.0 0.0
0.0 0.0 1.0
1.0 0.0 1.0
1.0 1.0 1.0
0.0 1.0 1.0
@dsehnal
Copy link
Member

dsehnal commented Dec 10, 2021

Hi, this isn't a valid XYZ file. It must start with a number of atoms, followed by a comment line and then list of element x y z rows.

8
cube
C 0.0 0.0 0.0
C 1.0 0.0 0.0
C 1.0 1.0 0.0
C 0.0 1.0 0.0
C 0.0 0.0 1.0
C 1.0 0.0 1.0
C 1.0 1.0 1.0
C 0.0 1.0 1.0

should work.

@a-r-j
Copy link
Author

a-r-j commented Dec 10, 2021

You're completely correct! Thanks! I didn't realise there was a chemistry .xyz - was going based off these: https://people.math.sc.edu/Burkardt/data/xyz/xyz.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants