Re: [Jmol-users] how to parse JSON data within Jmol

2016-01-13 Thread Paul PILLOT
Le 13-01-2016 à 20:58, Paul PILLOT a écrit : Hi Eric, rcsb implements a REST API that you can query through Ajax to get many answers to a lot of question. Here is an example of code I designed to get informations from a PDB, such as the number and names of chains, the ligands, the related pubm

Re: [Jmol-users] how to parse JSON data within Jmol

2016-01-13 Thread Robert Hanson
Here's another idea: Check the "divided" directory at RCSB for the file size: x = "1crn" print load("http://ftp.wwpdb.org/pub/pdb/data/structures/divided/pdb/ *"+x[2][3]+"*/").lines.find(x)[0].trim().split(" ")[0] The result will be something like "1.5M" or "33K" On Wed, Jan 13, 2016 at 5:00 P

Re: [Jmol-users] how to parse JSON data within Jmol

2016-01-13 Thread Eric Martz
That looks wonderful, Rolf. I'll let you know after I try it. Thanks so much!! -Eric On 1/13/16 2:28 PM, Rolf Huehne wrote: > On 01/13/2016 08:22 PM, Rolf Huehne wrote: >> On 01/13/2016 07:37 PM, Eric Martz wrote: >>> Dear Angel (and everyone), >>> >>> For years I have wanted a way to find out (in

Re: [Jmol-users] how to parse JSON data within Jmol

2016-01-13 Thread Rolf Huehne
On 01/13/2016 08:22 PM, Rolf Huehne wrote: > On 01/13/2016 07:37 PM, Eric Martz wrote: >> Dear Angel (and everyone), >> >> For years I have wanted a way to find out (in javascript or in JSmol) >> the number of atoms (or molecular weight) of a PDB entry before >> attempting to load it into JSmol. Bu

Re: [Jmol-users] how to parse JSON data within Jmol

2016-01-13 Thread Rolf Huehne
On 01/13/2016 07:37 PM, Eric Martz wrote: > Dear Angel (and everyone), > > For years I have wanted a way to find out (in javascript or in JSmol) > the number of atoms (or molecular weight) of a PDB entry before > attempting to load it into JSmol. But I have not known how to do this. > > If you know

Re: [Jmol-users] how to parse JSON data within Jmol

2016-01-13 Thread Otis Rothenberger
Having read the question more thoroughly, a thought, albeit specific to RCSB... You could use AJAX to read the following with a server side script : http://www.rcsb.org/pdb/download/downloadFile.do?fileFormat=pdb&compression=NO&structureId=1smd You can’t read RCSB files directly client side like

Re: [Jmol-users] how to parse JSON data within Jmol

2016-01-13 Thread Eric Martz
Thanks, Otis, But I need to know BEFORE I load the model(s). I envision this as being a two-step process. Given a PDB code, first query to find out the weight or number of atoms and number of models. Then decide how to load: -all atoms, all models? -all atoms, model 1 only? -alpha carbons and nuc

Re: [Jmol-users] how to parse JSON data within Jmol

2016-01-13 Thread Otis Rothenberger
Oops! You want it before it loads. Hmmm... -- Otis Rothenberger o...@chemagic.org http://chemagic.org > On Jan 13, 2016, at 1:44 PM, Otis Rothenberger wrote: > > Eric, > > alert(Jmol.evaluateVar(jmolApplet0, "{*}.size”)) > > should do the trick. > > Otis > -- > Otis Rothenberger > o...@chem

Re: [Jmol-users] how to parse JSON data within Jmol

2016-01-13 Thread Otis Rothenberger
Eric, alert(Jmol.evaluateVar(jmolApplet0, "{*}.size”)) should do the trick. Otis -- Otis Rothenberger o...@chemagic.org http://chemagic.org > On Jan 13, 2016, at 1:37 PM, Eric Martz wrote: > > Dear Angel (and everyone), > > For years I have wanted a way to find out (in javascript or in JSmol

Re: [Jmol-users] how to parse JSON data within Jmol

2016-01-13 Thread Eric Martz
Dear Angel (and everyone), For years I have wanted a way to find out (in javascript or in JSmol) the number of atoms (or molecular weight) of a PDB entry before attempting to load it into JSmol. But I have not known how to do this. If you know, please send me a sample of the code. When the siz

Re: [Jmol-users] how to parse JSON data within Jmol

2016-01-12 Thread Angel Herráez
Excellent! Thanks a lot, Rolf -- Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corr

Re: [Jmol-users] how to parse JSON data within Jmol

2016-01-12 Thread Rolf Huehne
On 01/12/2016 06:21 PM, Angel Herráez wrote: > Hi all > > I am trying to parse some data that is, as far as I can guess, in JSON format > Data is at http://www.ebi.ac.uk/pdbe/api/pdb/entry/molecules/2k8v > > I am trying to do > f = load("http://www.ebi.ac.uk/pdbe/api/pdb/entry/molecules/2k8v";) >

[Jmol-users] how to parse JSON data within Jmol

2016-01-12 Thread Angel Herráez
Hi all I am trying to parse some data that is, as far as I can guess, in JSON format Data is at http://www.ebi.ac.uk/pdbe/api/pdb/entry/molecules/2k8v I am trying to do f = load("http://www.ebi.ac.uk/pdbe/api/pdb/entry/molecules/2k8v";) and "print f" shows it {"2k8v":[{ "entity_id":1,