tag:blogger.com,1999:blog-20862074677631216802024-03-27T16:53:50.774-07:00Musings on SoftwareThis web log is my online notebook for software tips and hacks to make my life and hopefully that of someone else just a little bit easy. Should you find any mistakes or have any useful suggestions, please do not hesitate to write to me.
Peace!
Pavan GhattyPavan K. Ghattyhttp://www.blogger.com/profile/11254810960593439120noreply@blogger.comBlogger121125tag:blogger.com,1999:blog-2086207467763121680.post-9293178827677509152018-04-04T10:52:00.002-07:002018-04-04T10:56:01.311-07:00Using Bio3D to convert 3 letter amino acid to 1 letter<div dir="ltr" style="text-align: left;" trbidi="on">
Bio3D is a package written for the R platform. Details are in <a href="http://thegrantlab.org/bio3d/index.php">thegrantlab.org/bio3d/index.php</a><br />
<br />
<br />
library(bio3d, lib.loc = "~/R")<br />
<div>
pdb < - read.pdb("File.pdb")</div>
<div>
atom.select(pdb,"calpha")$atom ---- Gives the atom index of all alpha carbons</div>
<div>
pdb$atom$resid -- Gives the residue ID of all atoms</div>
<div>
<br /></div>
<div>
pdb$atom$resid(atom.select(pdb,"calpha")$atom) --- Combines the two</div>
<div>
</div>
</div>
Pavan K. Ghattyhttp://www.blogger.com/profile/11254810960593439120noreply@blogger.com5tag:blogger.com,1999:blog-2086207467763121680.post-59186535692403370082018-04-01T07:19:00.001-07:002018-04-01T07:19:16.534-07:00Scanning speed using Airport vs CUPS Driver<div dir="ltr" style="text-align: left;" trbidi="on">
Just found out - the really painful way - that the Brother MFC L2700DW CUPS driver makes scanning documents 10-15 times faster than the default Airport driver that Apple automagically installs to make your life "simple". Guess it works great till you get into heavy usage. Haven't been able to set up the duplex scanning though. It was really the duplex scanning that took me to Brother's website which lists their CUPS driver for Macs. </div>
Pavan K. Ghattyhttp://www.blogger.com/profile/11254810960593439120noreply@blogger.com0tag:blogger.com,1999:blog-2086207467763121680.post-34199949523062038862016-12-14T15:38:00.004-08:002017-04-10T11:38:03.989-07:00Resetting networking on RedHat 6.5<div dir="ltr" style="text-align: left;" trbidi="on">
Networking on my work RHEL6.5 desktop got hosed recently and the following set of commands helped recover from the issue.<br />
<br />
service nfs restart<br />
service rpcbind restart<br />
service sshd restart<br />
service nscd restart<br />
service network restart<br />
service nslcd restart<br />
service autofs restart<br />
<br />
In addition to this I found that the /etc/resolv.conf was getting edited during reboot preventing the NFS server from working properly. While trying to find a solution to this problem I learned how to access non-responsive computers via grub login and then check the status of various services using /<span style="color: blue;">service xxx status</span>/ and verify the on/off schedule of various services using <span style="color: blue;">chkconfig </span>(or systemctl). It was quite a trip.<br />
<br />
Edit: Apr 10, 2017<br />
The same issue showed up again and this time also the /etc/resolv.conf file was being overwritten. Changing its attributes using<br />
chattr +i /etc/resolv.conf<br />
fixed the issue.</div>
Pavan K. Ghattyhttp://www.blogger.com/profile/11254810960593439120noreply@blogger.com0tag:blogger.com,1999:blog-2086207467763121680.post-7544790547183964212016-04-27T13:40:00.002-07:002016-04-27T13:40:56.325-07:00Drag down a formula to the end of sheet in MS Excel<div dir="ltr" style="text-align: left;" trbidi="on">
After spending a decade in the Linux/Unix environment I am increasingly finding myself using MS tools at work - especially Excel. Before I get around to posting about Macros and Pivot Tables I wanted to document as much mouse-free experience as possible. This post is about mouse-free dragging of a formula across the sheet.<br />
<br />
1. Ctrl+Down will tell you the last row in the sheet.<br />
2. Select cell with the formula<br />
3. In the Name box enter the column alphabet:row start to end (d2:d2000 for example)<br />
4. Hit enter<br />
5. Ctrl+D for (drag till end)<br />
<br />
<img alt="fillhandle01" src="http://blog.contextures.com/wp-content/uploads/2011/08/fillhandle01.png" /><br />
[Source: http://blog.contextures.com/archives/2011/08/31/quickly-copy-excel-formula-down/]<br />
<br />
<img alt="fillhandle02" src="http://blog.contextures.com/wp-content/uploads/2011/08/fillhandle02.png" /><br />
<br />
<br /></div>
Pavan K. Ghattyhttp://www.blogger.com/profile/11254810960593439120noreply@blogger.com0tag:blogger.com,1999:blog-2086207467763121680.post-30903300797276628222015-08-07T18:59:00.000-07:002015-08-07T19:05:42.175-07:00Installing Android on HP TouchPad<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
<span style="letter-spacing: 0px;">I successfully installed CyanogenMod Android on my old HP Touchpad recently and the relevant notes are below. Delighted to have a fully functioning tablet after watching it collect dust for years.</span></div>
<div style="min-height: 19px; text-align: left;">
<span style="letter-spacing: 0.0px;"></span><br /></div>
<div style="text-align: left;">
<span style="letter-spacing: 0.0px;">- Install Novocom first. This is needed for the next step.</span></div>
<div style="text-align: left;">
<span style="letter-spacing: 0.0px;">- Install Touchpad Toolkit by JC Sullins. The relevant file is</span></div>
<div style="text-align: left;">
<span style="letter-spacing: 0.0px;"> <b>TPToolbox-2015-01-08-v42.zip</b> which contains files for Windows, Mac and Linux.</span></div>
<div style="text-align: left;">
<span style="letter-spacing: 0.0px;">tptb_v42_mac.command/tptb_v42_nix.sh/tptb_v42_win.bat/TPToolbox-2015-01-08-v42.bin</span></div>
<div style="text-align: left;">
<span style="letter-spacing: 0.0px;">I used tptb_v42_mac.command on my Mac to facilitate the installation.</span></div>
<div style="text-align: left;">
<span style="letter-spacing: 0.0px;">- Three critical files are necessary for a working Android OS</span></div>
<div style="text-align: left;">
<span style="letter-spacing: 0.0px;"> - ROM, gApps and Recovery.</span></div>
<div style="text-align: left;">
<span style="letter-spacing: 0.0px;">- ROM is the actual Android operating system. There seem to be hundreds of streams of ROMs each of which has nightly builds and regular version releases. LolliPop, KitKat, CyanogenMod etc.</span></div>
<div style="text-align: left;">
<span style="letter-spacing: 0.0px;">- Since Android is (for some reason) tied to Google, gApps (Google Apps) is needed. Again there are gApps from various developers. There is no guarantee that a particular version of gApps will work smoothly or otherwise with any random version of ROM.</span></div>
<div style="text-align: left;">
<span style="letter-spacing: 0.0px;">- Recovery, to me, sounds like swap space. Again hundreds of varieties exist. No guarantees on compatibilities with gApps versions or ROM versions.</span></div>
<div style="text-align: left;">
<span style="letter-spacing: 0.0px;">- So while you have 3 buckets with red, green and blue balls, you cannot pull out a random ball (each different size) and expect them to just work.</span></div>
<div style="min-height: 19px; text-align: left;">
<span style="letter-spacing: 0.0px;"></span><br /></div>
<div style="text-align: left;">
<span style="letter-spacing: 0.0px;">Below are the results of 4 attempts the last of which is fully functional. The notes explain what was lacking in the unsuccessful installs.</span></div>
<div style="min-height: 19px; text-align: left;">
<span style="letter-spacing: 0.0px;"></span><br /></div>
<div style="text-align: left;">
<span style="color: #0b5394; letter-spacing: 0px;">Working: battery</span></div>
<div style="text-align: left;">
<span style="color: #0b5394; letter-spacing: 0.0px;">Not working: No camera and buggy wifi (restarting wifi results in reboot):</span></div>
<div style="text-align: left;">
<span style="color: #0b5394; letter-spacing: 0.0px;">-------------------------</span></div>
<div style="text-align: left;">
<span style="color: #0b5394; letter-spacing: 0.0px;">gapps-lp-20150222-signed.zip</span></div>
<div style="text-align: left;">
<span style="color: #0b5394; letter-spacing: 0.0px;">pac_tenderloin_LP.Beta-1.Unofficial_20150419-075314.zip</span></div>
<div style="text-align: left;">
<span style="color: #0b5394; letter-spacing: 0px;">update-PhilZ_CWM-jcs-dm-tenderloin-20140612.zip</span></div>
<div style="min-height: 19px; text-align: left;">
<span style="letter-spacing: 0.0px;"></span><br /></div>
<div style="text-align: left;">
<span style="letter-spacing: 0.0px;">Working: camera works and wifi is clean</span></div>
<div style="text-align: left;">
<span style="letter-spacing: 0.0px;">Not working: Battery does not charge (System says: Not charging AC)</span></div>
<div style="text-align: left;">
<span style="letter-spacing: 0.0px;">------------------------</span></div>
<div style="text-align: left;">
<span style="letter-spacing: 0.0px;">ev_tenderloin-5.1.1-testing-2015.05.13.zip</span></div>
<div style="text-align: left;">
<span style="letter-spacing: 0.0px;">tk_gapps-modular-nano-5.1.1-20150613-signed.zip</span></div>
<div style="text-align: left;">
<span style="letter-spacing: 0.0px;">update-PhilZ_CWM-jcs-dm-tenderloin-20140612.zip</span></div>
<div style="min-height: 19px; text-align: left;">
<span style="letter-spacing: 0.0px;"></span><br /></div>
<div style="text-align: left;">
<span style="color: #0b5394; letter-spacing: 0px;">Working: battery and wifi (not buggy)</span></div>
<div style="text-align: left;">
<span style="color: #0b5394; letter-spacing: 0.0px;">Not working: No camera and random reboots.</span></div>
<div style="text-align: left;">
<span style="color: #0b5394; letter-spacing: 0.0px;">------------------------</span></div>
<div style="text-align: left;">
<span style="color: #0b5394; letter-spacing: 0.0px;">Slim_mini_gapps.BETA.5.1.build.0.x-20150612.zip</span></div>
<div style="text-align: left;">
<span style="color: #0b5394; letter-spacing: 0.0px;">pac_tenderloin_LP-MR1.Beta-1.Unofficial_20150516-161123.zip</span></div>
<div style="text-align: left;">
<span style="color: #0b5394; letter-spacing: 0px;">update-CWM-jcs-dm-tenderloin-20141231-2.zip</span></div>
<div style="min-height: 19px; text-align: left;">
<span style="letter-spacing: 0.0px;"></span><br /></div>
<div style="text-align: left;">
<span style="letter-spacing: 0.0px;"><i>Fully functional - from June 12, 2015 version from JCSullins</i></span></div>
<div style="text-align: left;">
<span style="letter-spacing: 0.0px;"><i>------------------------</i></span></div>
<div style="text-align: left;">
<span style="letter-spacing: 0.0px;"><i>cm-11-20150612-SNAPSHOT-jcsullins-tenderloin.zip</i></span></div>
<div style="text-align: left;">
<span style="letter-spacing: 0.0px;"><i>gapps-kk-20140606-signed.zip</i></span></div>
<div style="text-align: left;">
<span style="letter-spacing: 0.0px;"><i>update-PhilZ_CWM-jcs-dm-tenderloin-20140612.zip</i></span></div>
<div style="min-height: 19px; text-align: left;">
<span style="letter-spacing: 0.0px;"></span><br /></div>
<div style="text-align: left;">
<span style="letter-spacing: 0.0px;">Various resources helped me in the process and below is a list of some of those links:</span></div>
<div style="text-align: left;">
<span style="letter-spacing: 0.0px;">1. http://liliputing.com/2014/06/use-touchpad-toolbox-install-android-erase-webos-hp-touchpad.html</span></div>
<div style="text-align: left;">
<span style="letter-spacing: 0.0px;">2. https://www.youtube.com/watch?v=bIc18AcuoW4</span></div>
<div style="text-align: left;">
<span style="letter-spacing: 0.0px;">3. http://rootzwiki.com/topic/31548-rom-guide-how-to-install-android-23-43-on-the-hp-touchpad-the-easy-way/</span></div>
<div style="min-height: 19px; text-align: left;">
<span style="letter-spacing: 0.0px;"></span><br /></div>
<div style="text-align: left;">
</div>
<div style="text-align: left;">
<span style="letter-spacing: 0px;">Enjoy!</span></div>
</div>
Pavan K. Ghattyhttp://www.blogger.com/profile/11254810960593439120noreply@blogger.com1tag:blogger.com,1999:blog-2086207467763121680.post-2708244517705590172014-09-22T09:01:00.000-07:002014-09-22T09:01:19.319-07:00Replacing new line with something else using /sed/<div dir="ltr" style="text-align: left;" trbidi="on">
sed ':a;N;$!ba;s/\n/ /g'<br />
<br />
From here http://stackoverflow.com/questions/1251999/sed-how-can-i-replace-a-newline-n</div>
Pavan K. Ghattyhttp://www.blogger.com/profile/11254810960593439120noreply@blogger.com0tag:blogger.com,1999:blog-2086207467763121680.post-83704243357964480532014-06-08T05:52:00.000-07:002014-06-08T05:52:03.905-07:00Uncurated notes on Gromacs GPU installation<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">This file is in /scratch [flute]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">GPU installation on Spear was successful with this cmake</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">cmake .. -DGMX_GPU=ON -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda -DGMX_BUILD_OWN_FFTW=ON</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">[Performance]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">12102 atoms CG</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Using 2 MPI threads</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Using 6 OpenMP threads per tMPI thread</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Detecting CPU-specific acceleration.</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Present hardware specification:</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Vendor: AuthenticAMD</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Brand: AMD Opteron(tm) Processor 4184</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Family: 16 Model: 8 Stepping: 1</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Features: apic clfsh cmov cx8 cx16 htt lahf_lm misalignsse mmx msr nonstop_tsc pdpe1gb popcnt pse rdtscp sse2 sse3 sse4a</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Acceleration most likely to fit this hardware: SSE2</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Acceleration selected at GROMACS compile time: SSE2</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">2 GPUs detected:</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> #0: NVIDIA Tesla M2050, compute cap.: 2.0, ECC: yes, stat: compatible</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> #1: NVIDIA Tesla M2050, compute cap.: 2.0, ECC: yes, stat: compatible</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">2 GPUs auto-selected for this run.</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Mapping of GPUs to the 2 PP ranks in this node: #0, #1</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Cut-off's: NS: 1.441 Coulomb: 1.2 LJ: 1.2</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> Core t (s) Wall t (s) (%)</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> Time: 48384.100 4035.993 1198.8</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> 1h07:15</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> (ns/day) (hour/ns)</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Performance: 2140.737 0.011<span class="Apple-tab-span" style="white-space: pre;"> </span><----------- font=""></-----------></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Finished mdrun on node 0 Thu Mar 20 18:40:36 2014</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">------------ [CPU Edison install] ----------------</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">git clone git://git.gromacs.org/gromacs.git</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">module purge</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">module load intel</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">module load cmake</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">module load openmpi-ccm</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">module load fftw</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mkdir 1049pm-mar24-build</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">export CCDIR=/opt/intel/composer_xe_2013_sp1.0.080/bin/intel64/</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">export MPICCDIR=/usr/common/usg/openmpi-ccm/1.6.5/intel/bin/</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">export FFTW_LOCATION=/opt/fftw/3.3.0.4/sandybridge/</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">export CXX=mpicxx</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">export CC=mpicc</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mkdir ~/gromacs/1049pm-mar24-build/</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">cmake ../ -DFFTW3F_INCLUDE_DIR=$FFTW_LOCATION/include -DFFTW3F_LIBRARIES=$FFTW_LOCATION/lib/libfftw3f.a -DCMAKE_INSTALL_PREFIX=/global/homes/p/pavang/gromacs/1049pm-mar24-build/ -DGMX_X11=OFF -DCMAKE_CXX_COMPILER=${MPICCDIR}/mpicxx -DCMAKE_C_COMPILER=${MPICCDIR}/mpicc -DGMX_MPI=ON -DGMX_PREFER_STATIC_LIBS=ON -DFFTWF_LIBRARY=$FFTW_LOCATION/lib/libfftw3f.a -DFFTWF_INCLUDE_DIR=$FFTW_LOCATION/include</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">make</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">make install</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">source /global/homes/p/pavang/gromacs/1049pm-mar24-build/bin/GMXRC.bash </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mdrun_mpi -v -deffnm em</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">[Performance]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">38315 atoms Lysozyme in water</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">On 1 MPI rank, each using 32 OpenMP threads</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> Core t (s) Wall t (s) (%)</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> Time: 7596.371 252.435 3009.2</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> (ns/day) (hour/ns)</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Performance: 11.802 2.034<span class="Apple-tab-span" style="white-space: pre;"> </span><-------------- font=""></--------------></span><br />
<br /></div>
Pavan K. Ghattyhttp://www.blogger.com/profile/11254810960593439120noreply@blogger.com0tag:blogger.com,1999:blog-2086207467763121680.post-67217759000968475652014-03-28T12:48:00.000-07:002014-03-28T12:48:17.526-07:00Crystal Symmetry Operations<div dir="ltr" style="text-align: left;" trbidi="on">
Pymol has a neat command to generate neighbor copies of proteins downloaded from PDB using their unit cell parameters.<br />
<span style="font-family: Courier New, Courier, monospace;"> symexp sym = 401D, all, 3 </span><br />
<br />
http://chemistry.osu.edu/~foster.281/biochem766/download/PDB/xray_tut_766.html</div>
Pavan K. Ghattyhttp://www.blogger.com/profile/11254810960593439120noreply@blogger.com0tag:blogger.com,1999:blog-2086207467763121680.post-78701758946340206242014-03-01T18:44:00.001-08:002014-03-01T18:44:33.864-08:00Handling topologies of non-standard molecules in Gromacs<div dir="ltr" style="text-align: left;" trbidi="on">
I have a file containing a protein chain and a non-standard ligand in a file [<span style="font-family: Courier New, Courier, monospace;">centered.pdb</span>]. To obtain <span style="font-family: Courier New, Courier, monospace;">.top</span> file<br />
create a directory in the workspace and call it <span style="font-family: Courier New, Courier, monospace;">forcefield.ff</span>.<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">export GMXLIB=$GMXLIB:$PWD/</span><br />
<br />
The contents of that directory are:<br />
<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">ls -1 forcefield.ff/</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">aminoacids.c.tdb</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">aminoacids.hdb</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">aminoacids.n.tdb</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">aminoacids.r2b</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">aminoacids.rtp</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">aminoacids.vsd</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">atomtypes.atp</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">b12rtp</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">elements.dat</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">ffbonded.itp</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">ff_dum.itp</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">ffG53a6.itp</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">ffnonbonded.itp</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">forcefield.doc</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">forcefield.itp</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">gromos53a6.ff</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">ions.itp</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">old</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">org-aminoacidsrtp</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">spce.itp</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">spc.itp</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">tip3p.itp</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">tip4p.itp</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">watermodels.dat</span><br />
<br />
The file <span style="font-family: Courier New, Courier, monospace;">aminoacids.itp</span> has these lines added at the end:<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">[ Ligand ]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">[ atoms ]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">C27 C 0.38000 0 ; from GLN residue</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">O28 O -0.38000 0 ; from GLN residue</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">N29 NT -0.83000 0 ; from GLN residue</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">..</span><br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">[ bonds ]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">; ai aj gromos type</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">C26 C27 gb_27 ; from GLN fragment 0</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">C27 O28 gb_5 ; from GLN</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">C27 N29 gb_9 ; from GLN</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">...</span><br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">[ dihedrals ]</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">; ai aj ak al gromos type</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">C3R O2 P O3 gd_20 ; from ADE phosphate definition</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">C3R O2 P O3 gd_27 ; from ADE phosphate definition</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">C2P O3 P O2 gd_20 ; from ADE phosphate definition...</span><br />
<br />
<br />
<br />
<br />
<br />
<div style="text-align: center;">
Then...</div>
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> pdb2gmx_sp -f centered.pdb -o centered.pg.gro</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">...</span><br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Select the Force Field:</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">From current directory:</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> 1: GROMOS96 53a6 force field (JCC 2004 vol 25 pag 1656)</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">From '/usr/common/usg/gromacs/4.6.1-sp/share/gromacs/top':</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> 2: AMBER03 protein, nucleic AMBER94 (Duan et al.,.. 24, 1999-2012, 2003)</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> 3: AMBER94 force field (Cornell et al., JACS 117, 5179-5197, 1995)</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">...</span><br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">16: [DEPRECATED] Encad all-atom force field, using full solvent charges</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">17: [DEPRECATED] Encad all-atom force field, using scaled-down vacuum charges</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">18: [DEPRECATED] Gromacs force field (see manual)</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">19: [DEPRECATED] Gromacs force field with hydrogens for NMR</span><br />
<br />
Select 1 which is the forcefield contained in the directory <span style="font-family: Courier New, Courier, monospace; font-size: x-small;">forcefield.ff</span>. This should run w/o errors and give a <span style="font-family: Courier New, Courier, monospace; font-size: x-small;">topol.top</span> file. W/o editing<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> topol.top</span> running this code will give the following error;<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">grompp_sp -f min.mdp -c centered.pg.gro -p topol.top -o em.tpr</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">...</span><br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">-------------------------------------------------------</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Program grompp_sp, VERSION 4.6.1</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Source code file: /global/homes/j/jdeslip/Builds/Hopper/gromacs-4.6.1/src/kernel/topio.c, line: 734</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Fatal error:</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Syntax error - File ffnonbonded.itp, line 1</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Last line read:</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">'[ atomtypes ]'</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Invalid order for directive atomtypes</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">For more information and tips for troubleshooting, please check the GROMACS</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">website at http://www.gromacs.org/Documentation/Errors</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">-------------------------------------------------------</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<div>
So, hide the first line and add the default <span style="font-family: Courier New, Courier, monospace;">gromos53a6.ff</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">;#include "./forcefield.ff/forcefield.itp"</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">#include "gromos53a6.ff/forcefield.itp"</span></div>
</div>
<div>
<br /></div>
<div>
That should let <span style="font-family: Courier New, Courier, monospace;">grompp</span> run smoothly.</div>
<br />
<br />
</div>
Pavan K. Ghattyhttp://www.blogger.com/profile/11254810960593439120noreply@blogger.com2tag:blogger.com,1999:blog-2086207467763121680.post-37216338066920533502014-02-09T08:09:00.002-08:002014-02-09T08:09:24.788-08:00Remove white background in multiple images<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: inherit;">convert file-with-white-bg.png -transparent white file-with-transparent-bg.png</span></div>
Pavan K. Ghattyhttp://www.blogger.com/profile/11254810960593439120noreply@blogger.com0tag:blogger.com,1999:blog-2086207467763121680.post-55041975743131105602014-02-01T04:58:00.003-08:002014-02-01T04:58:39.334-08:00Ubuntu apt-get 'package has no installation candidate' error<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
<span style="font-size: small;">I was trying to install a package using apt-get and realized that apt-get wouldn't install that or any other package. I found various suggestions to fix this problem:</span></div>
<div style="text-align: left;">
<span style="font-size: small;"><br /></span></div>
<div style="text-align: left;">
<span style="font-size: small;">Problem</span></div>
<div style="text-align: left;">
<span style="font-size: small;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: small;">$ sudo apt-get install scons<br />Reading package lists... Done<br />Building dependency tree <br />Reading state information... Done<br />Package scons is not available, but is referred to by another package.<br />This may mean that the package is missing, has been obsoleted, or<br />is only available from another source<br /><br />E: Package 'scons' has no installation candidate</span></span></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<span style="font-size: small;">Solution:</span></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<span style="font-size: small;"><span style="font-family: "Courier New",Courier,monospace;">$ sudo apt-get update</span></span></div>
<div style="text-align: left;">
<span style="font-size: small;"><span style="font-family: "Courier New",Courier,monospace;">$ sudo apt-get install build-essential</span></span></div>
<div style="text-align: left;">
<span style="font-size: small;"><span style="font-family: "Courier New",Courier,monospace;">$ sudo dpkg --configure -a</span></span></div>
<div style="text-align: left;">
<span style="font-size: small;"><span style="font-family: "Courier New",Courier,monospace;">$ sudo apt-get -f install</span></span></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<span style="font-family: inherit;"><span style="font-size: small;">None of those worked in my case. I then went to Ubuntu Software Center>Edit> Software Sources and made these changes.</span></span></div>
<div style="text-align: left;">
<span style="font-size: small;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-size: small;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgohASB84naP7viWA2tMTjKUbhOmNfQk0tQRDx3GHSRpFXZDhMANgwz_kS6zCZF_Qbz4gVNWc_Jee67rhVth2rHxEsGpfv4f2GhfJEBBV_2ynw_a6XDJtcnoMyIzvH3eEkazKr0oiqMmhJd/s1600/Selection_068.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgohASB84naP7viWA2tMTjKUbhOmNfQk0tQRDx3GHSRpFXZDhMANgwz_kS6zCZF_Qbz4gVNWc_Jee67rhVth2rHxEsGpfv4f2GhfJEBBV_2ynw_a6XDJtcnoMyIzvH3eEkazKr0oiqMmhJd/s1600/Selection_068.png" height="254" width="320" /></a></span></div>
<div style="text-align: left;">
<span style="font-size: small;"><br /></span></div>
<div style="text-align: left;">
<span style="font-size: small;">After that the following commands did the job </span></div>
<div style="text-align: left;">
<span style="font-size: small;"><span style="font-family: "Courier New",Courier,monospace;">$ sudo apt-get update</span></span></div>
<div style="text-align: left;">
<span style="font-size: small;"><span style="font-family: "Courier New",Courier,monospace;">$ sudo apt-get install build-essential</span></span></div>
<div style="text-align: left;">
<span style="font-size: small;"><span style="font-family: "Courier New",Courier,monospace;">$ sudo apt-get install scons </span></span></div>
</div>
Pavan K. Ghattyhttp://www.blogger.com/profile/11254810960593439120noreply@blogger.com15tag:blogger.com,1999:blog-2086207467763121680.post-61991832712128552392014-01-25T03:43:00.002-08:002014-01-25T03:43:48.586-08:00Changing desktop background and display themes<div dir="ltr" style="text-align: left;" trbidi="on">
Accomplishing that is trivial in any OS but it is a good idea to do it once in a while to break the monotony and keep things fresh. </div>
Pavan K. Ghattyhttp://www.blogger.com/profile/11254810960593439120noreply@blogger.com0tag:blogger.com,1999:blog-2086207467763121680.post-53274464324065960762014-01-21T12:00:00.000-08:002014-01-30T20:03:50.097-08:00Calculating Rg using VMD<div dir="ltr" style="text-align: left;" trbidi="on">
I am working on a system with 60 copies of a molecule which has 1287 atoms in it. The script below loads the trajectory and calculates the radius of gyration of each copy.<br />
<br />
<verbatim>
<span style="font-family: Courier New, Courier, monospace;">
mol new system.gro<br />
<br />
for {set num 0} {$num < 201} {incr num} {<br />
mol addfile cen_md_$num.xtc waitfor all<br />
}<br />
<br />
for {set i 1} {$i <61} {incr i} { <br />
set start [expr 1 + 1287 * ($i-1) ]<br />
set end [expr 1287 * $i]<br />
puts "$start $end"<br />
set sel [atomselect top "serial $start to $end"]<br />
set filename [open "rg-dextran-number-$i.txt" w]<br />
puts "Number of frames is [molinfo top get numframes]";<br />
for {set frame 0} {$frame < [molinfo top get numframes]} {incr frame} {<br />
animate goto $frame<br />
$sel update<br />
puts $filename [format "%8.3f" [measure rgyr $sel]]<br />
}<br />
close $filename<br />
}<br />
<br />
quit<br />
<br />
</span>
<!--61--></61></verbatim></div>
Pavan K. Ghattyhttp://www.blogger.com/profile/11254810960593439120noreply@blogger.com0tag:blogger.com,1999:blog-2086207467763121680.post-24400343422635660082014-01-21T07:49:00.001-08:002014-01-21T07:53:39.221-08:00Weighted Histogram Analysis Method - WHAM<div dir="ltr" style="text-align: left;" trbidi="on">
WHAM is used extensively to calculate the free energy of a system along a properly chosen reaction coordinate in molecular dynamics simulations or monte carlo simulations. To be able to use WHAM you need to perform multiple simulations that cover the entire reaction coordinate to sample possible configurations. The choice of reaction coordinate constitutes a length discussion and is a topic of ongoing debate. So I encourage the reader to look it up elsewhere. After you have chosen a reaction coordinate and performed Umbrella Sampling or Free Energy Perturbation calculations, histograms corresponding to every window need to be extracted.<br />
<br />
For the simple case of dragging a methane molecule from water into a lipid bilayer and out into water again, z axis is a good reaction coordinate if the lipid bilayer is on the x-y plane. With this set up, the z axis is split into discrete windows and the center of mass (COM) of the methane molecule is constrained (usually harmonic) to the center of every window. The length of windows and force constant of the constraint are chose such that the distribution of the z coordinate of the COM of methane overlaps with the distribution of the adjacent windows. This is a necessary prerequisite for using WHAM. Following the figure below, for a 60A long reaction coordinate a choice of 121 windows (each 0.5A and including both ends) will be plenty to ensure overlap of z coordinate distributions.<br />
<br />
Collect z coordinate distributions and put them 121 files labeled window-001 to window-121.<br />
Create a new file <span style="font-family: Courier New, Courier, monospace;">input.in</span> that contains the following lines;<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">./window-001 -30.0 xx</span><br />
<span style="font-family: Courier New, Courier, monospace;">./window-002 -29.5 xx</span><br />
<span style="font-family: Courier New, Courier, monospace;">...</span><br />
<span style="font-family: Courier New, Courier, monospace;">./window-120 +29.5 xx</span><br />
<span style="font-family: Courier New, Courier, monospace;">./window-121 +30.0 xx</span><br />
<br />
Here the first column is the file name, second is the mean value of that window and the third column needs to be filled with an integer but is irrelevant and not used by Alan Grossfield's implmentation of WHAM. Then run the following command<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">./wham 1 11 10 0.001 300 0 input.in freefile</span><br />
<br />
where the inputs are<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">./wham hist.min hist.max num.bins tol Temp numpad<histogram .min=""> <histogram .max=""><num_bins><tolerance><temp><numpad>infile outfile</numpad></temp></tolerance></num_bins></histogram></histogram></span><br />
<br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYIAjyYV7_XOmv-_ppw9kf8VDMoDMpg0lzybCDvoZTIz7F2m5ZcadguiOnmOPRGFQnbTZYX6jmt605HCDMs6WVgajD9y-APJozURlXB_K_na6IDkDhVzWXpNHIXmAR0_aXb7RiLx3c0pmg/s1600/Selection_009.png" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYIAjyYV7_XOmv-_ppw9kf8VDMoDMpg0lzybCDvoZTIz7F2m5ZcadguiOnmOPRGFQnbTZYX6jmt605HCDMs6WVgajD9y-APJozURlXB_K_na6IDkDhVzWXpNHIXmAR0_aXb7RiLx3c0pmg/s1600/Selection_009.png" height="400" width="312" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: x-small;">Figure Source: <a href="http://www.utdallas.edu/~son051000/comp/FreeE.pdf" style="text-align: left;">http://www.utdallas.edu/~son051000/comp/FreeE.pdf</a></span></td></tr>
</tbody></table>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
The output contains a plot for the potential of mean force (PMF). Pay particular attention to units since they depend on your input. WHAM's documentation can be found here [http://membrane.urmc.rochester.edu/sites/default/files/wham/doc.html].<br />
<br /></div>
Pavan K. Ghattyhttp://www.blogger.com/profile/11254810960593439120noreply@blogger.com0tag:blogger.com,1999:blog-2086207467763121680.post-78065260458093695262014-01-16T17:35:00.002-08:002014-01-17T15:25:51.094-08:00Ubuntu grub rescue<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: inherit;">Following are my notes while I successfully recovered Ubuntu 12.04-LTS from grub recovery mode.</span><br />
<span style="font-family: inherit;"><br /></span>
<br />
<div>
<span style="font-family: inherit;">I am using a Macbook Pro and trying to create a Ubuntu Live USB.</span></div>
<div style="min-height: 19px;">
<span style="font-family: inherit;"><br /></span></div>
<div>
<span style="font-family: inherit;">Create a Live USB using </span><span style="font-family: inherit;">instructions from here.</span></div>
<div>
<span style="font-family: inherit;">http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-mac-osx</span></div>
<div style="min-height: 19px;">
<span style="font-family: inherit;"><br /></span></div>
<div>
<span style="font-family: inherit;">This tells you how to work through grub rescue.</span></div>
<div>
<span style="font-family: inherit;">http://askubuntu.com/questions/197833/recovering-from-grub-rescue-crash</span></div>
<div style="min-height: 19px;">
<span style="font-family: inherit;"><br /></span></div>
<div>
<span style="font-family: inherit;">This video offers additional help</span></div>
<div>
<span style="font-family: inherit;">http://www.youtube.com/watch?v=8lod8sRb_6I</span></div>
<div>
<br />
On a side note, if you ever accidentally delete /boot directory simply type the line below - just like this <a href="http://ubuntuforums.org/showthread.php?t=2056406" target="_blank">guy</a>. Of course you need the find the appropriate linux-image-x.x.xx-xx-server and you do need to catch this blunder <i>before </i>rebooting.<br />
<br />
<pre class="bbcode_code" style="height: 36px;">sudo apt-get install --reinstall linux-image-2.6.32-42-server</pre>
</div>
</div>
Pavan K. Ghattyhttp://www.blogger.com/profile/11254810960593439120noreply@blogger.com0tag:blogger.com,1999:blog-2086207467763121680.post-38755524016641610962014-01-16T05:57:00.000-08:002014-01-16T05:57:35.961-08:00Sorting by columns in R<div dir="ltr" style="text-align: left;" trbidi="on">
Sorting columns in R is a breeze. If <i>d</i> is a matrix with 2 columns and you want to sort <i>d</i> by column 1, use the command <span style="font-family: Courier New, Courier, monospace;">order</span> as below.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLOF6mZZukxYbfMUD_SRZOhNaPJKuznkN0BWLS9rY_tl6LGi9XA_mn0vJn3NAGeK1kAG9FXPr7t0IlakC1CD1-BH3NV-JgqA_38UuWdhZ_PqfVn18RAgch0XcrD2EFh0NVPn4aa4UPaXKR/s1600/Selection_008.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLOF6mZZukxYbfMUD_SRZOhNaPJKuznkN0BWLS9rY_tl6LGi9XA_mn0vJn3NAGeK1kAG9FXPr7t0IlakC1CD1-BH3NV-JgqA_38UuWdhZ_PqfVn18RAgch0XcrD2EFh0NVPn4aa4UPaXKR/s1600/Selection_008.png" /></a></div>
<br /></div>
Pavan K. Ghattyhttp://www.blogger.com/profile/11254810960593439120noreply@blogger.com0tag:blogger.com,1999:blog-2086207467763121680.post-53456817514977734942014-01-02T08:08:00.003-08:002014-01-02T08:20:28.563-08:00DNA simulation set-up with AMBER<div dir="ltr" style="text-align: left;" trbidi="on">
I have been working on the structure and dynamics of single and double stranded DNA for some time now and below is a write up of an easy way to setup the simulations using the AMBER suite of software. Along with primary executables <span style="font-family: Courier New, Courier, monospace;">sander, pmemd, tleap and ptraj</span>, AMBER comes with a number of other useful tools. One such tool is the nucleic acid builder (or <i>nab</i>). To create a 10mer poly-Adenosine poly-Thymidine, put the following text in a file called nuc.nab;<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">molecule m;</span><br />
<span style="font-family: Courier New, Courier, monospace;">m = fd_helix( "abdna", "aaaaaaaaaa", "dna" );</span><br />
<span style="font-family: Courier New, Courier, monospace;">putpdb( "nuc.pdb", m, "-wwpdb");</span><br />
<br />
Then run these in the terminal<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">nab nuc.nab</span><br />
<span style="font-family: Courier New, Courier, monospace;">./a.out</span><br />
<br />
You should get a nuc.pdb file which contains the poly A-T double stranded DNA. Everything so far is available in more detail at http://ambermd.org/tutorials/basic/tutorial1/section2.htm<br />
<br />
To get a single stranded poly-A DNA simply delete the lines corresponding to poly-T. To create stem-loop type configurations commonly found in RNA, do the following. Say you want the ssDNA<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">AAATAGAGCTAGTGAGGATTT</span><br />
<br />
with the first 4 bp [AAAT] paired with the last 4 [TTTA or ATTT if you want to read from above]. For this I simply generate a double stranded DNA like so...<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">AAATAGAGCTAGTGAGGATTT</span><br />
<span style="font-family: Courier New, Courier, monospace;">TTTATCTCGATCACTCCTAAA</span><br />
<br />
Then delete the bases shown in red from the PDB file.<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">AAATAGAGCTAGTGAGG<span style="color: red;">ATTT</span></span><br />
<span style="font-family: Courier New, Courier, monospace;">TTTA<span style="color: red;">TCTCGATCACTCCTAAA</span></span><br />
<span style="font-family: Courier New, Courier, monospace;"><span style="color: red;"><br /></span></span>
<span style="font-family: inherit;">Now you should have</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">AAATAGAGCTAGTGAGG</span><br />
<span style="font-family: Courier New, Courier, monospace;">TTTA</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: inherit;">This is the same as</span><span style="font-family: Courier New, Courier, monospace;"> AAATAGAGCTAGTGAGGATTT </span><span style="font-family: inherit;">but with the ends paired up. For the stem-loop conformation you should be able to use the parameter and topology files generated for the fully stretched single stranded DNA. You will have a long bond between </span><span style="font-family: Courier New, Courier, monospace;">AAATAGAGCTAGTGAGG--and--ATTT. </span><span style="font-family: inherit;">But this can be easily fixed with a quick minimization. </span></div>
Pavan K. Ghattyhttp://www.blogger.com/profile/11254810960593439120noreply@blogger.com0tag:blogger.com,1999:blog-2086207467763121680.post-41394201980888397652013-12-09T12:34:00.002-08:002013-12-09T12:34:36.128-08:00Quick linear fitting with Gnuplot<div dir="ltr" style="text-align: left;" trbidi="on">
From <a href="http://www.cs.hmc.edu/~vrable/gnuplot/using-gnuplot.html" target="_blank">here</a> ...<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoVMRYcervgCZg7G0xia_C96jjH0XI_clQsit3w1PHI0wVNEL56nvL0kuivzFD2nVhJrt_SqmPtZC_n_hkn3FMLUM5rnmYObcHWpI8kaGjUAshcD7cUkIVfl1vLNNBfEFF871n4sfHZZga/s1600/gnufit.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="560" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoVMRYcervgCZg7G0xia_C96jjH0XI_clQsit3w1PHI0wVNEL56nvL0kuivzFD2nVhJrt_SqmPtZC_n_hkn3FMLUM5rnmYObcHWpI8kaGjUAshcD7cUkIVfl1vLNNBfEFF871n4sfHZZga/s640/gnufit.png" width="640" /></a></div>
<br /></div>
Pavan K. Ghattyhttp://www.blogger.com/profile/11254810960593439120noreply@blogger.com0tag:blogger.com,1999:blog-2086207467763121680.post-15780548712279039952013-12-04T07:05:00.004-08:002013-12-04T07:05:59.048-08:00Toggle case of alphabets in /vi/ and console<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Courier New, Courier, monospace;">tr 'a-z' 'A-Z' < contacts.txt</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
Case of letters in the file contacts.txt can be changed from lower to upper using the console command above. In <i>vi</i> the same can be achieved by switching to command mode and typing the tilde key on the letter of choice. For bulk edits visualization mode (Ctrl+v) works well. More information about this can be found at: http://vim.wikia.com/wiki/Switching_case_of_characters</div>
Pavan K. Ghattyhttp://www.blogger.com/profile/11254810960593439120noreply@blogger.com0tag:blogger.com,1999:blog-2086207467763121680.post-83486128333083440172013-11-29T18:41:00.001-08:002013-11-29T18:41:35.696-08:00Installing Octave on MacBook<div dir="ltr" style="text-align: left;" trbidi="on">
Here are the notes I took while successfully installing Octave on MacBook 10.8.4<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_pj6DmfP7UhnQu9km6Jg6mtkbUH0ZgIsZ74hlKiMZwSgP3U90yNz9w1vBBqCQ-DnVfDwJxpOT3oO09igzS4xBJJnjCMOt2ZRpzjYuMme0c7WQm1qyfkGDWUnOaiaiSyJ7E-HSq3KTHD5X/s1600/Screen+Shot+2013-11-29+at+9.39.11+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="428" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_pj6DmfP7UhnQu9km6Jg6mtkbUH0ZgIsZ74hlKiMZwSgP3U90yNz9w1vBBqCQ-DnVfDwJxpOT3oO09igzS4xBJJnjCMOt2ZRpzjYuMme0c7WQm1qyfkGDWUnOaiaiSyJ7E-HSq3KTHD5X/s640/Screen+Shot+2013-11-29+at+9.39.11+PM.png" width="640" /></a></div>
<br /></div>
Pavan K. Ghattyhttp://www.blogger.com/profile/11254810960593439120noreply@blogger.com0tag:blogger.com,1999:blog-2086207467763121680.post-89246748916376660922013-11-11T08:51:00.003-08:002013-11-11T08:51:45.748-08:00Exploring Apple Keynote<div dir="ltr" style="text-align: left;" trbidi="on">
I am trying out Apple's Keynote to see what the fuss is all about. <span style="font-family: Courier New, Courier, monospace;">dashkards.com/keynote</span> is a great site where I found this:<br />
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVzxzApTqFqfpHZfhTAwst-mRX8qe60T5-MssdUqSkf1vemSUvslqj5Q7rQQj7WVrxO-2b8Mr7XO76RLEdFPrCxMgWxGE0EaKWV_9ixVoASw-A7wYxAgIh1BJ4Dc_m-xMPPRMgSSJcPe0C/s1600/Screen+Shot+2013-11-11+at+11.48.57+AM.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVzxzApTqFqfpHZfhTAwst-mRX8qe60T5-MssdUqSkf1vemSUvslqj5Q7rQQj7WVrxO-2b8Mr7XO76RLEdFPrCxMgWxGE0EaKWV_9ixVoASw-A7wYxAgIh1BJ4Dc_m-xMPPRMgSSJcPe0C/s1600/Screen+Shot+2013-11-11+at+11.48.57+AM.png" /></a></div>
<br /></div>
Pavan K. Ghattyhttp://www.blogger.com/profile/11254810960593439120noreply@blogger.com8tag:blogger.com,1999:blog-2086207467763121680.post-6365172235479847582013-11-06T06:15:00.001-08:002013-11-14T07:18:54.666-08:00C style formatting in R<div dir="ltr" style="text-align: left;" trbidi="on">
Numbering/naming files in a controllable format is important when making animations of a series of plots (by using <span style="font-family: Courier New, Courier, monospace;">animate</span><i> </i>for example). When the plots are being generated in R, there is an easy way to control the names of the output files as shown below;<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh67FELzA6V5L41kP417Z8PqLLw2iRqMQP3R_Vwe6tcQesjEhYqZJrQEgVdDFmz280z9f9ccb1U-TuoGSQtcPoHlPt1MyVPhKjvw65SQCiuXYMOy1pb3j-uBt2uZFsYEcpXrlubtKlDBd88/s1600/del1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh67FELzA6V5L41kP417Z8PqLLw2iRqMQP3R_Vwe6tcQesjEhYqZJrQEgVdDFmz280z9f9ccb1U-TuoGSQtcPoHlPt1MyVPhKjvw65SQCiuXYMOy1pb3j-uBt2uZFsYEcpXrlubtKlDBd88/s1600/del1.png" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
The advantage here is that when you feed in files with the same base.name and numbered 000..100 (instead of 0..100), the command <span style="font-family: Courier New, Courier, monospace;">convert</span> automatically reads them in increasing order w/o you relying on time stamps and such. </div>
Pavan K. Ghattyhttp://www.blogger.com/profile/11254810960593439120noreply@blogger.com1tag:blogger.com,1999:blog-2086207467763121680.post-58766783524528724152013-10-30T07:47:00.000-07:002013-11-11T12:17:22.755-08:00Linux terminal colors (Console, ls and vi)<div dir="ltr" style="text-align: left;" trbidi="on">
The lines below when put in my .bashrc file greatly improved the readability - I essentially turn the color scheme off.<br />
<br />
<span style="font-family: Courier New, Courier, monospace;"># Below is from http://mylinuxbook.com/ubuntu-command-line-prompt-colour/</span><br />
<span style="font-family: Courier New, Courier, monospace;">if [ "$color_prompt" = yes ]; then</span><br />
<span style="font-family: Courier New, Courier, monospace;"> PS1='${debian_chroot:+($debian_chroot)}\[\033[0;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '</span><br />
<span style="font-family: Courier New, Courier, monospace;">else</span><br />
<span style="font-family: Courier New, Courier, monospace;"> PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '</span><br />
<span style="font-family: Courier New, Courier, monospace;">fi</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">alias ls='ls --color=none'</span><br />
<br />
Further these lines in .vimrc file were of great help.<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">syntax on</span><br />
<span style="font-family: Courier New, Courier, monospace;">colorscheme desert</span></div>
Pavan K. Ghattyhttp://www.blogger.com/profile/11254810960593439120noreply@blogger.com0tag:blogger.com,1999:blog-2086207467763121680.post-46392913973171457682013-10-22T08:06:00.002-07:002013-10-22T08:06:23.027-07:00ImageMagick's display<div dir="ltr" style="text-align: left;" trbidi="on">
On Linux terminal the command /display/ simply displays a figure w/o any resizing. This can get cumbersome when dealing with large images. However, a simple resize option simplifies life:<br />
<br />
display -resize 1080x\> figure.png<br />
<br />
where the width is being resized to 1080 pixels while the height is automatically assigned. This <a href="http://www.imagemagick.org/Usage/basics/#display" target="_blank">link</a> suggests using this approach only for downsizing images. </div>
Pavan K. Ghattyhttp://www.blogger.com/profile/11254810960593439120noreply@blogger.com0tag:blogger.com,1999:blog-2086207467763121680.post-32983065535733379012013-10-19T09:04:00.000-07:002013-10-19T09:04:16.770-07:00Interesting thoughts...<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiR8REoyXehY2ocV8tMjMZuhOWlde-c6FirrXryzBHCzuuMId7bl5IvvA0kLeFgT661aGKGig2NqOJ5YxaE_keMlX9Jjv4Z9pCHAkguOsphnLygQI3dSMWmM3-cYqjLrm0q_j1jfqn62Mmk/s1600/Screen+Shot+2013-10-19+at+12.02.31+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="277" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiR8REoyXehY2ocV8tMjMZuhOWlde-c6FirrXryzBHCzuuMId7bl5IvvA0kLeFgT661aGKGig2NqOJ5YxaE_keMlX9Jjv4Z9pCHAkguOsphnLygQI3dSMWmM3-cYqjLrm0q_j1jfqn62Mmk/s400/Screen+Shot+2013-10-19+at+12.02.31+PM.png" width="400" /></a></div>
<br /></div>
Pavan K. Ghattyhttp://www.blogger.com/profile/11254810960593439120noreply@blogger.com0