% cp ~train00/.cshrc.iris ~ % cp ~train00/.alias.all ~ % exit UNIX の基本 シェルシステムとユーザの仲立ちをするプログラムであって ユーザが入力したコマンドを解釈して実行する Unix では文法によって sh 系と csh 系がある sh 系には sh, ash, zsh, bash などがある csh 系には csh, tcsh などがある
コマンドの基本構造 1% command [argument] $ command [argument] 1% や $ はプロンプトといい シェルがユーザにたいしてコマンド入力を受け付ける状態であることを示している 最初に実行しようとしているプログラムの名前 (command) を入力し 空白を入れてから引数 (argument) を入力し改行を入力するとプログラムが実行される プログラムは プログラムに応じて引数を解釈し処理を行う 入力する部分を Courier Bold で書き 場合によってかえる部分は下線を付した Courier であらわしている ファイルのコピー $ cp oldfile newfile ファイルの削除 $ rm file ディレクトリの作成 $ mkdir newdirectory ディレクトリの削除 $ rmdir emptydirectory $ rm -r directory ファイルの移動とファイル名の変更 $ mv file directory $ mv oldfile newfile コマンドの使い方を調べる $ man command ファイルの中身を見る小さいファイルの場合 $ cat file 大きいファイルの場合 $ less file スペースで 1 ページ進む b で 1 ページ戻る q で終了 h で使い方の説明が見られる先頭を見る $ head file 末尾を見る $ tail file
* > file file file >> file file file < file file * command1 command2 command1 command2 command1 command2
% cat > cuc2.uids >Protein ^D (Contro-l D; Control キーをおしながら d を押す ) % getuid_lists cuc2.blast.html >> cuc2.uids getuid_lists プログラムの内容は以下に示すようなものである #!/usr/local/bin/perl while($_!~ /gnificant/){ $_ = <>; } while($_ = <>){ s/^.*list_uids=// && s/&.*// && print $_; exit 0 if /<\/PRE>/; }
% clustalw_mp cuc2.fasta cuc2.aln cuc2.aln
13% tr -d \ < cuc2-cut.nx.phylip seq2mol > cuc2.mol 14% trn2sed cuc2.trn >cuc2.sed 15% sed -f cuc2.sed cuc2.mol > cuc.mol tr -d \ % cat `which trn2sed` #!/usr/local/bin/perl while($_=<>){ last if /TranslateTaxa/}; #skip head eof && die; while($_=<>){ last if /;/; #process each line chop; ($label,$content) = split; $label =~ s/\ //; $nlabel = $label;
} $nlabel =~ s/\./t/g; print s/^,$label, \$/,$nlabel, \t ; #process the content; $content =~ s/gi\ /GI:/g; $content =~ s/\ [^ +]*/ /g; $content =~ s/,//g; $content =~ s/\+/+ /g; $content =~ s/ $//; print $content, /\n ; 16% protml -D cuc.mol > cuc.d 17% njdist cuc.d >cuc.nj 18% protml -R cuc.mol njdist.tpl >cuc.nj.r njdist.tpl
begin paup; log file=nac-p.log replace=yes flushlog=yes start; set maxtrees=500000; set monitor=no; outgroup OsNAC8; hsearch addseq=random nreps=100 rseed=19 randomize=trees; roottrees; savetrees file = nac.nxtrees format = altnex; quit; end;
begin paup; end; log file=nac-p.log replace=yes flushlog=yes start; nac-p.log set maxtrees=500000; set monitor=no; nac-p.log outgroup OsNAC8; hsearch addseq=random nreps=100 rseed=19 randomize=trees; addseq=random nreps=100 rseed=19 randomize=trees; roottrees; savetrees file = nac.nxtrees format = altnex; nac.nxtrees cuc.nx % paup4 cuc.nx & nac-p.log % tail -f nac-p.log #NEXUS Begin trees; [Treefile saved Wed Dec 13 22:55:03 2000] [! >Data file = /net/ep3/home/tomoaki/nac.nx
> Number of trees retained = 45 > Time used = 00:01:55 (CPU time = 00:01:43.1) ] tree PAUP_1 = [&R] (( (((((((((T47425,BAB083371),BAA784171),AAB816681), AAC785261), (AC006580_1, (AAD144931,BAB113861))),(( (((BAB104721,OsNAC5),... AF281062_1), (T04663,AC006424_21)), ((T05084, BAA975301),(AC007767_30, (CAB777251, (T01940,T01942)))))),((T49145,BAB083271),AC006233_9),OsNAC8); tree PAUP_2 = [&R] (((((((((((T47425,BAB083371), BAA784171),AAB816681),AAC785261), (AC006580_1,(AAD144931,BAB113861))),( ((((BAB104721, OsNAC5), ((AC009273_9,... (AC007767_30, (AB777251,(T01940,T01942)))))),((T49145,BAB083271),AC006233_9), OsNAC8); % mkdir R % grep ^tree nac.nxtrees sed -e s/^tree.*] // split -1 -a2 - R/nac. % cd R % sh $ for i in * ; do echo 1 > $i.tpl ; cat $i >> $i.tpl; rm $i; done $ for i in *.tpl; do protml -R../cuc.mol $i >$i.r 2> $i.r.err; mv protml.tpl $i.r.tpl; mv protml.tre $i.r.tre; mv protml.eps $i.r.eps; done $ exit %
% cd.. % grep AIC nac10.r R/*.R sort -k 7 % makesed cuc2.genpept >cuc2.sed % sed -f cuc2.sed protml.eps > cuc.eps
#!/usr/local/bin/perl print #!/usr/bin/sed -f\n ; while( $_ = <>) { if (/^LOCUS/){ ($dummy,$locus) = split; } if (s/^definition//){ chop; s;/;\\/;g; s/\(/[[/g; s/\)/]]/g; $def=$_;} if (/VERSION/) { ($v,$acc,$giname) = split; if(($giname!~ /GI:/) && ($Acc =~ /GI:/)){$giname = $Acc; $Acc= ;}; if($acc!~ /$locus/){ printf s/%s/%s %s, $giname, $locus, $Acc; }else{ printf s/%s/%s, $giname, $Acc; }}; if (s/organism//){chop; $organism = $_; ($genus,$species)=split; $organism =~ s/^\s*//; $def =~ s/$organism//i; $def =~ s/$genus $species//g; $def =~ s/$genus//g; if($organism =~ /Schizosaccharomyces/){ $def =~ s/fission yeast//g; } if($organism =~ /Drosophila/){ $def =~ s/fruit fly//g; } if($organism =~ /Mus/){ $def =~ s/mouse//g; } if($organism =~ /Xenopus/){ $def =~ s/african clawed frog//g; } $def =~ s/\[+\]+//g; $def =~ s/\[*$//; $def =~ s/?\.$//; $def =~ s/?\-$//; $def =~ s/[.,-]*$//; print $organism;print $def; # $_=<>; chop;print $_; # $_=<>;chop; print $_; print /\n ; # print #$genus\n ; }; }
% protml -R cuc.mol rerooted.tpl > cuc.rerooted.r % sed -f cuc2.sed protml.eps > cuc.rerooted.eps