Difference between revisions of "Jmol-Application/C2/Script-Console-and-Script-Commands/English-timed"
From Script | Spoken-Tutorial
PoojaMoolya (Talk | contribs) |
Sandhya.np14 (Talk | contribs) |
||
Line 9: | Line 9: | ||
|- | |- | ||
| 00:08 | | 00:08 | ||
− | |In this tutorial, we will learn | + | |In this tutorial, we will learn: |
|- | |- | ||
Line 25: | Line 25: | ||
|- | |- | ||
| 00:21 | | 00:21 | ||
− | |* Display lines of text on the '''panel''' | + | |* Display lines of text on the '''panel'''. |
|- | |- | ||
| 00:24 | | 00:24 | ||
− | | To follow this tutorial | + | | To follow this tutorial, |
|- | |- | ||
| 00:26 | | 00:26 | ||
− | | | + | |you should know how to |
|- | |- | ||
| 00:27 | | 00:27 | ||
− | | | + | | create and '''edit''' molecular models in '''Jmol Application'''. |
|- | |- | ||
Line 45: | Line 45: | ||
|- | |- | ||
| 00:37 | | 00:37 | ||
− | | To record this tutorial I am using | + | | To record this tutorial, I am using: |
|- | |- | ||
| 00:39 | | 00:39 | ||
− | | | + | | * '''Ubuntu '''OS version. 12.04 |
|- | |- | ||
Line 57: | Line 57: | ||
|- | |- | ||
| 00:47 | | 00:47 | ||
− | |* '''Java''' version 7 | + | |* '''Java''' version 7. |
|- | |- | ||
| 00:51 | | 00:51 | ||
− | | Display on '''Jmol''' '''panel '''can be modified using | + | | Display on '''Jmol''' '''panel '''can be modified using: |
|- | |- | ||
Line 81: | Line 81: | ||
|- | |- | ||
| 01:13 | | 01:13 | ||
− | |In this tutorial we will learn to use '''script commands.''' | + | |In this tutorial, we will learn to use '''script commands.''' |
|- | |- | ||
Line 89: | Line 89: | ||
|- | |- | ||
| 01:22 | | 01:22 | ||
− | |'''Script commands''' control the display of a '''model''' on '''panel''' | + | |'''Script commands''' control the display of a '''model''' on '''panel'''. |
|- | |- | ||
Line 101: | Line 101: | ||
|- | |- | ||
| 01:36 | | 01:36 | ||
− | |Documentation of | + | |Documentation of Jmol's scripting language and list of commands is available at this link. |
− | [ | + | [http://chemapps.stolaf.edu/jmol/docs/] |
|- | |- | ||
| 01:44 | | 01:44 | ||
− | | Now how to use''' script commands''' | + | | Now, how to use''' script commands'''? |
|- | |- | ||
Line 118: | Line 118: | ||
|- | |- | ||
| 01:58 | | 01:58 | ||
− | |It is available on the menu bar, under '''File '''and '''Console '''option | + | |It is available on the menu bar, under '''File '''and '''Console '''option. |
|- | |- | ||
Line 150: | Line 150: | ||
|- | |- | ||
| 02:40 | | 02:40 | ||
− | |Other buttons, namely, '''Variables, Clear, History '''and '''State | + | |Other buttons, namely, '''Variables, Clear, History '''and '''State '''are also present on this window. |
|- | |- | ||
Line 166: | Line 166: | ||
|- | |- | ||
| 03:05 | | 03:05 | ||
− | | How to write these commands | + | | How to write these commands? |
|- | |- | ||
Line 174: | Line 174: | ||
|- | |- | ||
| 03:13 | | 03:13 | ||
− | |'''Script commands '''start with a '''command word''' | + | |'''Script commands '''start with a '''command word''', |
|- | |- | ||
| 03:17 | | 03:17 | ||
− | | | + | | continues with a set of parameters separated by spaces. |
|- | |- | ||
| 03:22 | | 03:22 | ||
− | |And is terminated by the | + | |And is terminated by the end of line character or '''semicolon'''. |
|- | |- | ||
Line 190: | Line 190: | ||
|- | |- | ||
| 03:33 | | 03:33 | ||
− | |Press '''Enter''' key on the keyboard | + | |Press '''Enter''' key on the keyboard to activate the command. |
|- | |- | ||
Line 198: | Line 198: | ||
|- | |- | ||
| 03:44 | | 03:44 | ||
− | | For example, to change the color of all the '''carbons''' in '''propane | + | | For example, to change the color of all the '''carbons''' in '''propane''' to orange- place the cursor on the '''Script Console''' window. |
|- | |- | ||
| 03:53 | | 03:53 | ||
− | | At the '''dollar prompt, '''type''' select carbon semicolon color atoms orange''' | + | | At the '''dollar prompt, '''type: ''' select carbon semicolon color atoms orange''' |
|- | |- | ||
Line 214: | Line 214: | ||
|- | |- | ||
| 04:14 | | 04:14 | ||
− | | Now to change the color of all bonds to blue | + | | Now, to change the color of all bonds to blue- |
|- | |- | ||
| 04:18 | | 04:18 | ||
− | |At the | + | |At the dollar prompt, type: |
|- | |- | ||
Line 226: | Line 226: | ||
|- | |- | ||
|04:26 | |04:26 | ||
− | | | + | |press '''Enter.''' |
|- | |- | ||
Line 238: | Line 238: | ||
|- | |- | ||
| 04:39 | | 04:39 | ||
− | |At the | + | |At the dollar prompt, type: '''wireframe 0.05''' |
|- | |- | ||
Line 250: | Line 250: | ||
|- | |- | ||
| 04:58 | | 04:58 | ||
− | | Similarly, to increase the size of bonds, at the '''prompt''', type '''wireframe 0.1''' | + | | Similarly, to increase the size of bonds, at the '''prompt''', type: '''wireframe 0.1''' |
|- | |- | ||
Line 262: | Line 262: | ||
|- | |- | ||
| 05:20 | | 05:20 | ||
− | |At the | + | |At the dollar prompt, type: '''spacefill 0.2''' |
|- | |- | ||
Line 278: | Line 278: | ||
|- | |- | ||
| 05:39 | | 05:39 | ||
− | | Similarly, to increase the size of the atoms type: | + | | Similarly, to increase the size of the atoms, type: |
|- | |- | ||
Line 298: | Line 298: | ||
|- | |- | ||
| 05:59 | | 05:59 | ||
− | |The percentage represents the '''vanderwaals''' | + | |The percentage represents the '''vanderwaals radius''' of the atom. |
|- | |- | ||
| 06:04 | | 06:04 | ||
− | | For example, type '''cpk 20% '''and press '''Enter'''. | + | | For example, type: '''cpk 20% '''and press '''Enter'''. |
|- | |- | ||
Line 318: | Line 318: | ||
|- | |- | ||
| 06:27 | | 06:27 | ||
− | |It is followed by the position of the text | + | |It is followed by the position of the text on the screen. |
|- | |- | ||
Line 326: | Line 326: | ||
|- | |- | ||
| 06:39 | | 06:39 | ||
− | |So, type '''set echo top center semicolon echo Propane''' | + | |So, type: '''set echo top center semicolon echo Propane''' |
and press '''Enter'''. | and press '''Enter'''. | ||
Line 343: | Line 343: | ||
|- | |- | ||
| 07:04 | | 07:04 | ||
− | | At the | + | | At the dollar prompt, |
|- | |- | ||
| 07:06 | | 07:06 | ||
− | |type '''set echo bottom left semicolon echo This is a model of Propane''' | + | |type: '''set echo bottom left semicolon echo This is a model of Propane''' |
|- | |- | ||
Line 359: | Line 359: | ||
|- | |- | ||
| 07:22 | | 07:22 | ||
− | | It is also possible to change the color, size and font of the displayed text. | + | | It is also possible to change the '''color, size''' and '''font''' of the displayed text. |
|- | |- | ||
Line 367: | Line 367: | ||
|- | |- | ||
| 07:34 | | 07:34 | ||
− | |At the dollar prompt type '''font echo 20 Arial italic''' | + | |At the dollar prompt ($), type: '''font echo 20 Arial italic''' |
|- | |- | ||
|07:42 | |07:42 | ||
− | |Press Enter | + | |Press '''Enter'''. |
|- | |- | ||
Line 383: | Line 383: | ||
|- | |- | ||
| 07:55 | | 07:55 | ||
− | |So | + | |So, type: '''"color echo yellow"''' and press '''Enter.''' |
|- | |- | ||
Line 391: | Line 391: | ||
|- | |- | ||
| 08:05 | | 08:05 | ||
− | | Likewise, you can explore many more | + | | Likewise, you can explore many more '''command'''s and observe the changes. |
|- | |- | ||
Line 399: | Line 399: | ||
|- | |- | ||
| 08:13 | | 08:13 | ||
− | |In this tutorial we have | + | |In this tutorial, we have learned about: |
|- | |- | ||
Line 407: | Line 407: | ||
|- | |- | ||
| 08:17 | | 08:17 | ||
− | |* '''Script Console ''' | + | |* '''Script Console. ''' |
|- | |- | ||
| 08:18 | | 08:18 | ||
− | |We also | + | |We also learned to: |
|- | |- | ||
| 08:19 | | 08:19 | ||
− | |* Change the display properties of the model | + | |* Change the display properties of the model by using '''script commands''' and |
|- | |- | ||
Line 423: | Line 423: | ||
|- | |- | ||
| 08:28 | | 08:28 | ||
− | | As an assignment | + | | As an assignment- |
|- | |- | ||
Line 435: | Line 435: | ||
|- | |- | ||
| 08:36 | | 08:36 | ||
− | | | + | | Change the color of all '''hydrogens''' to blue. |
|- | |- | ||
Line 443: | Line 443: | ||
|- | |- | ||
| 08:43 | | 08:43 | ||
− | | and | + | | and set the molecule to spin. |
|- | |- | ||
|08:46 | |08:46 | ||
| Watch the video available at this URL. | | Watch the video available at this URL. | ||
− | + | http://spoken-tutorial.org/What]_is_a_Spoken_Tutorial | |
|- | |- | ||
| 08:49 | | 08:49 | ||
− | |It summarizes the Spoken Tutorial project | + | |It summarizes the Spoken Tutorial project. |
|- | |- | ||
| 08:52 | | 08:52 | ||
− | |If you do not have good bandwidth, you can download and watch it | + | |If you do not have good bandwidth, you can download and watch it. |
|- | |- | ||
|08:57 | |08:57 | ||
− | | The Spoken Tutorial Project | + | | The Spoken Tutorial Project team: |
|- | |- | ||
| 08:59 | | 08:59 | ||
− | |Conducts workshops using spoken tutorials | + | |* Conducts workshops using spoken tutorials. |
|- | |- | ||
| 09:02 | | 09:02 | ||
− | |Gives certificates to those who pass an on-line test | + | |Gives certificates to those who pass an on-line test. |
|- | |- | ||
| 09:06 | | 09:06 | ||
− | |For more details, please write to contact@spoken-tutorial.org | + | |For more details, please write to: contact@spoken-tutorial.org |
|- | |- | ||
| 09:13 | | 09:13 | ||
− | | Spoken Tutorial | + | | '''Spoken Tutorial''' project is a part of the '''Talk to a Teacher''' project. |
|- | |- | ||
| 09:17 | | 09:17 | ||
− | |It is supported by the National Mission on Education through ICT, MHRD, Government of India | + | |It is supported by the National Mission on Education through ICT, MHRD, Government of India. |
|- | |- | ||
| 09:24 | | 09:24 | ||
− | |More information on this | + | |More information on this mission is available at this link: |
+ | http://spoken-tutorial.org/NMEICT-Intro | ||
|- | |- | ||
| 09:30 | | 09:30 | ||
− | | This is Snehalatha from IIT Bombay signing off. | + | | This is Snehalatha from '''IIT Bombay''', signing off. |
Thank you for joining. | Thank you for joining. | ||
|} | |} |
Revision as of 10:16, 14 September 2015
Time | Narration |
00:01 | Welcome to this tutorial on Script console and script commands in Jmol Application. |
00:08 | In this tutorial, we will learn: |
00:11 | * About script commands |
00:13 | * How to use script console window |
00:16 | * Change display of model by using script commands |
00:21 | * Display lines of text on the panel. |
00:24 | To follow this tutorial, |
00:26 | you should know how to |
00:27 | create and edit molecular models in Jmol Application. |
00:32 | If not, watch the relevant tutorials available on our website. |
00:37 | To record this tutorial, I am using: |
00:39 | * Ubuntu OS version. 12.04 |
00:44 | * Jmol version 12.2.2 |
00:47 | * Java version 7. |
00:51 | Display on Jmol panel can be modified using: |
00:55 | * Options in Menu bar |
00:57 | * Options in the Pop-up-menu or |
01:00 | * by Scripting commands on the script console. |
01:04 | We had learnt to modify display using menu bar and Pop-up-menu in earlier tutorials. |
01:13 | In this tutorial, we will learn to use script commands. |
01:18 | A set of commands is called Script command. |
01:22 | Script commands control the display of a model on panel. |
01:27 | Jmol uses a command language, based on RasMol program. |
01:32 | Writing such commands is called scripting. |
01:36 | Documentation of Jmol's scripting language and list of commands is available at this link. |
01:44 | Now, how to use script commands? |
01:47 | Script commands are typed on the “Script console” window. |
01:53 | Script console is the command line interface of Jmol. |
01:58 | It is available on the menu bar, under File and Console option. |
02:03 | This is Jmol Application window with a model of propane on screen. |
02:08 | Let us now learn to use Script console to change the display. |
02:12 | To open a Script console window, click on File menu in the menu bar. |
02:19 | In the drop-down, scroll down and click on Console. |
02:24 | Jmol script console window opens on the screen. |
02:29 | Script console window has a text area to type the commands. |
02:34 | At the bottom of the window, there is a button to open the Script editor window. |
02:40 | Other buttons, namely, Variables, Clear, History and State are also present on this window. |
02:49 | Click on the Help button to open a page showing a list of available script commands. |
02:57 | Click on OK button to close this window. |
03:01 | Let us now try to write a few simple script commands. |
03:05 | How to write these commands? |
03:08 | Type the command after the $ prompt on the Script console window. |
03:13 | Script commands start with a command word, |
03:17 | continues with a set of parameters separated by spaces. |
03:22 | And is terminated by the end of line character or semicolon. |
03:27 | The command will appear red, until you have completed typing the command. |
03:33 | Press Enter key on the keyboard to activate the command. |
03:37 | I am using Kmag screen magnifier to magnify the console. |
03:44 | For example, to change the color of all the carbons in propane to orange- place the cursor on the Script Console window. |
03:53 | At the dollar prompt, type: select carbon semicolon color atoms orange |
04:05 | Press Enter key on the keyboard. |
04:08 | The Propane model on the panel, now has all the carbons in orange color. |
04:14 | Now, to change the color of all bonds to blue- |
04:18 | At the dollar prompt, type: |
04:20 | select all bonds semicolon color bonds blue |
04:26 | press Enter. |
04:29 | Observe that all the bonds in propane model are now blue in colour. |
04:35 | Next, let us change the size of bonds. |
04:39 | At the dollar prompt, type: wireframe 0.05 |
04:45 | The decimal number is used to specify the radius of bonds, in angstroms. Press Enter. |
04:53 | Note the change in size of the bonds in the Propane model. |
04:58 | Similarly, to increase the size of bonds, at the prompt, type: wireframe 0.1 |
05:07 | Once again, note the change in size of the bonds. |
05:12 | To change the size of atoms, we will use the command spacefill followed by a decimal number. |
05:20 | At the dollar prompt, type: spacefill 0.2 |
05:26 | The decimal number represents radius of the atom, in angstroms. |
05:30 | Press Enter. |
05:33 | Observe the size of atoms in the propane molecule decrease in size. |
05:39 | Similarly, to increase the size of the atoms, type: |
05:43 | spacefill 0.5 |
05:46 | Press Enter. |
05:48 | You can see the change in size of the atoms. |
05:51 | Alternately, we can also use command cpk followed by percentage or decimal number. |
05:59 | The percentage represents the vanderwaals radius of the atom. |
06:04 | For example, type: cpk 20% and press Enter. |
06:11 | Note the change in the size of the atoms. |
06:15 | It is possible to write commands, to display lines of text on the Jmol panel. |
06:22 | The command line for text starts with 'set echo'. |
06:27 | It is followed by the position of the text on the screen. |
06:31 | For example, we will display the name of the molecule as 'Propane' at the top center of the panel. |
06:39 | So, type: set echo top center semicolon echo Propane
and press Enter. |
06:48 | We can see the text 'Propane' displayed at the top center of the panel. |
06:54 | We can also display other lines of text on the panel. |
06:58 | For example, I want some text in the bottom left corner of the panel. |
07:04 | At the dollar prompt, |
07:06 | type: set echo bottom left semicolon echo This is a model of Propane |
07:15 | Press Enter. |
07:17 | We can see the text line at the bottom left corner of the panel. |
07:22 | It is also possible to change the color, size and font of the displayed text. |
07:29 | For example, I want the text to be in Arial Italic font. |
07:34 | At the dollar prompt ($), type: font echo 20 Arial italic |
07:42 | Press Enter. |
07:43 | This will convert the text to 'Arial Italic' font. |
07:48 | To change color of the text, we will use color echo followed by name of the colour. |
07:55 | So, type: "color echo yellow" and press Enter. |
08:01 | Note the change in font colour. |
08:05 | Likewise, you can explore many more commands and observe the changes. |
08:11 | Let's Summarize: |
08:13 | In this tutorial, we have learned about: |
08:15 | * Script Commands and |
08:17 | * Script Console. |
08:18 | We also learned to: |
08:19 | * Change the display properties of the model by using script commands and |
08:24 | * Display lines of text on the panel. |
08:28 | As an assignment- |
08:30 | Create a model of 3-methyl-pentane. |
08:33 | Use script commands to do the following. |
08:36 | Change the color of all hydrogens to blue. |
08:40 | Change the color of all the bonds to red |
08:43 | and set the molecule to spin. |
08:46 | Watch the video available at this URL.
http://spoken-tutorial.org/What]_is_a_Spoken_Tutorial |
08:49 | It summarizes the Spoken Tutorial project. |
08:52 | If you do not have good bandwidth, you can download and watch it. |
08:57 | The Spoken Tutorial Project team: |
08:59 | * Conducts workshops using spoken tutorials. |
09:02 | Gives certificates to those who pass an on-line test. |
09:06 | For more details, please write to: contact@spoken-tutorial.org |
09:13 | Spoken Tutorial project is a part of the Talk to a Teacher project. |
09:17 | It is supported by the National Mission on Education through ICT, MHRD, Government of India. |
09:24 | More information on this mission is available at this link: |
09:30 | This is Snehalatha from IIT Bombay, signing off.
Thank you for joining. |