My software notes

January 22, 2006

Vi, the powerful text editor

Filed under: softwares and scripts — kpwu @ 4:35 am

A good instruction of Vi is posted by vbird’s website (http://linux.vbird.org/linux_basic/0310vi.php), check it!

some useful, daily use tips (copy from above URL):

+ 游標移動到非空白字元的下一列
- 游標移動到非空白字元的上一列
n 那個 n 表示『數字』,例如 20 。按下數字後再按空白鍵,游標會向右移動這一行的 n 個字元。例如 20 則游標會向後面移動 20 個字元距離。
0 這是數字『 0 』:移動到這一行的最前面字元處 (常用)
$ 移動到這一行的最後面字元處(常用)
H 游標移動到這個螢幕的最上方那一行
M 游標移動到這個螢幕的中央那一行
L 游標移動到這個螢幕的最下方那一行
G 移動到這個檔案的最後一行(常用)
nG n 為數字。移動到這個檔案的第 n 行。例如 20G 則會移動到這個檔案的第 20 行(可配合 :set nu)
gg 移動到這個檔案的第一行,相當於 1G 啊! (常用)
n n 為數字。游標向下移動 n 行(常用)
x, X 在一行字當中,x 為向後刪除一個字元 (相當於 [del] 按鍵), X 為向前刪除一個字元(相當於 [backspace] 亦即是倒退鍵) (常用)
nx n 為數字,連續向後刪除 n 個字元。舉例來說,我要連續刪除 10 個字元, 『10x』。
dd 刪除游標所在的那一整列(常用)
ndd n 為數字。刪除游標所在的向下 n 列,例如 20dd 則是刪除 20 列 (常用)
d1G 刪除游標所在到第一行的所有資料
dG 刪除游標所在到最後一行的所有資料
d$ 刪除游標所在處,到該行的最後一個字元
d0 那個是數字的 0 ,刪除游標所在處,到該行的最前面一個字元
yy 複製游標所在的那一行(常用)
nyy n 為數字。複製游標所在的向下 n 列,例如 20yy 則是複製 20 列(常用)
y1G 複製游標所在列到第一列的所有資料
yG 複製游標所在列到最後一列的所有資料
y0 複製游標所在的那個字元到該行行首的所有資料
y$ 複製游標所在的那個字元到該行行尾的所有資料
p, P p 為將已複製的資料在游標下一行貼上,P 則為貼在游標上一行! 舉例來說,我目前游標在第 20 行,且已經複製了 10 行資料。則按下 p 後, 那 10 行資料會貼在原本的 20 行之後,亦即由 21 行開始貼。但如果是按下 P 呢? 那麼原本的第 20 行會被推到變成 30 行。 (常用)
J 將游標所在列與下一列的資料結合成同一列
c 重複刪除多個資料,例如向下刪除 10 行,[ 10cj ]
u 復原前一個動作。(常用)
[Ctrl]+r 重做上一個動作。(常用)
這個 u 與 [Ctrl]+r 是很常用的指令!一個是復原,另一個則是重做一次~ 利用這兩個功能按鍵,您的編輯,嘿嘿!很快樂的啦!
. 不要懷疑!這就是小數點!意思是重複前一個動作的意思。 如果您想要重複刪除、重複貼上等等動作,按下小數點『.』就好了! (常用)

automatically process you NMR FIDs

Filed under: NMRPipe and NMRview — kpwu @ 3:20 am

Descriptions:
Once  you have lots of dynamics experiments, such as T1, T2 , or  diffusion data, you  won’t want to process all FIDs one by one and convert to nmrivew format one by one again.

If you acquire all FIDs in same parameters (ex:TD1,TD2 for Bruker, np, ni for Varian) , then just set the file location “base” and the file name you want those files to be (“name”), and the destination you want to move (“location”).

Make sure your fid.com, ft2.com is executable, and ft2.com has done phase corrections. 

————————————————————————————

#!/bin/sh

#process FIDs in a script, quickly and easily
base=”/disk1/data/kpwu/nmr/T1″   # file location
name=”t1″                                    # file name
location=”/disk1/data/kpwu/nv/T1″  # where you want to collect

i=21                                            # initial number of the FID
while [ "$i" -lt 37 ]                         # last FID number +1 ( ex: 36+1)
do
cp *.com $base/$i
cd $base/$i
./fid.com
./ft2.com
pipe2xyz -in test.ft2 -nv -out $name-$i.nv
mv $name-$i.nv $location
i=`expr $i + 1`
done

make your helices in cylinder view

Filed under: pymol/ molmol — kpwu @ 3:00 am

1djm.png

sample: 1DJM.pdb

scripts:
load 1DJM.pb
show cartoon, 1DJM
set cartoon_cylindrical_helices,1
ray 350,300
png 1djm.png

Blog at WordPress.com.