-
Notifications
You must be signed in to change notification settings - Fork 42
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
load url syntax #15
Comments
Hi fslee62, |
hi lewis, thanks for the ultra-fast response. maybe the way to reproduce it on your end is to use your own LOCAL web server and try to load a LOCAL pdb file based on local path (not from RCSB based on PDBid). so here i am initiating the viewer locally on my own web server and i want to load a local pdb based a local path and filename. after the icn3d initialized, i typed the following at the command prompt:
HOWEVER, if i used the menu popup choosing type=pdb and url=/data/pdb/test.pdb. the molecule loaded into the viewer. ALSO, from then on, the viewer seemed to "remember" the file type so that NOW
i hope my description was explicit enough. |
Hi fslee62 When you load a local file from the command line, you need to use file path
If you load a url file from the command line, you need to give file type:
For JS code within the page, you also need to give the url file type: hope my explanations can help you solve the problem. Dachuan |
hi dachuan, for (1), my web server is an INTRAnet virtual web server running off of a linux box (not windows). i don't quite understand how a windows drive letter (e.g., C:) would work under a linux filesystem. i tried:
for (2), notice your url is an extranet address/path. i tried:
maybe i should take a step back. can iCN3D be used as an intranet web viewer loading only internal/local files? i am trying to replace the Jmol viewer (which works well for me in the past) on my intranet web server with iCN3D because current web browsers do not support java anymore. |
hi fred, I don't think we tested iCn3D on a virtual web server. We will look into the problems. Thanks, Dachuan |
hi dachuan, (1) the Jmol applet had worked under the same situation (intranet web-based viewer serving intranet files). i think a lot of people would love to use iCN3D to replace Jmol on their intranet and/or extranet web servers. (2) iCN3D hosted by my web server (twww) showed up on my browser (chrome) NO problem. i can load local file using the Menu and it WORKED. so iCN3D can be hosted locally and read local files. just that there may be something sticky with the command prompt way and with the cfg way. |
Hi Fred,
Thanks for reporting the problem. Previously I tested to load a pdb file located in a local web sever into a locally hosted iCn3D.
You can view the source code at https://www.ncbi.nlm.nih.gov/Structure/icn3d/full_ui_all.js. The function to load the local pdb file is at
iCn3DUI.prototype.downloadUrl = function (url, type) ...
You can test whether this ajax call is successful. Because of the same origin policy, your pdb file should located exactly in the same host as iCn3D. For example, if iCn3D is located at http://twww.abc.org/icn3d, you pdb file should be located under http://twww.abc.org/, e.g., http://twww.abc.org/data/pdb/test.pdb.
If it's OK, you can send me the exact testing url. Or you can send me the error message in the console by pressing "Ctrl", "shift" and "i" together and clicking the "Console" tab.
I will be back to work at the end of July. But I have some limited email access before then.
Thanks!
Jiyao
…--------------------------------------------
On Tue, 6/27/17, fslee62 <notifications@github.com> wrote:
Subject: Re: [ncbi/icn3d] load url syntax (#15)
To: "ncbi/icn3d" <icn3d@noreply.github.com>
Cc: "Subscribed" <subscribed@noreply.github.com>
Date: Tuesday, June 27, 2017, 1:05 PM
hi dachuan,
thanks very much for taking the time to look into my issues.
while you have given me the syntax for (1) load pdb and (2)
load url. both did not work in my case.
for (1), my web server is an INTRAnet virtual
web server running off of a linux box (not windows). i
don't quite understand how a windows drive letter (e.g.,
C:) would work under a linux filesystem. i tried:
load pdb file c:\data\pdb\test.pdb (no model
loaded into viewer no error messages)
for (2), notice your url is an extranet address/path. i
tried:
load url http://twww/data/pdb/test.pdb
| pdb (no model loaded)
load url https://files/rcsb.org/view/4NCD.pdb|pdb
(no model loaded)
notice my intranet web server is called "twww". i
CAN load local pdb files using the MENU (File->Open
File->Url). i selected PDB as the file type and enter
literally "/data/pdb/test.pdb" in the textbox and
it loaded the test.pdb model into the viewer (slash / is the
DocumentRoot). please have a look at my response to lewis
above that highlighted a subtle issue.
maybe i should take a step back. can iCN3D be used as an
intranet web viewer loading only internal/local files? i am
trying to replace the Jmol viewer (which works well for me
in the past) on my intranet web server with iCN3D because
current web browsers do not support java anymore.
fred
—
You are
receiving this because you are subscribed to this thread.
Reply to this email directly, view
it on GitHub, or mute
the thread.
|
Hi Fred,
The command to load a pdb file is something like the following as mentioned in the help page (https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d.html):
load url https://files.rcsb.org/view/1gpk.pdb
The default file type is pdb and you can leave the "type" parameter out. If you want to load mol2, sdf, and xyz files, you need to add the "type parameter: "load url .../test.mol2 | mol2".
Thanks!
Jiyao
…--------------------------------------------
On Wed, 6/28/17, Jiyao Wang <jiywang3@yahoo.com> wrote:
Subject: Re: [ncbi/icn3d] load url syntax (#15)
To: "ncbi/icn3d" <icn3d@noreply.github.com>, "ncbi/icn3d" <reply@reply.github.com>
Cc: "Subscribed" <subscribed@noreply.github.com>
Date: Wednesday, June 28, 2017, 11:40 AM
Hi Fred,
Thanks for reporting the problem.
Previously I tested to load a pdb file located in a local
web sever into a locally hosted iCn3D.
You can view the source code at https://www.ncbi.nlm.nih.gov/Structure/icn3d/full_ui_all.js.
The function to load the local pdb file is at
iCn3DUI.prototype.downloadUrl =
function (url, type) ...
You can test whether this ajax call is
successful. Because of the same origin policy, your pdb file
should located exactly in the same host as iCn3D. For
example, if iCn3D is located at http://twww.abc.org/icn3d, you pdb file should be
located under http://twww.abc.org/, e.g.,
http://twww.abc.org/data/pdb/test.pdb.
If it's OK, you can send me the exact
testing url. Or you can send me the error message in the
console by pressing "Ctrl", "shift" and "i" together and
clicking the "Console" tab.
I will be back to work at the end of
July. But I have some limited email access before then.
Thanks!
Jiyao
--------------------------------------------
On Tue, 6/27/17, fslee62 <notifications@github.com>
wrote:
Subject: Re: [ncbi/icn3d] load url
syntax (#15)
To: "ncbi/icn3d" <icn3d@noreply.github.com>
Cc: "Subscribed" <subscribed@noreply.github.com>
Date: Tuesday, June 27, 2017, 1:05 PM
hi dachuan,
thanks very much for taking the time
to look into my issues.
while you have given me the syntax for
(1) load pdb and (2)
load url. both did not work in my
case.
for (1), my web server is an INTRAnet
virtual
web server running off of a linux box
(not windows). i
don't quite understand how a windows
drive letter (e.g.,
C:) would work under a linux
filesystem. i tried:
load pdb file c:\data\pdb\test.pdb (no
model
loaded into viewer no error messages)
for (2), notice your url is an
extranet address/path. i
tried:
load url http://twww/data/pdb/test.pdb
| pdb (no model loaded)
load url https://files/rcsb.org/view/4NCD.pdb|pdb
(no model loaded)
notice my intranet web server is
called "twww". i
CAN load local pdb files using the
MENU (File->Open
File->Url). i selected PDB as the
file type and enter
literally "/data/pdb/test.pdb" in the
textbox and
it loaded the test.pdb model into the
viewer (slash / is the
DocumentRoot). please have a look at
my response to lewis
above that highlighted a subtle
issue.
maybe i should take a step back. can
iCN3D be used as an
intranet web viewer loading only
internal/local files? i am
trying to replace the Jmol viewer
(which works well for me
in the past) on my intranet web server
with iCN3D because
current web browsers do not support
java anymore.
fred
—
You are
receiving this because you are
subscribed to this thread.
Reply to this email directly, view
it on GitHub, or mute
the thread.
|
hi jiyao, var cfg={...,url: 'pdb| /path relative to documentroot/test.pdb'} worked (for me) [type before url] yes the code was iCn3DUI.prototype.downloadUrl = function (url, type) this observation is reproducible. however, i didn't look into the code/matter further. am happy enough already. |
Hi Fred,
Glad it worked! You can try to add space before and after "|" in the second URL: var cfg={...,url:'/path relative to documentroot/test.pdb | pdb'}. Or simply leave type out: var cfg={...,url:'/path relative to documentroot/test.pdb'}.
Please let us know if you have further questions!
My best,
Jiyao
…Sent from my iPhone
On Jun 30, 2017, at 2:53 AM, fslee62 ***@***.***> wrote:
Closed #15.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
hi jiyao, i am very new to iCN3D. i am certain i will have other questions and issues if i stick with using icn3d instead of other web-based viewers. thanks for all the ultra-fast support. |
hello, i was able to quickly display the icn3d viewer on my own web server. however, i have not been able to load a "local" pdb file into the viewer using either the command prompt OR coding the path into the html page that initializes the viewer. yes i was able to load the pdb file using the popup menu. i believe the file type info was missing the very first time. so what should be the [???] below?
(1) use command prompt: > load url [???] // manual list only the path inside [???] no type info
(2) within a generated html: var cfg = {..., url: [???], ...};
PS: i learned that once i used the popup menu one time, the file type was "remembered". so from then on i could simply type > load url [local server path to pdb file] and it would work and type not needed. thanks much.
The text was updated successfully, but these errors were encountered: