rna-seq入門_2023

環境構築

1. ターミナルを開いてwsl –install

2.Homebrew for Linuxのインストール

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
#PATHへbrewコマンドを追加 #環境によって変わるのでbrewをインストールしたときに最後に出てくるメッセージをちゃんと読んでおく
(echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> /home/yoshitake/.bashrc
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
    
#brew用にツールをインストール(Ubuntuの場合)
sudo apt update
sudo apt install build-essential
brew install gcc

3.condaのインストール

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
#最後にPATHに追加するかと聞かれるのでyesにしておく

4.Docker (ではなくてPodman)のインストール

brew install podman

#この状態でpodman pull alpineしてもError: command required for rootless mode with multiple IDs: exec: "newuidmap": executable file not found in $PATHと出るので、下記のツールをインストールしておく
sudo apt install uidmap

#動作確認用コマンド
podman run -it --rm alpine uname -a
#Linux b9041c6983fd 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 Linux

1.Homebrew for Macのインストール

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
#PATHへbrewコマンドを追加 #環境によって変わるのでbrewをインストールしたときに最後に出てくるメッセージをちゃんと読んでおく
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/suikou/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

2.condaのインストール

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
bash Miniconda3-latest-MacOSX-x86_64.sh

3.Docker (ではなくてPodman)のインストール

brew install podman
#podmanの仮想マシンをダウンロード
podman machine init
#podmanの仮想マシンをスタート(OS再起動時は毎回行う)
podman machine start

1.Homebrew for Macのインストール

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
#PATHへbrewコマンドを追加 #環境によって変わるのでbrewをインストールしたときに最後に出てくるメッセージをちゃんと読んでおく
#Homebrewはarm版も充実しているのでそのままインストールして問題なさそう
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/suikou/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

2.condaのインストール

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
arch -x86_64 /bin/bash Miniconda3-latest-MacOSX-x86_64.sh
#x86_64でインストールするのが大事。armでインストールしてしまうと、condaにはほとんどパッケージがない

3.Docker (ではなくてPodman)のインストール

brew install podman
#podmanの仮想マシンをダウンロード
podman machine init
#podmanの仮想マシンをスタート(OS再起動時は毎回行う)
podman machine start

#動作確認用コマンド
podman run -it --rm alpine uname -a
#Linux 83d8b1007fde 6.5.6-200.fc38.aarch64 #1 SMP PREEMPT_DYNAMIC Fri Oct  6 19:34:05 UTC 2023 aarch64 Linux
#x86_64用のコンテナの場合は勝手にx86_64を使ってくれるみたい
podman run -it --rm c2997108/centos7:3-java uname -a
#Linux 66968c5f1f05 6.5.6-200.fc38.aarch64 #1 SMP PREEMPT_DYNAMIC Fri Oct  6 19:34:05 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

ツールのインストール

基本的には

brew install sratoolkit

conda install sra-tools

で良いけど、condaでツールをインストールしすぎるとツールのバージョン制限を解消できない時があって、次のようなエラーが出たりする。

 % conda install -c bioconda trim-galore
Collecting package metadata (current_repodata.json): done
Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve.
Solving environment: unsuccessful attempt using repodata from current_repodata.json, retrying with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve.
Solving environment: /
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  - trim-galore -> python[version='2.7.*|3.5.*|3.6.*|>=2.7,<2.8.0a0|>=3.10,<3.11.0a0|>=3.9,<3.10.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0|>=3.6,<3.7.0a0|>=3.5,<3.6.0a0|3.4.*']

Your python: python=3.11

If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.

その場合、新しい環境を作ってあげると良い。

conda create -n trim-galore -c bioconda trim-galore

新しくtrim-galore環境をインストールしてもそのままでは使えないので、下記のコマンドを実行して環境を切り替える

conda activate trim-galore

もとの環境に戻すなら

conda deactivate

Dockerコマンドは

全てpodmanに置換

例:

docker run --rm -v `pwd`:`pwd` trinityrnaseq/trinityrnaseq Trinity

podman run --rm -v `pwd`:`pwd` trinityrnaseq/trinityrnaseq Trinity


Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 4096 bytes) in /home/webpark1634/www/yosh/lib/plugins/authplain/auth.php on line 441

Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 65536 bytes) in /home/webpark1634/www/yosh/inc/load.php on line 129