create account

Visualizing bio-molecules in Computer[Part-2]: Introduction to Tcl scripting environment in VMD (1 SBD prize task inside) by dexterdev

View this thread on: hive.blogpeakd.comecency.com
· @dexterdev · (edited)
$15.02
Visualizing bio-molecules in Computer[Part-2]: Introduction to Tcl scripting environment in VMD (1 SBD prize task inside)
Hi friends! I am back with the second part of my bio-molecular visualization series. If you missed the first part, please see it here:
[Visualizing bio-molecules in Computer[Part-1]: Let us inspect a PDB file and see it using VMD](https://steemit.com/steemstem/@dexterdev/visualizing-bio-molecules-in-computer-part-1-let-us-inspect-a-pdb-file-and-see-it-using-vmd)

<center>![](https://i.imgur.com/BkR2JSE.gif)</center><sub>Simulation of a Ubiquitin molecule(PDB: 1UBQ) in water(not shown for clarity) visualized in VMD using `New cartoon` style</sub>

## Recap from the first part
- We learned about PDB file format.
- Visualized 1E6J.pdb using VMD.

---

What else can we do? When you visualize(or read it in a text editor) this PDB file in VMD, you will notice that it has multiple chains. Let us first get the information about those chains.

## Let us do more with VMD to study 1E6J.pdb


So let us load 1E6J.pdb by `vmd 1E6J.pdb` from terminal. I have changed the `perspective` view to `orthographic` from `Display` option in `VMD Main`. In the `Graphics`->`Representations`, the `Drawing Method` is chosen as `NewCartoon` and the `Coloring Method` is selected as `Chain`. We see three chains in the VMD Display. Each chain is assigned a color automatically. Let us pull this information via `Tcl` scripting language embedded in the VMD software. (I have changed the background color of the VMD from black to white for better visibility of protein chains. Let this be an exercise. I will give 1 SBD prize for the person who correctly comments first how to achieve this. :) )

![](https://i.imgur.com/A0LpQK7.png)

### Loading the Tcl scripting environment

Go to `Extensions` -> `Tk Console` in `VMD Main`. Now what you see is a window like below:

![](https://i.imgur.com/9dBmbGj.png)
Let us do these tasks:
- First, select all atoms.
- Display the total atoms in the PDB file
- Then read the chains in the PDB file and display it.

`set sel [atomselect 0 "all"]`

`set` is a command and `sel` is a variable. `atomselect` is another command which selects `all` atoms from molecule-id `0`. 

![](https://i.imgur.com/1HjQcDF.png)

All atoms in the mol-id 0 that is 1E6J.pdb are transferred to a variable called sel, which should be assigned as $sel. Let us see the number of atoms in this selection. For that give the next command:

`$sel num`

![](https://i.imgur.com/gJd0Tbh.png)

Let us try `$sel get chain` to display all chains.
![](https://i.imgur.com/FBgM7Wt.png)
Something wrong happened. It is displaying all 3 chains. But it is assigned with all atoms.H,L and P are all the 3 chains. We only want the unique list. So let us modify our code as below:
`lsort -unique [$sel get chain]`
![](https://i.imgur.com/WCx6T8Z.png)
We have displayed the name of three chains in the PDB files. Now to count the length of this list use `llength` as below:

`llength [lsort -unique [$sel get chain]]`

![](https://i.imgur.com/hej7GdM.png)

Some shortcuts for VMD in GUI-mode can be found at this link: http://www.ks.uiuc.edu/Research/vmd/vmd-1.7.1/ug/node30.html

To reset the view, just press `=` key. `R` is rotate mode, `T` is translate mode. Once you press these keys while in the visualization mode, you can use your mouse to manipulate things further like to zoom-in or zoom-out using scroll button. You can use mouse right button to move the molecule is a rotation style or translation style etc after using respective keys from the keyboard once.

### Let us rotate the VMD axis

Original:
![](https://i.imgur.com/3IjzCxS.png)

`rotate z by +90`:
![](https://i.imgur.com/sdG4gOu.png)


## Coming up

- Fitting 2 similar chains
- Measuring distances between atoms
- And much more
 
## References

- Humphrey, W., Dalke, A. and Schulten, K., "VMD - Visual Molecular Dynamics", J. Molec. Graphics, 1996, vol. 14, pp. 33-38.
- [VMD userguide](http://www.ks.uiuc.edu/Research/vmd/vmd-1.9.1/ug.pdf)
- [VMD tutorial](http://www.ks.uiuc.edu/Training/TutorialsOverview/vmd/vmd-tutorial.pdf)
- Citing PDB related papers: See [here](https://www.rcsb.org/pages/policies#References).
- Monaco-Malbet, Stéphanie, et al. "Mutual conformational adaptations in antigen and antibody upon complex formation between an Fab and HIV-1 capsid protein p24." Structure 8.10 (2000): 1069-1077. ***(1E6J structure related paper)***

---

### <center>Join #steemSTEM</center>
#steemSTEM is a community project with the goal to promote and support Science, Technology, Engineering and Mathematics on the STEEM blockchain. If you wish to support the #steemSTEM project you can: **Contribute STEM content using the #steemstem tag | Support steemstem authors | Join our curation trail | Join our [Discord community](https://discord.gg/mKSKQ7T) | Delegate SP to steemstem**

#### <center>Convenient Delegation Links:</center>

**<center> [50 SP](https://steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=steemstem&vesting_shares=101913.0159%20VESTS) | [100SP](https://steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=steemstem&vesting_shares=203826.0318%20VESTS) | [500SP](https://steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=steemstem&vesting_shares=1019130.1592%20VESTS) | [1000SP](https://steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=steemstem&vesting_shares=2038258.3074%20VESTS) | [5000SP](https://steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=steemstem&vesting_shares=10191291.5921%20VESTS) | [10000SP](https://steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=steemstem&vesting_shares=20382581.1841%20VESTS) | [50000SP](https://steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=steemstem&vesting_shares=101912901.9206%20VESTS) </center>**</center>
<center>![](https://i.imgur.com/Ya06oXn.jpg)</center><center>Image courtesy: @elvisxx71</center>

#### <center>And to steemSTEM beginners:</center>
<center>You can ask for help in our discord page. There are people ready to help you.</center>

<center>https://images-ext-2.discordapp.net/external/d5TwVdNGN3nrKO_X36gQF_FCrFjg6mQnwI4l488oXRk/https/steemitimages.com/DQmU7Xv1NnXmSE1MAYNN1eM6R5Xs2Cdtczp9DpaopmzopGE/rocket.gif</center><center>gif courtesy: @rocking-dave</center>


---

**<center>All images without mentioning image sources are my creations or snapshots from the computer :)</center>**

## <center>Follow me @dexterdev</center>

---
<center>
    
     ____ _______  ______ _________ ____ ______    
    /  _ /  __\  \//__ __/  __/  __/  _ /  __/ \ |\
    | | \|  \  \  /  / \ |  \ |  \/| | \|  \ | | //
    | |_/|  /_ /  \  | | |  /_|    | |_/|  /_| \// 
    \____\____/__/\\ \_/ \____\_/\_\____\____\__/

</center>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 76 others
properties (23)
authordexterdev
permlinkvisualizing-bio-molecules-in-computer-part-2-introduction-to-tcl-scripting-environment-in-vmd-1-sbd-prize-task-inside
categorysteemstem
json_metadata{"tags":["steemstem","science","visualization","busy","davinci-times"],"users":["elvisxx71","rocking-dave","dexterdev"],"image":["https://i.imgur.com/BkR2JSE.gif","https://i.imgur.com/A0LpQK7.png","https://i.imgur.com/9dBmbGj.png","https://i.imgur.com/1HjQcDF.png","https://i.imgur.com/gJd0Tbh.png","https://i.imgur.com/FBgM7Wt.png","https://i.imgur.com/WCx6T8Z.png","https://i.imgur.com/hej7GdM.png","https://i.imgur.com/3IjzCxS.png","https://i.imgur.com/sdG4gOu.png","https://i.imgur.com/Ya06oXn.jpg","https://images-ext-2.discordapp.net/external/d5TwVdNGN3nrKO_X36gQF_FCrFjg6mQnwI4l488oXRk/https/steemitimages.com/DQmU7Xv1NnXmSE1MAYNN1eM6R5Xs2Cdtczp9DpaopmzopGE/rocket.gif"],"links":["https://steemit.com/steemstem/@dexterdev/visualizing-bio-molecules-in-computer-part-1-let-us-inspect-a-pdb-file-and-see-it-using-vmd","http://www.ks.uiuc.edu/Research/vmd/vmd-1.7.1/ug/node30.html","http://www.ks.uiuc.edu/Research/vmd/vmd-1.9.1/ug.pdf","http://www.ks.uiuc.edu/Training/TutorialsOverview/vmd/vmd-tutorial.pdf","https://www.rcsb.org/pages/policies#References","https://discord.gg/mKSKQ7T","https://steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=steemstem&vesting_shares=101913.0159%20VESTS","https://steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=steemstem&vesting_shares=203826.0318%20VESTS","https://steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=steemstem&vesting_shares=1019130.1592%20VESTS","https://steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=steemstem&vesting_shares=2038258.3074%20VESTS","https://steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=steemstem&vesting_shares=10191291.5921%20VESTS","https://steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=steemstem&vesting_shares=20382581.1841%20VESTS","https://steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=steemstem&vesting_shares=101912901.9206%20VESTS"],"app":"steemit/0.1","format":"markdown"}
created2018-04-30 12:34:03
last_update2018-05-01 05:56:48
depth0
children5
last_payout2018-05-07 12:34:03
cashout_time1969-12-31 23:59:59
total_payout_value11.696 HBD
curator_payout_value3.321 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length6,679
author_reputation17,771,704,061,240
root_title"Visualizing bio-molecules in Computer[Part-2]: Introduction to Tcl scripting environment in VMD (1 SBD prize task inside)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id53,024,959
net_rshares2,437,303,776,306
author_curate_reward""
vote details (140)
@davinci.times ·
$0.51
Hi @dexterdev
We have selected your post as post of the day for our DaVinci Times. Our goal is to help the scientific community of Steemit, and even if our vote is still small we hope to grow in quickly! You will soon receive our sincere upvote! If you are interested in science follow us sto learn more about our project. <center>[![votaXdavinci.witness.jpg](https://steemitimages.com/DQmUs8VCYpQY9r1UtWtzRmBZcgfw8YCZhZZ6gyeqHAomMV5/Prova4.jpg)](https://v2.steemconnect.com/sign/account-witness-vote?witness=davinci.witness&approve=1)
<sub>Immagine CC0 Creative Commons, si ringrazia <a href="https://steemit.com/@mrazura">@mrazura</a> per il logo **ITASTEM**.
**CLICK <a href="https://v2.steemconnect.com/sign/account-witness-vote?witness=davinci.witness&approve=1">HERE</a> AND VOTE FOR <a href="https://steemit.com/@davinci.witness">DAVINCI.WITNESS</a>**</sub></center>
Keep in mind that for organizational reasons it’s necessary to use the “steemstem” and “davinci-times” tags to be voted again.
Greetings from @davinci.witness and the itaSTEM team.
👍  , ,
properties (23)
authordavinci.times
permlinkre-dexterdev-visualizing-bio-molecules-in-computer-part-2-introduction-to-tcl-scripting-environment-in-vmd-1-sbd-prize-task-inside-20180430t174202339z
categorysteemstem
json_metadata{"tags":["steemstem"],"users":["dexterdev","davinci.witness"],"image":["https://steemitimages.com/DQmUs8VCYpQY9r1UtWtzRmBZcgfw8YCZhZZ6gyeqHAomMV5/Prova4.jpg"],"links":["https://v2.steemconnect.com/sign/account-witness-vote?witness=davinci.witness&approve=1","https://steemit.com/@mrazura","https://steemit.com/@davinci.witness"],"app":"steemit/0.1"}
created2018-04-30 17:42:03
last_update2018-04-30 17:42:03
depth1
children0
last_payout2018-05-07 17:42:03
cashout_time1969-12-31 23:59:59
total_payout_value0.416 HBD
curator_payout_value0.098 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,054
author_reputation4,227,856,015,535
root_title"Visualizing bio-molecules in Computer[Part-2]: Introduction to Tcl scripting environment in VMD (1 SBD prize task inside)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id53,077,878
net_rshares85,399,548,056
author_curate_reward""
vote details (3)
@ied ·
$0.03
wow! Never though that a graphical view of molecule could look like piece of art. Just read the first part of this too. When i saw ur article title the thing came up to my mind is a structure of orbiting electrons as like our solar system. But these bio molecules are kind of smart in the molecular universe i guess.
Jokes apart, the article is well written. Will definitely wait for the next dancing bio molecule.
Cheers.
👍  
properties (23)
authoried
permlinkre-dexterdev-visualizing-bio-molecules-in-computer-part-2-introduction-to-tcl-scripting-environment-in-vmd-1-sbd-prize-task-inside-20180430t183741435z
categorysteemstem
json_metadata{"tags":["steemstem"],"app":"steemit/0.1"}
created2018-04-30 18:37:45
last_update2018-04-30 18:37:45
depth1
children2
last_payout2018-05-07 18:37:45
cashout_time1969-12-31 23:59:59
total_payout_value0.026 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length422
author_reputation1,278,083,500,889
root_title"Visualizing bio-molecules in Computer[Part-2]: Introduction to Tcl scripting environment in VMD (1 SBD prize task inside)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id53,086,245
net_rshares4,601,449,360
author_curate_reward""
vote details (1)
@dexterdev · (edited)
Thank you for reading these articles. It's nice to know that there are people interested in these kind of work in steemit. I was doubtful initially to start these ones in steemit. But now I have hopes.😃
👍  
properties (23)
authordexterdev
permlinkre-ied-re-dexterdev-visualizing-bio-molecules-in-computer-part-2-introduction-to-tcl-scripting-environment-in-vmd-1-sbd-prize-task-inside-20180430t190352222z
categorysteemstem
json_metadata{"tags":["steemstem"],"app":"steemit/0.1"}
created2018-04-30 19:03:57
last_update2018-04-30 19:04:15
depth2
children1
last_payout2018-05-07 19:03:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length202
author_reputation17,771,704,061,240
root_title"Visualizing bio-molecules in Computer[Part-2]: Introduction to Tcl scripting environment in VMD (1 SBD prize task inside)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id53,089,984
net_rshares602,048,745
author_curate_reward""
vote details (1)
@ied ·
$0.03
Surely its an interesting topic. I'm sure many other people haven't ever seen a dancing molecule before, as like me. So keep this up, man.
👍  ,
properties (23)
authoried
permlinkre-dexterdev-re-ied-re-dexterdev-visualizing-bio-molecules-in-computer-part-2-introduction-to-tcl-scripting-environment-in-vmd-1-sbd-prize-task-inside-20180501t004906363z
categorysteemstem
json_metadata{"tags":["steemstem"],"app":"steemit/0.1"}
created2018-04-30 20:49:21
last_update2018-04-30 20:49:21
depth3
children0
last_payout2018-05-07 20:49:21
cashout_time1969-12-31 23:59:59
total_payout_value0.022 HBD
curator_payout_value0.007 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length138
author_reputation1,278,083,500,889
root_title"Visualizing bio-molecules in Computer[Part-2]: Introduction to Tcl scripting environment in VMD (1 SBD prize task inside)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id53,104,952
net_rshares5,029,491,161
author_curate_reward""
vote details (2)
@steemboy9 ·
Amazing post! I love it. Hey UPVOTE my post: https://steemit.com/life/@cryptopaparazzi/chapter-one-let-there-be-the-man-and-there-was-a-man-let-there-be-a-woman-and-there-was-sex and FOLLOW ME and I ll do the same :)
👎  
properties (23)
authorsteemboy9
permlinkre-visualizing-bio-molecules-in-computer-part-2-introduction-to-tcl-scripting-environment-in-vmd-1-sbd-prize-task-inside-20180501t083650
categorysteemstem
json_metadata""
created2018-05-01 08:36:51
last_update2018-05-01 08:36:51
depth1
children0
last_payout2018-05-08 08:36:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length216
author_reputation-4,982,767,510,265
root_title"Visualizing bio-molecules in Computer[Part-2]: Introduction to Tcl scripting environment in VMD (1 SBD prize task inside)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id53,194,170
net_rshares-52,342,528,639
author_curate_reward""
vote details (1)