nglviewer / ngl

WebGL protein viewer
http://nglviewer.org/ngl/
MIT License
658 stars 168 forks source link

Can not display this pdb file #558

Open hainm opened 5 years ago

hainm commented 5 years ago

Hi,

Original issue is from here (cc @kuenzeln).

Both nglview and NGL from website show nothing (although I was trying to change to licorice or line repr). VMD is showing ok.

screen shot 2018-07-22 at 12 55 27 am

Here is the file

ATOM      1  CA  GLY A   1       1.499 -33.933  11.693  1.00  8.98           C
ATOM      2  N   GLY A   1       2.255 -34.674  10.709  1.00  8.87           N
ATOM      3  C   GLY A   1       1.397 -34.742  12.954  1.00  8.66           C
ATOM      4  O   GLY A   1       1.731 -35.910  12.936  1.00  8.13           O
ATOM      5  N   SER A   2       1.970 -34.016  13.926  1.00  9.28           N
ATOM      6  CA  SER A   2       1.953 -34.477  15.356  1.00  9.37           C
ATOM      7  C   SER A   2       1.481 -33.344  16.231  1.00  9.54           C
ATOM      8  O   SER A   2       1.700 -32.210  15.911  1.00  9.78           O
ATOM      9  CB  SER A   2       3.355 -34.863  15.794  1.00  0.00           C
ATOM     10  OG  SER A   2       3.795 -36.004  15.054  1.00  0.00           O
ATOM     11  N   GLY A   3       0.793 -33.668  17.315  1.00 10.35           N
ATOM     12  CA  GLY A   3       0.549 -32.747  18.430  1.00 10.71           C
ATOM     13  C   GLY A   3       1.584 -31.628  18.574  1.00 11.53           C
ATOM     14  O   GLY A   3       1.194 -30.467  18.669  1.00 12.06           O
TER      15      GLY A   3
ATOM     16  CA  GLY B   1      31.499 -33.933  11.693  1.00  8.98           C
ATOM     17  N   GLY B   1      32.255 -34.674  10.709  1.00  8.87           N
ATOM     18  C   GLY B   1      31.397 -34.742  12.954  1.00  8.66           C
ATOM     19  O   GLY B   1      31.731 -35.910  12.936  1.00  8.13           O
ATOM     20  N   TYR B   2      31.970 -34.016  13.926  1.00  9.28           N
ATOM     21  CA  TYR B   2      31.953 -34.477  15.356  1.00  9.37           C
ATOM     22  C   TYR B   2      31.481 -33.344  16.231  1.00  9.54           C
ATOM     23  O   TYR B   2      31.700 -32.210  15.911  1.00  9.78           O
ATOM     24  CB  TYR B   2      33.340 -34.899  15.840  1.00  0.00           C
ATOM     25  CG  TYR B   2      33.809 -36.101  15.055  1.00  0.00           C
ATOM     26  CD2 TYR B   2      33.531 -37.392  15.519  1.00  0.00           C
ATOM     27  CD1 TYR B   2      34.521 -35.924  13.863  1.00  0.00           C
ATOM     28  CE1 TYR B   2      34.956 -37.038  13.135  1.00  0.00           C
ATOM     29  CZ  TYR B   2      34.678 -38.329  13.600  1.00  0.00           C
ATOM     30  CE2 TYR B   2      33.966 -38.506  14.792  1.00  0.00           C
ATOM     31  OH  TYR B   2      35.101 -39.411  12.893  1.00  0.00           O
ATOM     32  N   GLY B   3      30.793 -33.668  17.315  1.00 10.35           N
ATOM     33  CA  GLY B   3      30.549 -32.747  18.430  1.00 10.71           C
ATOM     34  C   GLY B   3      31.584 -31.628  18.574  1.00 11.53           C
ATOM     35  O   GLY B   3      31.194 -30.467  18.669  1.00 12.06           O
END
gph82 commented 5 years ago

This has to do with the initial representation. Happens the same with di-ala. NGL notices that the molecules are made up of amino-acids, so it decides it is a protein, so it forces the use "NewCartoon" for them. The peptides are too short, no secondary structure is recognized so you see nothing. Can you try to add "add_licorce" (or sth, I never remember) after the widget is instantiated. I have wrapper around nglviewr s.t. if n_residues is smaller than 10, "NewCartoon" should be deleted and "Licorice" used instead

gph82 commented 5 years ago

ok, scratch that, it is not what I thought...

arose commented 5 years ago

it seems it is not automatically centered properly, do a 'autoView()' after adding a licorice representation for a workaround

hainm commented 5 years ago

it seems it is not automatically centered properly, do a 'autoView()' after adding a licorice representation for a workaround

indeed. weird