LoginSignup
2
3

More than 3 years have passed since last update.

Windows 7かMac OS X上でE-Cell4を使ってみる

Last updated at Posted at 2014-12-11

以下の情報は時代遅れです。最新の情報はこちらを参照してください。

インストールの方法

注意: E-Cell4は只今絶賛開発中です. 多分に人柱的要素がありますのでご注意下さい.

jupyter[notebook], numpy, matplotlibなどのインストールは本当は任意だが, まず間違いなく使った方が良い.

Windowsの場合

  1. http://conda.pydata.org/miniconda.htmlから32ビット版のMiniconda for Windowsをインストールする1.

  2. コマンドプロンプトcmdを起動して, 依存する他のPythonライブラリをインストールする[^2].

    conda update pip
    conda install hdf5 jupyter matplotlib
    

[^2]: Anacondaの場合は不要.

  1. つづけてE-Cell4をインストールする. Python3の場合は下の方を実行して下さい.

    pip install https://github.com/ecell/ecell4/releases/download/4.0.0/ecell-4.0.0-cp27-none-win32.whl
    # pip install https://github.com/ecell/ecell4/releases/download/4.0.0/ecell-4.0.0-cp35-none-win32.whl
    

オプションだが, 動画表示機能を使いたい人はhttp://ffmpeg.zeranoe.com/builds/などからFFmpegをインストールしてパスPATHを通しておく.

Macの場合

Mac OS Xの場合, E-Cell4そのものはhomebrewでインストールできる.

brew tap ecell/ecell4
brew install ecell4

homebrewを使ったgslのinstall

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install gsl

Python環境の準備

Python, numpy, matplotlibは既に入っているのでIPython Notebookをpipを使ってインストールする.

curl -O https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
sudo pip install "ipython[notebook]"

E-Cell4のインストール

つづいて, E-Cell4をインストール. Yosemite (10.10)の場合は,

sudo pip install https://github.com/ecell/ecell4/releases/download/4.0.0-beta2/ecell4-4.0.0b2-cp27-none-macosx_10_10_intel.whl

Mavericks (10.9)の場合は,

sudo pip install https://github.com/ecell/ecell4/releases/download/4.0.0-beta2/ecell4-4.0.0b2-cp27-none-macosx_10_9_intel.whl

でインストールできる.

使い方

IPython Notebookをインストールしている場合は下記の要領で立ち上げる. 勝手にブラウザが起動し, IPython Notebookのメインページに飛ぶはず. IEかSafariを利用する場合は, 問題が生じる場合があるので注意して下さい.

ipython notebook

新規ノートブックを作成して最初の行で%matplotlib inlineを実行した後で, 下記のコードを実行すればシミュレーションの結果をグラフとして表示できる.

test1.py
%matplotlib inline
import numpy
from ecell4 import *

with reaction_rules():
    A + B == C | (0.01, 0.3) # 可逆反応

run_simulation(10, {'A': 60, 'B': 60})

結果は以下のようになるはず.

plot0.png

より詳しい使い方については下記の記事を参照して下さい.


  1. 容量に余裕のある人は全部入りのAnacondaを使うと手間が省ける. https://www.continuum.io/downloads 

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3