Difference between revisions of "Jmol Application"
AngelHerraez (talk | contribs) (→Starting Jmol Application) |
AngelHerraez (talk | contribs) (command line use of Jmol - clarify and cleanup) |
||
Line 37: | Line 37: | ||
=== Command line options === | === Command line options === | ||
+ | |||
+ | For all the following, calling directly | ||
+ | <code>Jmol.jar</code> ''(some options)'' | ||
+ | will only work as long as the {{file|.jar}} files are associated with Java. Otherwise, the general syntax for all cases is | ||
+ | <code>java -jar Jmol.jar</code> ''(some options)'' | ||
+ | but the 'java -jar' part will be omitted for simplicity. | ||
==== Basic options ==== | ==== Basic options ==== | ||
* To show help for command-line options, use either of these: | * To show help for command-line options, use either of these: | ||
− | + | Jmol.jar '''-h''' | |
− | + | Jmol.jar '''--help''' | |
− | * To load a molecular file immediately after opening Jmol, use | + | * To load a molecular file immediately after opening Jmol, use: |
Jmol.jar ''' ''fileName'' ''' | Jmol.jar ''' ''fileName'' ''' | ||
− | + | * To run a script file immediately after opening Jmol, use: | |
− | * To run | + | Jmol.jar ''' ''scriptFileName'' ''' |
− | Jmol.jar ''' '' | + | * You can combine loading a molecular file, running a script file and running script commands (only Jmol 11.7.x and later): |
− | + | Jmol.jar ''' ''fileName'' -J ''script_commands'' -s ''scriptFileName'' -j ''script_commands'' ''' | |
− | Jmol.jar ''' | + | : which will be run in that order irrespective of their actual order in the command line. Either of the 4 may be omitted. Case of the "-J" is significant when combined with "-s". |
− | |||
− | : | ||
* To set the application's window size, use either of these: | * To set the application's window size, use either of these: | ||
Jmol.jar '''-g ''WIDTHxHEIGHT'' ''' | Jmol.jar '''-g ''WIDTHxHEIGHT'' ''' | ||
Jmol.jar '''--geometry ''WIDTHxHEIGHT'' ''' | Jmol.jar '''--geometry ''WIDTHxHEIGHT'' ''' | ||
− | |||
: using lowercase 'x' and no spaces, e.g. <code>Jmol.jar -g 500x250</code>. By default, size is the last size used or else 500x500. | : using lowercase 'x' and no spaces, e.g. <code>Jmol.jar -g 500x250</code>. By default, size is the last size used or else 500x500. | ||
* To set the language to be used for the interface (default is language of the operating system; [http://wiki.jmol.org/index.php/User:AngelHerraez#Forcing_Jmol_to_open_in_a_certain_language see also]) use: | * To set the language to be used for the interface (default is language of the operating system; [http://wiki.jmol.org/index.php/User:AngelHerraez#Forcing_Jmol_to_open_in_a_certain_language see also]) use: | ||
Line 73: | Line 76: | ||
* -Xmx sets the maximum memory heap size. | * -Xmx sets the maximum memory heap size. | ||
* -Xms sets the minimum memory heap size. | * -Xms sets the minimum memory heap size. | ||
− | Batch files and shell scripts included with Jmol distribution are written to give -Xmx512m (512 MB maximum). | + | Batch files and shell scripts included with Jmol distribution are written to give -Xmx512m (i.e. 512 MB maximum). |
See also [[Jmol_Applet#Giving_JmolApplet_more_memory_to_work_with|the procedure for the applet]]. | See also [[Jmol_Applet#Giving_JmolApplet_more_memory_to_work_with|the procedure for the applet]]. | ||
− | ==== Advanced options | + | ==== Advanced options ==== |
+ | |||
+ | These apply only to Jmol v.11 or later. | ||
''(Some of these need testing to confirm this is the proper syntax)'' | ''(Some of these need testing to confirm this is the proper syntax)'' | ||
* To have the syntax of scripts checked, without actually executing them, use either of these: | * To have the syntax of scripts checked, without actually executing them, use either of these: | ||
− | + | Jmol.jar '''-c''' | |
− | + | Jmol.jar '''--check''' | |
* To have the script commands listed while running them, use either of these: | * To have the script commands listed while running them, use either of these: | ||
− | + | Jmol.jar '''-l''' | |
− | + | Jmol.jar '''--list''' | |
* To get a silent startup operation, use either of these: | * To get a silent startup operation, use either of these: | ||
− | + | Jmol.jar '''-i''' | |
− | + | Jmol.jar '''--silent''' | |
* To have output messages put to the standard system output (e.g. the terminal), instead of to the internal Jmol Java console, use either of these: | * To have output messages put to the standard system output (e.g. the terminal), instead of to the internal Jmol Java console, use either of these: | ||
− | + | Jmol.jar '''-o''' | |
− | + | Jmol.jar '''--noconsole''' | |
* To avoid the use of the screen display (all rendering done only in memory, hence accelerating Jmol), use either of these: | * To avoid the use of the screen display (all rendering done only in memory, hence accelerating Jmol), use either of these: | ||
− | + | Jmol.jar '''-n''' | |
− | + | Jmol.jar '''--nodisplay''' | |
: Normally, this should be used together with other switches like -x (see below). | : Normally, this should be used together with other switches like -x (see below). | ||
* To have the application exit once finished (e.g. after running a script), use either of these: | * To have the application exit once finished (e.g. after running a script), use either of these: | ||
− | + | Jmol.jar '''-x''' | |
− | + | Jmol.jar '''--exit''' | |
* To use a [[Custom_Menus|custom pop-up menu]], defined in a file, use either of these: | * To use a [[Custom_Menus|custom pop-up menu]], defined in a file, use either of these: | ||
− | + | Jmol.jar '''-m ''fileName'' ''' | |
− | + | Jmol.jar '''--menu ''fileName'' ''' | |
* To have Jmol export a snapshot of the rendered model to an image file, use either of these: | * To have Jmol export a snapshot of the rendered model to an image file, use either of these: | ||
− | + | Jmol.jar ''fileNameToLoad'' '''-w ''imageFormat'':''imageFileName'' ''' | |
− | + | Jmol.jar ''fileNameToLoad'' '''--write ''imageFormat'':''imageFileName'' ''' | |
− | + | Jmol.jar -s ''scriptFileNameToLoad'' '''-w ''imageFormat'':''imageFileName'' ''' | |
− | + | Jmol.jar --script ''scriptFileNameToLoad'' '''--write ''imageFormat'':''imageFileName'' ''' | |
: Where ''imageFormat'' may be one of these (and must be followed by a colon): <code>JPG</code> , <code>JPEG</code> , <code>JPG64</code> , <code>PNG</code> , <code>PPM</code> , or <code>CLIP</code> for copying the image to the clipboard instead of writing to a file. | : Where ''imageFormat'' may be one of these (and must be followed by a colon): <code>JPG</code> , <code>JPEG</code> , <code>JPG64</code> , <code>PNG</code> , <code>PPM</code> , or <code>CLIP</code> for copying the image to the clipboard instead of writing to a file. | ||
* To set the quality of images written to file, use either of these: | * To set the quality of images written to file, use either of these: | ||
− | + | Jmol.jar ''fileNameToLoad'' '''-q##''' -w ''imageFormat'':''imageFileName'' | |
− | + | Jmol.jar ''fileNameToLoad'' '''--quality##''' --write ''imageFormat'':''imageFileName'' | |
− | + | Jmol.jar -s ''scriptFileNameToLoad'' '''-q##''' -w ''imageFormat'':''imageFileName'' | |
− | + | Jmol.jar --script ''scriptFileNameToLoad'' '''--quality##''' --write ''imageFormat'':''imageFileName'' | |
: Where the ''##'' may be a number from 1 to 100, meaning quality of JPG (75 by default), or a number from 0 to 9, meaning compression of PNG (2 by default, 9 maximum compression). | : Where the ''##'' may be a number from 1 to 100, meaning quality of JPG (75 by default), or a number from 0 to 9, meaning compression of PNG (2 by default, 9 maximum compression). | ||
Line 128: | Line 133: | ||
'''Create a JVXL file directly:''' | '''Create a JVXL file directly:''' | ||
− | Jmol -ionx iso.spt | + | Jmol -ionx myfile.xyz iso.spt > myfile.jvxl |
: where {{file|iso.spt}} contains: | : where {{file|iso.spt}} contains: | ||
isosurface solvent;show isosurface | isosurface solvent;show isosurface | ||
Line 134: | Line 139: | ||
'''Create a list of measurements:''' | '''Create a list of measurements:''' | ||
− | Jmol -ionx measure.spt | + | Jmol -ionx myfile.xyz measure.spt > measure.txt |
: where {{file|measure.spt}} contains: | : where {{file|measure.spt}} contains: | ||
measure allconnected (*) (*);show measurements | measure allconnected (*) (*);show measurements | ||
Line 145: | Line 150: | ||
'''Check CIF file symmetry:''' | '''Check CIF file symmetry:''' | ||
− | Jmol -ionx symmetry.spt | + | Jmol -ionx myfile.cif symmetry.spt > symmetry.txt |
: where {{file|symmetry.spt}} contains: | : where {{file|symmetry.spt}} contains: | ||
show unitcell;show symmetry;show spacegroup; | show unitcell;show symmetry;show spacegroup; |
Revision as of 21:22, 3 November 2009
- Jmol as a standalone application.
- J(S)mol as a web applet or HTML5 object.
- compatibility with JavaScript frameworks or libraries.
- J(S)mol embedded in wikis or blogs.
- Borrowed JSmol, or running JSmol without your own server.
- Running Jmol using Java Web Start.
- JSmol in a Jupyter notebook.
- Jmol in an Android tablet.
- Troubleshooting.
Contents
Jmol Application
"Jmol Application" is the version of Jmol that runs as a standalone program, in its own window. The program code is written using the Java programming language, therefore to be run it needs an installed Java Virtual Machine (a runtime version of Java, or JRE); this JVM is available for all major operating systems, including Windows, MacOS and Linux.
Control of the molecular model is gained through several means:
- The mouse (documented in Mouse Manual).
- The application's menu and toolbar (at the top of the window), which offer
- File open, export, and print functionalities.
- A limited set of selection and rendering options, and several tools.
- The pop-up menu (or context menu, opened by right-click or Ctrl+click on the model's panel), which offers most funcionality available and is identical to the applet menu.
- The scripting language (same used by the applet); this is available through the File > Script... menu, which opens a "script console" or command-line environment.
Installing Jmol Application
- Get the files from SourceForge.
- Support and operating systems.
- Users: how to install Jmol application for local, standalone use.
- Web page authors: how to install Jmol objects (Jmol / JSmol) embedded within your web pages.
- Installing and Enabling Java (Proteopedia wiki). Has step by step instructions for both Windows and Mac OS X, and for the 5 most popular web browsers.
- Increasing java memory for the applet.
- Web site administrators:
- How to install the application on a web server to be delivered using Java Web Start.
- How to configure a wiki so that it uses the Jmol applet.
- Developers: compile the latest Jmol source code via subversion access.
Download the Jmol package (either .zip
or tar.gz
format) and extract/uncompress only the Jmol.jar file to the folder of your choice.
It is also possible to create a Mac OSX native installer.
To open the application, follow these instructions:
Starting Jmol Application
Several ways:
- Double-click on Jmol.jar file.
- Click on a previously created shortcut (Windows terminology - HowTo).
- Click on a previously created Start menu entry (Windows terminology - HowTo).
- Execute one of the batch files/shell scripts that are part of Jmol distribution (Windows, MacOS, Linux, Unix).
- From the command line:
java -jar Jmol.jar
(of course, issued from the folder/directory where Jmol.jar is, or else pointing to it with a full path). See memory options below. - Double-click on a molecular coordinates file whose extension has been previously associated to Jmol (HowTo).
- only for Macs, Fernanda Foertter has packed Jmol application into a clickable icon / .app type icon that opens up Jmol. This makes it look like a regular 'ol app without all of the exposed jar files. It is available at her site as a dmg file. Instructions: 1) download dmg file; 2) double-click to open; 3) drag Jmol icon to you Applications folder to install; 4) eject dmg; 5) trash dmg file; 6) double-click Jmol icon to open application, or 6a) click and drag to dock to have ready whenever needed.
If you have trouble running the application, see also Troubleshooting.
If you want to attach a Jmol icon to your preferred method of opening Jmol, you can get one from the Recycling Corner.
Command line options
For all the following, calling directly
Jmol.jar
(some options)
will only work as long as the .jar files are associated with Java. Otherwise, the general syntax for all cases is
java -jar Jmol.jar
(some options)
but the 'java -jar' part will be omitted for simplicity.
Basic options
- To show help for command-line options, use either of these:
Jmol.jar -h Jmol.jar --help
- To load a molecular file immediately after opening Jmol, use:
Jmol.jar fileName
- To run a script file immediately after opening Jmol, use:
Jmol.jar scriptFileName
- You can combine loading a molecular file, running a script file and running script commands (only Jmol 11.7.x and later):
Jmol.jar fileName -J script_commands -s scriptFileName -j script_commands
- which will be run in that order irrespective of their actual order in the command line. Either of the 4 may be omitted. Case of the "-J" is significant when combined with "-s".
- To set the application's window size, use either of these:
Jmol.jar -g WIDTHxHEIGHT Jmol.jar --geometry WIDTHxHEIGHT
- using lowercase 'x' and no spaces, e.g.
Jmol.jar -g 500x250
. By default, size is the last size used or else 500x500.
- To set the language to be used for the interface (default is language of the operating system; see also) use:
java -Duser.language=ca|cs|de|en|es|et|fr|nl|pt|tr -jar Jmol.jar
- To report the display speed in either frames per second or milliseconds per frame (the default), use:
java -Ddisplay.speed=fps|ms -jar Jmol.jar
- To set a path where to look for plugins for Jmol, use:
java -Dplugin.dir=/path/to/plugins -jar Jmol.jar
- To specify memory use (see below):
java -Xmxsize -jar Jmol.jar
Giving Jmol more memory to work with
Memory available to Jmol is determined by Java. Less or more memory can be allocated by using:
java -Xmx###m -jar Jmol.jar
where the ### must be substituted by a number in megabytes (hence the "m" after it).
Technically:
- -Xmx sets the maximum memory heap size.
- -Xms sets the minimum memory heap size.
Batch files and shell scripts included with Jmol distribution are written to give -Xmx512m (i.e. 512 MB maximum).
See also the procedure for the applet.
Advanced options
These apply only to Jmol v.11 or later.
(Some of these need testing to confirm this is the proper syntax)
- To have the syntax of scripts checked, without actually executing them, use either of these:
Jmol.jar -c Jmol.jar --check
- To have the script commands listed while running them, use either of these:
Jmol.jar -l Jmol.jar --list
- To get a silent startup operation, use either of these:
Jmol.jar -i Jmol.jar --silent
- To have output messages put to the standard system output (e.g. the terminal), instead of to the internal Jmol Java console, use either of these:
Jmol.jar -o Jmol.jar --noconsole
- To avoid the use of the screen display (all rendering done only in memory, hence accelerating Jmol), use either of these:
Jmol.jar -n Jmol.jar --nodisplay
- Normally, this should be used together with other switches like -x (see below).
- To have the application exit once finished (e.g. after running a script), use either of these:
Jmol.jar -x Jmol.jar --exit
- To use a custom pop-up menu, defined in a file, use either of these:
Jmol.jar -m fileName Jmol.jar --menu fileName
- To have Jmol export a snapshot of the rendered model to an image file, use either of these:
Jmol.jar fileNameToLoad -w imageFormat:imageFileName Jmol.jar fileNameToLoad --write imageFormat:imageFileName Jmol.jar -s scriptFileNameToLoad -w imageFormat:imageFileName Jmol.jar --script scriptFileNameToLoad --write imageFormat:imageFileName
- Where imageFormat may be one of these (and must be followed by a colon):
JPG
,JPEG
,JPG64
,PNG
,PPM
, orCLIP
for copying the image to the clipboard instead of writing to a file.
- To set the quality of images written to file, use either of these:
Jmol.jar fileNameToLoad -q## -w imageFormat:imageFileName Jmol.jar fileNameToLoad --quality## --write imageFormat:imageFileName Jmol.jar -s scriptFileNameToLoad -q## -w imageFormat:imageFileName Jmol.jar --script scriptFileNameToLoad --quality## --write imageFormat:imageFileName
- Where the ## may be a number from 1 to 100, meaning quality of JPG (75 by default), or a number from 0 to 9, meaning compression of PNG (2 by default, 9 maximum compression).
Examples:
Create a JVXL file directly:
Jmol -ionx myfile.xyz iso.spt > myfile.jvxl
isosurface solvent;show isosurface
- will create a myfile.jvxl file containing data for a solvent surface in Jmol isosurface format (
JVXL
).
Create a list of measurements:
Jmol -ionx myfile.xyz measure.spt > measure.txt
measure allconnected (*) (*);show measurements
Measurement Information distance 1.1217928 0.112 nm H 1 #1 C 10 #10 distance 1.4158994 0.142 nm N 2 #2 C 6 #6 distance 1.3865448 0.139 nm N 2 #2 C 7 #7 ...
Check CIF file symmetry:
Jmol -ionx myfile.cif symmetry.spt > symmetry.txt
show unitcell;show symmetry;show spacegroup;
Anything that can be "shown" can be dumped to a file this way. And anything you can get from getProperty will do the same.
Forcing Jmol to open in a certain language
Jmol includes several languages (technically called localizations) for the user interface (top menu and pop-up menu). Jmol will open by default with the interface using the language of your operating system (ref.). However, if you need to change this:
- Starting Jmol 11.1.30, the language in application can be switched anytime, from the pop-up menu, "Language" item near the bottom.
- Or, using the scripting language:
language = "de"
(you must use the keyword "language" and the two-letter language code: ca, cs, de, en, es, et, fr, nl, pt, tr) - This is an old method, only needed for versions below 11.1.30: If you want to force a certain language, you must start Jmol with
java -Duser.language=es -jar Jmol.jar # forces Spanish (Español)
java -Duser.language=de -jar Jmol.jar # forces German (Deutsch)
java -Duser.language=en -jar Jmol.jar # forces English
- etc.
See also the procedure for the applet.
Contributors
AngelHerraez, EricMartz, Pimpim, Cudo29, NicolasVervelle, Green