0
0

More than 1 year has passed since last update.

遺伝研サーバー内でDENTISTを使おうとして詰まっている話(未完)

Last updated at Posted at 2023-04-17

ゴール

DENTISTを遺伝研スパコン内の自分のワークスペースに導入してゲノムのscaffoldingを行う。

DENTIST—using long reads for closing assembly gaps at high accuracy
DentistのGithub

環境

遺伝研スパコンの一般解析区画
linux minicondaの仮想環境

# 仮想環境を作成
$ mamba create -n dentist
$ conda activate dentist

condaのレポジトリはconda-forgeとbiocondaを設定してある。

Use Conda via Snakemake (recommended)

Githubを見るとSnakemakeを使った導入が推奨されていた。
いつもお世話になってるmacでインフォマティクスさんではこの導入経路は紹介されていなかった、かつ手軽なSingularityは非推奨になっていたため、慣れないSnakemakeを使った導入に挑戦してみる。

1. Snakemakeの導入

まずSnakemakeとはなんぞやというところから始まる。
SnakemakeのGithub
調べると、ざっくり言えば「Pythonで書かれた、再現性と拡張性のあるデータ解析を作成するためのワークフロー管理システム」らしい。つまるところPythonベースのMakefileのようなものか。
今回はSnakemakeを書くわけではなく使うだけなのでこのぐらいの理解で先に進む。

作成した仮想環境にSnakemakeを入れていく。

mamba install snakemake
$ mamba install snakemake 
$ snakemake --version
4.0.0

ここでpython 3.6.15が入ってきた。
が仮想環境作成時に入っていたpython 2.7.5が消えておらず、競合しそうな気がしたためpythonのversionを3.6.15に指定してやり直した。

2. DENTISTの導入

DentistのGithubを参考にしてSnakemakeの導入を試みる。

cd ~/Softwares   # Softwareを集めているディレクトリ
wget https://github.com/a-ludi/dentist/releases/download/v4.0.0/dentist.v4.0.0.x86_64.tar.gz
tar -xzf dentist.v4.0.0.x86_64.tar.gz
cd dentist.v4.0.0.x86_64

ここで、dentist.ymlとsnakemake.ymlの編集を促されているので、中身を確認してみる。

dentist.yml

# You must set at least either `ploidy` and `read-coverage`
# or `max-coverage-reads` and `min-coverage-reads`.
__default__:
    read-coverage: 20.0
    ploidy: 2
    max-coverage-self: 3
    verbose: 2
......

snakemake.yml

# You may provide default values for environment variable. They will only be
# used if the variable is undefined in the current environment.
#default_env:
#    TMPDIR: /home/user/tmp

# You may also override values in the environment.
#override_env:
#    LANG:   C


# --- Environment variables substitution ---
#
# Environment variables may be referenced in the config via `$VARNAME` or
# `${VARNAME}`; to get a literal dollar sign use `$$`. Values in `deafult_env`
# `override_env` are expanded with the unmodified environment.
#
# Beware, if using environment variables in `dentist_config` the data type
# must be correct, e.g. you cannot pass `read-coverage` be environment
    # variable because it will be a string but a float is expected. Still, if you
# specify values via `env` in the config then they will keep their data type,
# so the following will work:
#
#     override_env:
#         COV: 30.0
#     dentist_config:
#         __default__:
#             read-coverage: $COV
......

dentist.ymlは扱いたいゲノムに応じて、snakemake.ymlは環境に応じて編集しろ、ということだと読み取った。
各パラメータの説明はREADME.mdのHow to Choose DENTIST Parametersに記載があった。
偶然にも使いたいゲノムのcoverageおよびploidyがデフォルトと一致していたため、dentist.ymlとsnakemake.ymlはデフォルトのままで先に進む。

# execute with CONDA:
$ snakemake --configfile=snakemake.yml --use-conda
SyntaxError in line 930 of /lustre7/home/usr/Softwares/dentist.v4.0.0.x86_64/Snakefile:

Unexpected keyword container in rule definition (Snakefile, line 930)

早速エラーを吐かれた。930行目でsyntax errorらしいのでその周辺を確認する。

928 rule validate_dentist_config:
929     input: dentist_config_file
930     container: dentist_container
931     conda: dentist_env
932     script: "scripts/validate_dentist_config.py"

ruleなんて関数知らないぞ! と思ったが、python自体ではなくsnakemakeでの記述ルールらしい。
ここでエラーログに目を戻してみると、containerの定義元であるdentist_containerが設定されていないとのこと。
しかしながら今回はcondaを使っている=コンテナを使っていないため、この値の設定は必要ないはず。
ここで詰まってしまったためこの手法は一旦ここまで。

追記

ここでwget https://github.com/a-ludi/dentist/releases/download/v4.0.0/dentist.v4.0.0.x86_64.tar.gz 内のREADME.mdを見てみると、Github上では非推奨となっていたsingularityが推奨になっていた。どういうこっちゃ。

0
0
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
0
0