講義メモ:Cygwinを用いたUnixライク環境の体験

系統解析ソフトウェアには、Mac版PAUP*やMesquiteのように、使いやすいグラフィックインターフェースを備えていないものが多くあります。また、ソースコードで配布されるため、自分の環境に合わせてコンパイルしなければ使用できないものも多くあります。そういうソフトウェアを操作し、自分のコンピュータで使えるようにするには、Unix系のコマンドラインでの操作に慣れておくと便利です。この講義では、Windows上で走るUnix環境エミュレータであるCygwinを使って、r8sのコンパイルと、PAML等のソフトの操作を体験します。
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.

準備:Cygwinのインストールとr8sのダウンロード: Installation of Cygwin and download r8s

  • 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
      WS000000.JPG
  • インストールが終了したら、デスクトップかスタートメニューのCygwinアイコンをクリック。コマンドラインウィンドウが表示される。
    Click the Cygwin Icon on the desktop to start.
  • 一度立ち上げることで、c:\cygwinに/home(自分のユーザー名:以下の例ではuser1)というディレクトリができる。
    In this example, user have a directory named "user1" under c:\cygwinに/home.
  • これでUnixライクな環境が構築できた。
    Now you are in a Unix-like environment running in Windows PC.
  • 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 and analysis of a sample file

  • 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
    
    $ 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.

PAML, Multidivtimeのbinディレクトリへのインストール: Installation of PAML etc to /usr/local/bin/

これらのファイルはウィンドウズのコマンドプロンプトからでも実行できるが、パスの設定が面倒な場合がある。また、cygwinのシェルを使う方が、コマンド入力や解析が便利な場合がある。そこで、実行形式ファイル(exeファイル)をパスの通ったc:\cygwin//usr/local/binにまとめておく。
To use PAML and Multidivtime easier, I recommend you to install them under c:\cygwin/home/user1/.

PAMLのダウンロードと動作確認

  • 右のサイトから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のダウンロードとbinディレクトリへのインストール

  • 右のサイトから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環境で使うと便利なソフトウェア : other useful softerwares under cygwin environment

いずれも、上で説明した他のソフトウェアと同様に、ダウンロードしたら、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.


添付ファイル: fileWS000000.JPG 1529件 [詳細]

Last-modified: 2015-05-13 (水) 16:41:50 (3264d)