*系統解析論演習1(梶田担当分) [#m3440f54]
*演習1:Cygwinを用いたUnixライク環境の体験 [#ob72433f]
系統解析ソフトウェアのうちMac版PAUP*やMesquiteは大変使いやすいグラフィカルユーザーインターフェースを備えていますが、そうでないものが多くあります。また、ソースコードで配布されるものは、自分の環境に合わせてコンパイルしないと、使用できません。そういうソフトウェアを操作し、自分のコンピュータで使えるようにするには、Unix系のコマンドラインでの操作に慣れておくことが必須です。この講義では、Windows上で走るUnix環境エミュレータであるCygwinを使って、コマンドラインコンピュータの操作を学習します。~
Some softwares for phylogenetic analysis are not equipped with GUI like PAUP* of Macintosh or Mesquite.  Some softwares also to be compilied under the configuration of each terminal.  Here, we try to use Cygwin, an emulater of Unix environment on Windows, to use r8s, PAML, and others.
#contents

**Major evolutionary transitions in ant agriculture [#h0c5f655]
-Ted R. Schultz and Sean G. Brady. 2008~
PNAS. 105(14): 5435-5440.
** 環境の設定:Cygwinとテキストエディタのインストール [#a7d6e9dc]
この演習では、Windowsのグラフィカルインターフェース’(GUI: 簡単に言うと、”マウスでポインタを動かしクリックしてそうさするもの")の下で動作するソフトウェアと、Unix様のコマンドラインインターフェース(CLI: 簡単に言うと、"キーボードから命令を文字で打ち込むもの")の両方を組み合わせて使用できるように、WindowsXPの環境をセットアップします(MacOSXやLinuxのGUIを使っている人は、こんなことをしなくとも、GUIとCLIの両方を簡単に使うことができます)。インストールするのは、以下のソフトウェアです。
+Cygwin: Windows環境で動くUNIXエミュレータ。このソフトウェアをインストールすることで、UNIXのCLIで使われる様々な機能を簡単に体験することができます。
+K2Editor: テキストエディタ。UNIXのCLI環境にもviやemacs等のエディタがありますが、Windows利用者には使いやすいと思われるGUIで動くテキストエディタを使います。
***Cygwinのインストール: Installation of Cygwin[#mef1baf8]
-Cygwinを右のサイトからダウンロード http://cygwin.com/~
Download Cygwin from the URL above.
-デスクトップ上のSetupをクリックしてインストール~
Double click Setup on your desktop.
--c:\cygwinにインストール~
Cygwin will be installed under c:\cygwin
--インストールするパッケージの選択で、Devel(開発環境)とデータベースのいくつかのセットを選択しておく
 Choose following packages under Devel when you see the list of packages
	make
	gcc       #C compiler 一つクリックすると、関連するものがすべて選択される。
	gcc-g77
 Choose sqlite3 under Database packages
        sqlite3
-インストールが終了したら、デスクトップかスタートメニューのCygwinアイコンをクリック。コマンドラインウィンドウが表示されます。~
Click the Cygwin Icon on the desktop to start.
-一度立ち上げることで、c:\cygwinに/home(自分のユーザー名:以下の例ではtkaji)というディレクトリができます。~
In this example, user have a directory named "tkaji" under c:\cygwinに/home. 
-これでUnixライクな環境が構築できました。~
Now you are in a Unix-like environment running in Windows PC.

***K2Editorのインストール [#q9d50096]
-ダウンロードサイトにアクセス → http://k2top.jpn.org/index.php?K2Editor
-ページの中程から、k2e10508.lzh をダウンロードして展開(パソコンにLHAやeoが入っていることが必要)
-デスクトップにK2Editorのフォルダができる
-フォルダの中のK2Editor.exeをクリックして起動してみよう
-※Free ASCII text editor is listed in this page: http://www.thefreecountry.com/programming/editors.shtml
--For English User: jEdit is a good one!: http://jedit.sourceforge.net/index.php?page=download

***Data [#tbd7b358]
-2,459 aligned nucleotide sites from the coding regions of four nuclear genes:
--elongation factor 1- F1 (EF1F1) (1,075 bp)
--elongation factor 1- F2 (EF1F2) (517 bp)
--wingless (409 bp)
--long-wavelength rhodopsin (opsin) (458 bp)
-All data in this study represent protein-coding (exon) sequences~
intervening introns in opsin and EF1F1 were not used because they could not be aligned confidently. 
-Sample: 65 attine taxa and 26 nonattine outgroups.~
Primers used for PCR amplification and sequencing are found in supporting information (SI) Table S1.
-Of the total 2,459 included nucleotide positions from all genes, 952 were variable and 847 parsimony informative. Sequences are deposited in GenBank; taxa and accession numbers are listed in Table S2.
**Unixライク環境の基本操作: [#ld0e9652]
これからCygwinとテキストエディタの他、下でダウンロードする様々なソフトウェアを使ってUnixライク環境を使って系統推定を行います。この授業では、以下の基本操作・知識が必要ですので、必ず慣れておきましょう。なお、Mac OSXユーザの場合、ターミナルを起動するだけでUnixライクの操作を行うことができます。~
To use Unix-like environment, you should understand following basics.
+Cygwinの起動とウィンドウ設定の変更
+コマンドラインインターフェースの使い方
+文字を使っファイルやたディレクトリの表し方とディレクトリの構成
+ディレクトリに関する基本コマンド(命令)
--カレントディレクトリの表示: pwd
--ディレクトリの内容表示: ls
--ディレクトリへの移動: cd 
--ディレクトリ間のファイルコピー: cp ; 移動: mv 別ディレクトリへのファイルの移動・名前の変更
--新しいディレクトリの作成: mkdir
--ファイルの削除: rm
+テキストエディタによるデータファイルの作成と保存と改行コード

***Phylogenetic Analyses [#f15b24f4]
-(i) Maximum parsimony (MP) analyses
--PAUP* v4.0b10
---heuristic searches with tree bisection.reconnection (TBR) and 1,000 random-taxon-addition replicates. ~
Analyses identified 12 most-parsimonious trees (MPTs) of length  4,383, CI  0.270, RI  0.704. Successive-approximations-weighting analyses identified a single tree, one of the MPTs.
---Nonparametric bootstrap analyses used TBR branch-swapping and consisted of 1,000 pseudoreplicates, with 10 random-taxon-addition replicates per pseudoreplicate. 
***Cygwinの起動とウィンドウ設定の変更 [#w05aa4e1]
先ほどインストールしたcygwinのアイコンがデスクトップにあるはずなので、ダブルクリックして立ち上げてみましょう。そうすると、画面に黒いウィンドウが開き、コマンドプロンプト(カーソルがチカチカ点滅しているところ)が表示されます。Unixライクな操作は、ここに文字で命令を打ち込むことで行います。操作を始める前に、このウィンドウについて、次の設定をしておきましょう。
+プロパティの変更: ウィンドウ左上のCを右クリックしてプロパティを選択
--オプションタブをクリック:
---バッファサイズを200ぐらいに
---簡易編集モードをチェック(これで、マウスの右クリックでテキストのコピー・ペーストが可能)
--レイアウトタブをクリック
---画面サイズを好みの大きさに(今回は幅95, 高さ20にしてみた)
--ウィンドウを閉じて終了「このウィンドウを起動したショートカットを変更する
***初めてのコマンドラインインターフェース: Unix-like CLI [#eea7c0a4]
&size(14){※ Non-Japanese students:  [[Visit English Tutorials for Unix/Linux of Marine Biological Laboratory>http://workshop.molecularevolution.org/mbl/resources/computing.php]] .};~

-(ii) Maximum likelihood (ML)
-- ModelTest v3.06~
The data and the MPT identified by weighting were evaluated under the Akaike information criterion (AIC) as calculated in, 
---identifying the GTRI model of evolution. 
--GARLI v0.951 using the GTRI model (with six  rate categories), with a heuristiclosuccessiveapproximationsg likelihood of 24,868.84927. 
---Nonparametric bootstrap analyses consisted of 500 pseudoreplicates in GARLI under the same conditions as the ML search.
---A subsequent  search in PAUP* using the most likely tree identified by the GARLI searches as the starting tree and employing TBR branch-swapping and the GTRI model (with six  rate categories) resulted in exactly the same topology and likelihood score. 
~それでは、コマンドラインインターフェースを使って、コンピュータに命令を与えてみましょう。今、Cygwinの画面には、
 $
という文字が表示され、その右側でカーソルがチカチカしているはずです。ここに
 pwd
と入力してみましょう。そうすると、
 /home/user_name
と表示されたはずです(user_nameの部分は、それぞれWindows設定時に自分が決めたユーザー名.コマンドラインの操作を行う人は、この名前を短くしておく方が、後々の操作が楽になる。名前の変更は、コントロールパネルのユーザーアカウントから行える)。~
この pwd というコマンドは、現在自分が操作しているディレクトリの位置を表示してくれる、便利なコマンドです(どのディレクトリを見ているのかわからなくなったら、すぐに pwd と入力しましょう)。~
Unixライク環境のコマンドラインインターフェースでの多くの操作は、
 ・文字で命令を入力
 ・その命令をコンピュータが実行
 ・結果を出力: 画面に表示したり、ファイルに書き込んだり
という流れで行われます。今の pwd というコマンドでは、
 ・pwd という命令を入力
 ・現在のディレクトリをコンピュータが取得
 ・結果を画面に表示
という流れで進みました。では、ここで、結果の出力先をファイルに変更してみましょう。次のコマンドを入力してみてください。
 pwd > current_d.txt
> という記号は、出力先をファイルにするということを意味しています。~
タイピングが面倒な人は、マウスで選択してコピーし、Cygwinのウィンドウで右クリックすればいいです。
そうすると画面には、特に何も結果は表示されません。ではここで、
 ls
と入力します。これは、ディレクトリの中のファイルやディレクトリを一覧するコマンドです。そうすると、
 current_d.txt
という文字が表示されました。つまり、このディレクトリの中に、current_d.txt というファイルが存在していることを表しています。では、このファイルの中には何が入っているのでしょうか?ここで、lessというコマンドを使います。
 less current_d.txt
そうすると、
 /home/tkaji
という文字が表示されましたね。lessはファイルの中身を表示させる命令です。q を押すと、終了できます。~
以上が、文字入力でコンピュータに命令を与える、Unixライク環境の基本操作です。結果はいつも、画面に表示されるか、ファイルとしてディスクに保存されます。

-(iii) Bayesian nucleotide-model Markov Chain Monte Carlo (MCMC):~
MrBayes v3.1.2 (59). 
--Burn-in and run convergence were assessed by comparing the mean and variance of log likelihoods, both by eye and by using the program
---Tracer v1.3
---MrBayes  e e.stat f f output file
---MrBayes bthe split frequencies diagnostic.
--Eight character partitions for nucleotide-model analyses:
---four partitions consisting of the combined first and second codon positions for each of the four genes
---four partitions consisting of the third codon position for each of the four genes.
---based on ModelTest results~
the wingless third-position - GTR model~
opsin and EF1F2 third positions - separately assigned the HKYI model~
all other character partitions - separately assigned the GTRI model
-(iv) Bayesian codon-model MCMC~
***文字を使っファイルやディレクトリの表し方とディレクトリの構成 [#uf46859b]
では、もう一度 pwd でカレントディレクトリを確認してみましょう。私のコンピュータでは、
 /home/tkaji
#ref(./Untitled1.gif,around,right,60%)
と表示されていますが、これは、コンピュータのハードディスク上のどの位置にあるのでしょうか?スタートメニューから、マイコンピュータを開いてエクスプローラ(知らない人もいると思いますが、Windowsでファイルの一覧を表示させるソフトの名前です)の、ツールバーの「フォルダ」をクリックして、フォルダーをツリー表示させてみましょう。フォルダが次のような階層構造になっているのがわかります。~
//&ref(./Untitled1.gif,60%);~
Unixライクな操作では、それぞれのフォルダのことを「ディレクトリ」と言います。また、それぞれのディレクトリは名前がついていて、pwd コマンドで表示されたように文字で表すことができます。
|cygwin|/|ルート|
| home|/home|ホーム|
|  tkaji|/home/tkaji/|ユーザーホーム|
|   sample1|/home/tkaji/sample1/|(解析用サンプルファイルの置き場所)|
Windowsのハードディスクの中のフォルダの位置と、Cygwinのファイル構成でのディレクトリの対応を理解しておいてください。この授業でよく使うディレクトリは
 /home/tkaji(ユーザーごとに違う名前/
 /home/tkaji/sample1(解析ごとに違う名前)/
 /usr/local/bin/ (実行形式ファイルの置き場所)
の3つです。では、試しに、sample1というフォルダをエクスプローラーを使って作成してみましょう。フォルダツリーでtkaji(ユーザーごとに違う名前)をクリックし、ファイルメニューから「新規作成/フォルダ」を選択して作った新しいフォルダに sample1 という名前をつけてください。~
cygwinで、
 ls /home/tkaji(ユーザーごとに違う名前)
と入力すると、
 sample1  current_d.txt
という名前が表示されるのがわかります。でも、これでは、sample1がファイルなのかディレクトリなのかはわかりません。そこで、
  ls -l /home/tkaji(ユーザーごとに違う名前)
と入力してみましょう。-l はオプションで、表示の形式を変えるものです。ファイルやディレクトリの名前が縦に表示されており、一番左の文字が d になっているものがディレクトリ、それ以外はファイルを表しています。
 -rw-r--r--  1 tkaji なし    12 Jan 20 04:42 current_d.txt
 drwxrwxrwx+ 2 tkaji なし     0 Jan 20 05:21 sample1
今行った操作で大事なことは、
 Cygwinの操作で解析等に使うファイルはWindowsからマウスのクリック操作で作れる
 作ったファイルは、 /home/の下の、自分のディレクトリに入れておく
ということです。後でもう一度説明しますが、Windowsのソフトウェアと、Cygwinを行き来するときに、ディレクトリの場所を意識することがとても大切なので、覚えておいてください。
-おまけ:コマンド入力のやり直し:|
Cygwinでは矢印キーの上矢印(↑)を押すと、前に入力した命令が表示されます。また、左右の矢印キーを使ってカーソルを移動させ、命令の内容を変更することもできます。

**Phylogenetic Mapping of Agricultural Systems. [#s89bfd51]
-Terminal taxa were assigned states for a single six-state character representing the four attine agricultural systems and leaf-cutter agriculture (i.e., no agriculture, lower agriculture, yeast agriculture, higher agriculture, leaf-cutter agriculture, coral-fungus agriculture).
-Five species (Myrmicocrypta n. sp. Brazil, Mycetagroicus triangularis, Cyphomyrmex n. sp., Cyphomyrmex morschi, Trachymyrmex irmgardae, and Pseudoatta n. sp.) received  e eunknown f f (i.e.,  e e? f f) state assignments, and @Trachymyrmex papulatus received a  e elower agriculture f f state assignment based on a single garden collection from Argentina (a second colony from the same locality cultivated a typical higher attine garden). 
-Character evolution was optimized onto the Bayesian codon-model consensus tree (with branch lengths) under both parsimony using MacClade and maximum likelihood using the StochChar module provided in the Mesquite package.
-Under parsimony, ancestral-state optimizations were unambiguous. 
-Under the Markov k-state 1-parameter model,  the likelihood that each agricultural system arose in the most recent common ancestor of the corresponding ant clade was, as a proportion of the total probability ( 1.0) distributed across the six character states, 0.9831 for lower agriculture, 0.9995 for yeast agriculture, 0.9905 for higher agriculture, 0.9924 for leaf-cutter agriculture, and 0.9998 for coral-fungus agriculture.
***ディレクトリに関する基本命令 [#x08d56a6]
それでは、ディレクトリの基本構成が理解できたところで、基本命令(コマンド)のいくつかを試してみましょう。
-カレントディレクトリの表示: ''pwd''~
最初に使ったコマンドです。
-ディレクトリの内容表示:'' ls''~
これも何度か使いました。先ほどまでの操作がうまくできていると、自分のディレクトリでは、
 sample1  current_d.txt
の2つが表示されるはずです。
-ディレクトリへの移動: ''cd ''
これは、自分の今いるディレクトリから、他のディレクトリに移動するものです。つまり、カレントディレクトリを他のディレクトリに変更するコマンドです。たとえば、カレントディレクトリがユーザーホームのときに、を先ほど作成した sample1 というディレクトリに変更するには、
 cd sample1
と入力します。もし、どこか別のディレクトリにいて、すぐに /home/tkaji/sample1に移動したいのなら、
  cd /home/tkaji(ユーザーごとに違う名前)/sample1
と入力します。この
 /home/tkaji/sample1
という表し方をフルパスと言います。左から順に、
 /          ルートディレクトリ
  home      ルートディレクトリの中のhomeというディレクトリ
   tkaji    ルートディレクトリの中のhomeというディレクトリの中のtkajiというディレクトリ
    sample1 ルートディレクトリの中のhomeというディレクトリの中のtkajiというディレクトリの中の
             sample1というディレクトリ
というように、ディレクトリの階層構造を、最上位のルートディレクトリから、1行の文字列で表したものです。入力は面倒ですが、フルパスを入力すれば、ディレクトリからディレクトリへ一気に移動することができます。~
その他の便利な移動の仕方に、
 cd ..
というものがあります。これは、カレントディレクトリから1つ上の階層のディレクトリに移動するものです。実際に入力して試してみましょう。これらはカレントディレクトリとの相対関係を記号で表すものです。
 ./ カレントディレクトリ自身
 .. カレントディレクトリから1つ上の階層のディレクトリ

**Divergence Dating [#b0e583dd]
-We inferred divergence dates using both semiparametric and Bayesian relaxed clock methods.
-The first method used was the semiparametric penalized likelihood approach implemented in r8s v1.7 (64, 65). 
--Branch lengths were first estimated on the ML topology using PAUP* under a GTRI model. 
--The Pogonomyrmex and two Myrmica species were used to root the tree during branch length estimation and were subsequently removed from all dating analyses. 
--Thus, the root of the tree for all dating analyses represents the origin of the  e ecore myrmicines, f f a well supported clade established by previous work (33). 
--Smoothing parameters were estimated by using the cross-validation feature in r8s. 
--Confidence intervals were calculated by using 100 nonparametric bootstrap replicates of the dataset generated by Mesquite, followed by reestimation of branch lengths and divergence times for each replicate.
-We calibrated three nodes with minimum-age constraints using attine Dominican amber fossils. 
^^These fossils are 
---(i) Apterostigma electropilosum, a member of the A. pilosum group 
---(ii) Cyphomyrmex maya and Cyphomyrmex taino, both members of the C. rimosus group 
---(iii) Trachymyrmex primaevus, a fossil of uncertain placement within the genus (but see below).
-ディレクトリ間のファイルコピー: ''cp'' ; 移動: ''mv'' 、ディレクトリの作成 ''mkdir''~
ソフトウェアのインストールをしたり、実際の解析をしたりする場合、ファイルのコピーや移動は必須の事項です。~
%%%WindowsでUnixライク環境を構築したのですから、ファイルの移動、コピー、削除は、Windowsのエクスプローラーを使えば簡単にできます%%%。なので、Unix系の命令は覚えなくてもいいのかもしれませんが、、なれてくると、命令を入力する方が楽に思えてくるので、覚えておきましょう。~
ここまでの操作で、自分のディレクトリには、
 sample1  current_d.txt
というように、sample1 というディレクトリと、 current_d.txt というファイルが入っているはずです。ここで、current_d.txt をsample1 ディレクトリに移動してみます。
 mv current_d.txt sample1
  同じことをフルパスで表記すると
   mv /home/tkaji/current_d.txt /home/tkaji/sample1/
sample1フォルダに移動したcurrent_d.txtをもとのフォルダに別名でコピーしたいのなら、
 cp /home/tkaji/sample1/current_d.txt /home/tkaji/sample2.txt
  (フルパスで書きましたが、カレントディレクトリにまでは省略可能です)
今コピーした sample2.txtというファイルを削除したい場合、
 rm /sample2.txt
と入力します。
また、新しいディレクトリを作成したい場合、
 mkdir sample2
です。~
なお、上にも書きましたが、ファイルやディレクトリ関係のこれらの操作は、Windowsからマウスを使ってすべて可能です。 

***テキストエディタによるデータファイルの作成と保存と改行コード [#i8b1d5bd]
Unixライク環境での解析に必要なデータファイルの編集は、viやemacsというエディタをCygwinから使うことも可能ですが、Windowsユーザーにとっては操作がそれほど簡単ではありません。先にインストールした、K2EditorなどのWindowsのテキストエディタを使う方が、ずーっと簡単です。ただし、WindowsとUnixライク環境を行き来する場合、改行コードに注意する必要があります。~
改行コードというのはあまり聞き慣れない言葉かもしれませんが、文書(テキスト)で改行されている場所には、改行を示す目に見えない文字が入っています。しかも、それは、Windows、Unix、Macintoshの3者で異なっています.
 Windows   CR+LF
 Unix      LF
 Macintosh CR
この違いが、Windows, Unix, Mac間でデータをやりとりする場合、いつも、問題になります。また、コンピュータ間でのデータのやりとりだけでなく、今回のように、WindowsのテキストエディタとUnixライク環境であるCygwinの間のやりとりや、Mac OSとMacのターミナル(Darwin)の間のやりとりでも、注意していなくてはなりません。~
では、実際に、K2Editorでファイルを作成して、Cygwinに移動してみましょう。まず、K2Editorを起動して、
  ATGCGGTT
  ATGGCGTT
  ATGGAGTT
をコピーして、ペーストし、Cygwinの自分のデータフォルダに保存してください(私の場合、/home/tkaji/)。K2Editorで保存するときにファイルが表示されたら、ハードディスク c:の下のCygwinフォルダの中の、homeフォルダの中の自分のフォルダに、
 test1.txt
という名前で保存します。~
このとき、ファイル名を入力する欄の下の方に、
 現在の文字コードと改行コードと保存
とかかれていますので、右側の▼をクリックして、
 文字コードと改行コードを指定して保存
にしてください。そうすると次の画面で、「保存時の文字コードと改行の選択」ウィンドウが開くので、
 文字コード SJIS (変更する必要は無いです)
 改行コード  LF  (Unixライク環境で使う場合は、必ず LF にする)
を選んで保存します。
 Unixライク環境で使う場合、改行コードは必ず LF にする
を忘れないでください。~

今後の操作でも、このようにK2Editorを使ってデータファイルを編集し、Cygwinのデータディレクトリに保存するという操作を繰り返します。^


***解析用プログラムのインストール1:r8sの場合 [#s8386e96]
Unixライク環境では、使用するコンピュータを選ばずにソフトウェアをインストールすることができるのですが、そのかわり、その環境に合った実行形式のプログラムファイルを作成するために、コンパイルという作業が必要になります。簡単に流れを説明すると、
 ・ソースコードをダウンロード(通常、tar等で1つのファイルにまとめられている)
 ・Windowsのeoやlha、Cygwinの中ならtarを使ってアーカイブを展開
 ・ソースコードのフォルダに移動し、make を使ってコンパイル
 ・できた実行形式ファイル(Windowsでは.exeという拡張子がついている)を
    /usr/local/bin/ 等のパスの通ったディレクトリに移動しておく
ということになります。以下、r8sという解析プログラムのインストールを例に説明します。
-r8s を右のサイトからダウンロード http://loco.biosci.arizona.edu/r8s/~
eoなどの解凍ソフトがインストールされていたら、ファイルが自動的に展開されて、r8s1.71というフォルダができる。~
Download r8s from the site above.  You will have a folder named "r8s1.71" on your desktop.
-このフォルダを、c:\cygwin/home/user1 に移動~
Move the folder to c:\cygwin/home/user1.
-r8sのインストール:  Installation of r8s~
cygwinを立ち上げ、以下のコマンド($ の後の文字)を順番に入力~
Start Cygwin and input following commands.  Each command is shown after $.
 $ pwd
 /home/user1	#自分が今いるディレクトリ: Your current directory
 
 $ ls		#そのディレクトリの内容をリスト:  List the contents of the current directory
 r8s1.71  sample
 
 
 $ cd r8s1.71	#r8s1.71というディレクトリに移動: Move to the directory "r8s1.71"
 
 $ ls
 bin  doc  sample  src
 
 $ cd src	#srcディレクトリに移動:  Move to the directory "src"
 
 $ make		#コンパイル。うまくゆくと、srcディレクトリ内にr8s.exeができる。
                          Compile with this command.  You will have "r8s.exe" if succeed.
 
 $ mv r8s.exe /usr/local/bin	#できた実行形式ファイルを、/usr/local/binに移動: 
                  #Move the binary file to /usr/local/bin
 	        #こうしておくと、ファイル名だけで実行できる
                # You can execute the .exe files in /usr/local/bin from any directories
 $ ls /usr/local/bin		#ちゃんと移動できたことを確認:  Confirm if the file was moved.
 r8s.exe

-起動テスト: test run of r8s
 $ r8s -v			#起動テスト: Test starting r8s.  You will see the version.
 r8s version 1.71 (compiled Dec 12 2007)
 r8s version 1.71 (Dec 12 2007)
 
 r8s>quit			#起動テスト終了:  quit r8s.
 
 $ cd /home/user1/r8s1.71/sample    
                 #sampleファイルのディレクトリに移動: Move to the sample directory
 
 $ ls
 SAMPLE_1.7          SAMPLE_CROSSVAL  SAMPLE_LOCAL_CLOCK  SAMPLE_SUPERTREE
 SAMPLE_CONSTRAINTS  SAMPLE_FLU       SAMPLE_SIMPLE
 
 $ r8s -f SAMPLE_SIMPLE          #sampleファイルを一つ解析してみる。結果がすぐに表示される。
       Analyze one of the sample file.  You will see the result soon.

***解析用プログラムのインストール2: RaxMLの場合 [#j1a6242c]
-RAXML http://icwww.epfl.ch/~stamatak/index-Dateien/Page443.htm
--最新版(2009年1月時点ではRAxML 7.0.4)をダウンロードして展開
--Cygwinの自分のホームディレクトリに移動させる
--同サイトからマニュアルをダウンロードし、Installに関するところを読む。コンパイル(compile)の方法が書いてある。
--RAxML7.0.4のディレクトリに移動し、自分のコンピュータ環境に適したmakefileを用いてコンパイル(命令文をcygwinにコピー・ペースト)
---今回の演習の場合、
  make -f Makefile.gcc
--できた実行形式ファイルを /usr/local/bin に移動させる

***解析用プログラムのインストール3:PAML, Multidivtimeの場合 [#h1039d9d]
Installation of PAML etc to /usr/local/bin/~
これらのファイルはWindowsの実行形式ファイルがダウンロードでき、のコマンドプロンプトというコマンドラインインターフェースからでも実行できる点が、上でコンパイルしたr8sと異なっています。ただ、コマンドプロンプトを使う場合、パスの設定が面倒な場合があります。また、cygwinの機能(シェルなど)を使う方が、コマンド入力や解析が便利な場合があります。そこで、実行形式ファイル(exeファイル)をパスの通ったc:\cygwin//usr/local/binにまとめておきましょう。~
To use PAML and Multidivtime easier, I recommend you to install them under c:\cygwin/home/user1/.
//(注:大量の繰り返しを必要とする解析の場合、Cygwin環境で使うと計算速度が遅くなるかもしれない。その場合、コマンドプロンプトから実行する方が良いかもしれない。)

-PAMLのダウンロードと動作確認 [#c17db6c1]
--右のサイトからPAMLをダウンロード。 http://abacus.gene.ucl.ac.uk/software/paml.html~
eo等がインストールされていれば、paml4というフォルダが自動的に展開される。この中のbinフォルダに入っている以下9つのexeファイルを、すべて、 c:\cygwin/usr/local/bin に移動。~
Download PAML from the site above,, and move 9 executable files under the bin folder of paml4 folder to c:\cygwin/home/user1/.
 baseml.exe
 basemlg.exe
 chi2.exe
 codeml.exe
 evolver.exe
 mcmctree.exe
 pamp.exe
 TreeTimeJeff.exe
 yn00.exe
--cygwinで確認     #下の様に表示される。~
Confirm by ls if the files have moved.
 $ ls /usr/local/bin
     TreeTimeJeff.exe  basemlg.exe  codeml.exe   mcmctree.exe  r8s.exe
     baseml.exe        chi2.exe     evolver.exe  pamp.exe      yn00.exe
--paml4フォルダをc:\cygwin/home/user1/ディレクトリにコピー。doc, bin, src, Technicalというディレクトリは不要なので削除。~
Move paml4 folder to c:\cygwin/home/user1/ .  You can delete doc, bin, src, Technical directories.  Just type follwing commands to run a test analysis.
 $ ls /home/user1
    paml4
--cygwinで下記の様に入力して、codemlの動作確認]
 $ cd /home/user1/paml4
 $ codeml   #解析結果が画面に表示される

-Multidivtimeのダウンロードとインストール
--右のサイトからmultidivtimeをダウンロード: http://statgen.ncsu.edu/thorne/multidivtime.html~
デスクトップ上にmultidistributeというフォルダができる。フォルダを開いて種類で並び替え、以下4つのファイルを c:\cygwin/usr/local/binに移動。
 estbranches_aa.exe
 estbranches_dna.exe
 multidivtime.exe
 paml2modelinf.exe
--cygwinで確認     #下の様に表示される。
  $ ls /usr/local/bin
     TreeTimeJeff.exe  chi2.exe            estbranches_dna.exe  multidivtime.exe   r8s.exe
     baseml.exe        codeml.exe          evolver.exe          paml2modelinf.exe  yn00.exe
     basemlg.exe       estbranches_aa.exe  mcmctree.exe         pamp.exe
--サンプルファイルの入ったフォルダ, multidistribute を/home/user1にコピーしておく。|
Pamlの場合と同様に、サンプルファイルの入ったフォルダの中から、multidivtimeの実行ファイルを実行できる。

***その他、Cygwin環境で使うと便利なソフトウェア [#lf884f11]
Other useful softerwares under cygwin environment
~
-MrBayes http://mrbayes.scs.fsu.edu/
-MrModeltest  http://www.abc.se/~nylander/
~
~
いずれも、上で説明した他のソフトウェアと同様に、ダウンロードしたら、c:\cygwin/usr/local/bin/ に入れておく。Unix系の操作が必要な解析のデータファイルはいつも自分のホームディレクトリ(/home/user1)に入れておくと決めておくとよい。。解析ごとにサブディレクトリをつくれば、データの整理が簡単になる。~
After downloading from above sites, move executable files to c:\cygwin/usr/local/bin/.  To put data files in order, making data directories under your home directory (/home/user1 (or your own user name)) is recommendes.