Error in PDB Loader

I’m loading this molecule (taken from by using this example of code . I have just added the following element to the “MOLECULES” object:
“5xnl”: “5xnl.pdb”

I get this error:

This is the line:

Is it a problem of too many atoms?


I debugged the loader and I saw that ther is an element missing in the atom array. The element is 1668:


I don’t have the access to threejs repository but the fix it’s easy:

Can anybody changes the source?

Also, with a so large amount of atoms, it would be better to create a version of PDBLoader with THREE.InstancedMesh.

Unfortunately, the fix is not as easy as you think. The real fix is to add support for TER records which are present in your PDB file multiple times and currently not supported by PDBLoader.

Issue at GitHub:

1 Like