For a web page to load a resource (e.g. image, PDB file or JS libary), the latter needs to be available online (i.e.not on one's laptop).
NGL
In order to use the NGL protein viewer it needs to be loaded by your browser. This is a piece of JavaScript code which is requested to be loaded by the HTML page with a line
<script scr="address where the script can be downloaded dot js"></script>
This checkbox allows you to ommit this line (unchecked) if you are making other arrangements (i.e. you know what you are doing).
This library can be local or remote.
For example, if you have a .html
file with the protein code from here appropriately copy-pasted and you want to use it offline, then download the js file and save it next to your file (i.e. relative path) and add the line
<script type="text/javascript" scr="ngl.js"></script>
If you are going to use the code on a page where you are not free to control what files are served, say your departmental webpage, opt for the remotely held file (CDN), which is the default value.
<script type="text/javascript" scr="https://cdn.rawgit.com/arose/ngl/v0.10.4-1/dist/ngl.js"></script>
PDB files
This also applies for the PDB code. If you add a PDB code, it will use that from the PDB. If it looks like a file name (e.g. file.pdb
) then it will assume you will upload it to the correct place (e.g. file.pdb
the PDB file is uploaded to the same folder as the HTML page; https://www.myuni.ac.uk/~myusername/file.pdb
will try to fetch it from the URL —do note that some places don't serve 'raw' or 'cross-origin' files. Alternatively you can click Include PDB data
, which means you don't have to worry.
The big red 403
The PDB and JS files cannot be kept on Dropbox or most cloud storage providers. If you get a Dropbox share link, set it 'all with link' and add the URL query ?db=1
to it, you will get the following error in the JS console (in Chrome, right click, inspect, Console tab):
stage.loadFile("https://www.dropbox.com/s/23mxwy0okylrvll/dddG.pdb?dl=1")
(index):1 Access to XMLHttpRequest at 'https://www.dropbox.com/s/23mxwy0okylrvll/dddG.pdb?dl=1' from origin 'http://michelanglo.sgc.ox.ac.uk' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
This is because of a server-side security setting, which cannot be circumvented by the user —and Bitcoin hacker-miners. Likewise, only a specially configured server will serve JS libraries (called a "CDN").
Consequently, it is best to use the default CDN for NGL and tick Include PDB data
.