LoginSignup
4
3

More than 5 years have passed since last update.

1時間で in houseにChEMBL検索環境を構築する

Last updated at Posted at 2016-03-05

dumpファイルのダウンロード

chembl_21_postgresql.tar.gzをダウンロードして、
vagrantの実行フォルダにおいておく。
(1.1GBあるので、結構時間かかる。)

vagrantの立ち上げ

vagrant init trusty
vagrant up
vagrant ssh

Ubuntuの設定

  • proxy環境下は下記を実行(user,password,proxy,portは自分の環境に読み変える)
sudo  apt-get -o Acquire::http::proxy="http://<user>:<password>@<proxy>:<port>" update
echo 'export http_proxy=http://<proxy>:<port>' >>~/.bashrc
echo 'export https_proxy=https://<proxy>:<port>' >>~/.bashrc
echo 'export ftp_proxy=ftp://<proxy>:<port>' >>~/.bashrc
source ~/.bashrc

PostgreSQLのインストール

sudo -E apt-get install -y postgresql
sudo passwd postgres
# ユーザ名 postgresのパスワードを設定する
su - postgres
psql

PostgreSQLにdumpファイルを突っ込む

psqlで入れる先のDBを作る

create database chembl_21;
\q

dumpをimportする

cd /vagrant/
tar zxvf chembl_21_postgresql.tar.gz
cd chembl_21_postgresql/
psql chembl_21 < chembl_21.pgdump.sql

作業時間
- vagrantの初期化からimport開始まで7分
- importに1時間弱
- total 1時間あれば構築可能

参考URL

OSXにChEMBLを入れる

検索

  • 検索クエリのsqlファイルを同じフォルダに保存して下記コマンド
psql chembl_21 -f test.sql -A -F, > chembl_21_rslt.csv
  • pychembldbを使えばもっと捗ります

pychembldbを使うための手順

4
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
4
3