On 10/19/2012 02:48 PM, Rolf Huehne wrote:
> On 10/19/2012 02:33 PM, Robert Hanson wrote:
>> Rolf,
>>
>> Are you looking for something more than
>>
>> try{
>>
>> } catch {
>>
>>
>> }
>>
>> ?
> No, I think that will be sufficient. I remembered having read about
> something like this while following the 'Jmol-users' list but didn/t
> remember it's name and didn't find it myself.
>
I tried it with Jmol.jar 13.1.7. With display and window it worked as 
expected. But when running it with the "-n" switch the script stopped 
and also didn't show my own error message:

===== With window (as expected) =================
NOTE: loading 3021. file '/pdb_mirror/current/gz/au/pdb2qgp.ent.gz' with 
filter ':A'...
ERROR: could NOT LOAD 3021. file 
'/pdb_mirror/current/gz/au/pdb2qgp.ent.gz' with filter ':A'
/pdb_mirror/current/gz/au/pdb2qgp.ent.gz (No such file or directory)
----line 1 command 1 of try:
          load "/pdb_mirror/current/gz/au/pdb2qgp.ent.gz" 0 filter >> 
":A" <<
----line 7 command 5 of function analysis_test:
          end
----line 3038 command 3022 of load_chains.scr:
          analysis_test ( "2qgp" , "A" , "3021" )
STATUS: pdb_id='2qgp' chain='A' status='ERROR'
===================================================

===== Without window (script stops) ==================
NOTE: loading 3021. file 
'/usr2/pollux/idb/pdb_mirror/current/gz/au/pdb2qgp.ent.gz' with filter 
':A'...

FileManager.getAtomSetCollectionFromFile(/usr2/pollux/idb/pdb_mirror/current/gz/au/pdb2qgp.ent.gz)
FileManager opening /usr2/pollux/idb/pdb_mirror/current/gz/au/pdb2qgp.ent.gz
file ERROR: /usr2/pollux/idb/pdb_mirror/current/gz/au/pdb2qgp.ent.gz
/usr2/pollux/idb/pdb_mirror/current/gz/au/pdb2qgp.ent.gz (No such file 
or directory)
Time for 
openFile(/usr2/pollux/idb/pdb_mirror/current/gz/au/pdb2qgp.ent.gz): 1 ms
eval ERROR: /usr2/pollux/idb/pdb_mirror/current/gz/au/pdb2qgp.ent.gz (No 
such file or directory)
----line 1 command 1 of try:
          load 
"/usr2/pollux/idb/pdb_mirror/current/gz/au/pdb2qgp.ent.gz" 0 filter >> 
":A" <<
----line 7 command 5 of function analysis_test:
          end
----line 3038 command 3022 of load_chains.scr:
          analysis_test ( "2qgp" , "A" , "3021" )
===================================================

Below is shown my function and the first few function calls (I added the 
'zap' just to be able to see a difference when calling it interactively 
with window):

====== Script (truncated) =========================
function analysis_test (pdb_id,chain,counter) {
   zap;
   var filename = "/pdb_mirror/current/gz/au/pdb" + pdb_id + ".ent.gz";
   var chain_filter = ":" + chain;
   show @{"NOTE: loading " + counter + ". file '" + filename + "' with 
filter '" + chain_filter + "'..."};
   try {
     load @filename 0 FILTER @chain_filter;
   } catch(error_message) {
     show @{"ERROR: could NOT LOAD " + counter + ". file '" + filename + 
"' with filter '" + chain_filter + "'\n" + error_message};
     show @{"STATUS: pdb_id='" + pdb_id + "' chain='" + chain + "' 
status='ERROR'"};
     return "";
   }
   show @{"NOTE:   file '" + filename + "'  with filter '" + 
chain_filter + "' loaded successfully"};
   show @{"STATUS: pdb_id='" + pdb_id + "' chain='" + chain + "' 
status='OK'"};
   return "";
}
analysis_test("4axd","A","1")
analysis_test("7odc","A","2")
analysis_test("3swh","A","3")
analysis_test("3ram","A","4")
analysis_test("4eiu","A","5")
===================================================

JmolData.jar also stops directly.

But there was an additional problem with JmolData.jar. It didn't even 
reach file 3021 but stopped much earlier without any error message at 
all. It stopped for example sometimes at file 478 or sometimes at file 
511 (upper limit until now).
(COMMAND: java -Xmx5000m -jar JmolData.jar -ons load_chains.scr)

I also noticed that within the "try/catch" part the "print" command (in 
contrast to the "show" command) apparantly didn't knew the variables 
"filename" and "chain_filter" if I declared them as local variables 
within the function (var filename = "xyz";).

Regards,
Rolf

-- 

Rolf Huehne
Postdoc

Leibniz Institute for Age Research - Fritz Lipmann Institute (FLI)
Beutenbergstrasse 11
07745 Jena, Germany

Phone:   +49 3641 65 6205
Fax:     +49 3641 65 6210
E-Mail:  [email protected]
Website: http://www.fli-leibniz.de

           Scientific Director: Prof. Dr. K. Lenhard Rudolph
        Head of Administration: Dr. Daniele Barthel
Chairman of Board of Trustees: Dennys Klein

VAT No: DE 153 925 464
Register of Associations: No. 296, Amtsgericht Jena
Tax Number: 162/141/08228


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to