macでインフォマティクス

macでインフォマティクス

HTS (NGS) 関連のインフォマティクス情報についてまとめています。

(RNA seqの下流解析のための)深層学習ベースのスプライシングジャンクション予測ツール Splam

2023/08/18更新、タイトル変更

 

 イントロンを除去するためにメッセンジャーRNAスプライシングするプロセスは、遺伝子や遺伝子バリアントを作り出す上で中心的な役割を果たしている。ここでは、深層残差畳み込みニューラルネットワークに基づく、DNA中のスプライスジャンクションを予測する新しい手法であるSplamについて述べる。これまでのいくつかのモデルとは異なり、Splamは各スプライス部位を挟む400塩基対の比較的限定されたウィンドウに注目する。これは、スプライシングの生物学的プロセスが主にこのウィンドウ内のシグナルに依存しているという観察に基づく。さらにSplamは、スプライシング機構が各イントロンの両端を一度に認識するという原則に基づき、ドナーとアクセプターのペアを一緒にネットワークに学習させるというアイデアを導入している。Splamの精度を、最近の最先端のスプライス部位予測手法、特にディープニューラルネットワークを用いた別の手法であるSpliceAIと比較した。その結果、SplamはSpliceAIよりも一貫して精度が高く、ヒトのスプライスジャンクションの予測精度は全体で96%であった。Splamは、開花植物のシロイヌナズナのような遠い種を含む、ヒト以外の種にも一般化して扱う。最後に、Splamを新しいアプリケーション、すなわちRNA-seqデータのスプライシングアラインメントを処理し、エラーを同定・除去するために使用することを実証する。このようにSplamを用いると、ポリ(A)およびリボ欠失RNA-seqライブラリの両方において、下流のトランスクリプトーム解析の精度が大幅に向上することを示す。全体として、Splamはスプライシングジャンクションを検出するための、より高速で正確なアプローチを提供すると同時に、誤ったスプライシングアラインメントをクリーンアップするための、信頼性が高く効率的なソリューションを提供する。

 

Tutorial

http://ccb.jhu.edu/splam/index.html

 

インストール

macosでテストした(macos 12.4使用)。

依存

  • python >= 3.6.0 (not compatible with the latest version of python=3.11.4)
  • pytorch >= 1.12.0
  • pybedtools >= 0.9.0
  • gffutils >= 0.10.0
  • pybind11 >= 2.10.0

Github

#conda
mamba create -n splam python=3.10
conda activate splam
mamba install -c bioconda splam
#bedtoolsも必要
mamba install -c bioconda -y bedtools

#pip
pip install splam

#Install from source
git clone https://github.com/Kuanhao-Chao/splam --recursive
cd splam/src/
python setup.py install

splam -h

=====================================================================

 An accurate spliced alignment pruner and splice junction predictor. 

=====================================================================

 

 

  ███████╗██████╗ ██╗      █████╗ ███╗   ███╗

  ██╔════╝██╔══██╗██║     ██╔══██╗████╗ ████║

  ███████╗██████╔╝██║     ███████║██╔████╔██║

  ╚════██║██╔═══╝ ██║     ██╔══██║██║╚██╔╝██║

  ███████║██║     ███████╗██║  ██║██║ ╚═╝ ██║

  ╚══════╝╚═╝     ╚══════╝╚═╝  ╚═╝╚═╝     ╚═╝

    

usage: splam [-h] [-v] [-c] {extract,score,clean} ...

 

splice junction predictor to improve alignment files (BAM / CRAM)

 

options:

  -h, --help            show this help message and exit

  -v, --version

  -c, --citation

 

Commands:

  {extract,score,clean}

    extract             Extracting all splice junctions from an alignment or annotation file

    score               Scoring all splice junctions

    clean               Cleaning up spurious splice alignment

splam extract -h

=====================================================================

 An accurate spliced alignment pruner and splice junction predictor. 

=====================================================================

 

 

  ███████╗██████╗ ██╗      █████╗ ███╗   ███╗

  ██╔════╝██╔══██╗██║     ██╔══██╗████╗ ████║

  ███████╗██████╔╝██║     ███████║██╔████╔██║

  ╚════██║██╔═══╝ ██║     ██╔══██║██║╚██╔╝██║

  ███████║██║     ███████╗██║  ██║██║ ╚═╝ ██║

  ╚══════╝╚═╝     ╚══════╝╚═╝  ╚═╝╚═╝     ╚═╝

    

usage: splam extract [-h] [-V] [-P] [-n] [-f FILE_FORMAT] [-d DATABASE] [-o DIR] [-M DIST] [-g GAP] INPUT

 

positional arguments:

  INPUT                 target alignment file in BAM format or annotation file in GFF format.

 

options:

  -h, --help            show this help message and exit

  -V, --verbose         running Splam in verbose mode.

  -P, --paired          bundling alignments in "paired-end" mode.

  -n, --write-junctions-only

                        writing out splice junction BED file only without other temporary files.

  -f FILE_FORMAT, --file-format FILE_FORMAT

                        the file type for Splam to process. It can only be "BAM", "GFF", or "GTF". The default value is "BAM".

  -d DATABASE, --database DATABASE

                        the path to the annotation database built using gffutils. If this argument is provided, Splam loads the database instead of

                        creating a new one.

  -o DIR, --outdir DIR  the directory where the output file is written to. Default output filename is "junction.bed"

  -M DIST, --max-splice DIST

                        maximum splice junction length

  -g GAP, --bundle-gap GAP

                        minimum gap between bundles

splam score -h

=====================================================================

 An accurate spliced alignment pruner and splice junction predictor. 

=====================================================================

 

 

  ███████╗██████╗ ██╗      █████╗ ███╗   ███╗

  ██╔════╝██╔══██╗██║     ██╔══██╗████╗ ████║

  ███████╗██████╔╝██║     ███████║██╔████╔██║

  ╚════██║██╔═══╝ ██║     ██╔══██║██║╚██╔╝██║

  ███████║██║     ███████╗██║  ██║██║ ╚═╝ ██║

  ╚══════╝╚═╝     ╚══════╝╚═╝  ╚═╝╚═╝     ╚═╝

    

usage: splam score [-h] [-V] [-o DIR] [-b BATCH] [-d pytorch_dev] [-A REPORT] -G REF.fasta -m MODEL.pt junction_BED

 

positional arguments:

  junction_BED          target splice junctions in bed files.

 

options:

  -h, --help            show this help message and exit

  -V, --verbose

  -o DIR, --outdir DIR  the directory where the output file is written to. Default output filename is "junction_score.bed"

  -b BATCH, --batch-size BATCH

                        the number of samples that will be propagated through the network. By default, the batch size is set to 10.

  -d pytorch_dev, --device pytorch_dev

                        the computing device that is used to perform computations on tensors and execute operations in the PyTorch framework. By

                        default, this parameter is detectd automatically.

  -A REPORT, --assembly-report REPORT

                        the path to an assembly report file containing the chromosome identifiers and lengths. If none provided, will default to human

                        GRCh38.p14.

  -G REF.fasta, --reference-genome REF.fasta

                        the path to the reference genome.

  -m MODEL.pt, --model MODEL.pt

                        the path to the Splam model

splam clean -h

=====================================================================

 An accurate spliced alignment pruner and splice junction predictor. 

=====================================================================

 

 

  ███████╗██████╗ ██╗      █████╗ ███╗   ███╗

  ██╔════╝██╔══██╗██║     ██╔══██╗████╗ ████║

  ███████╗██████╔╝██║     ███████║██╔████╔██║

  ╚════██║██╔═══╝ ██║     ██╔══██║██║╚██╔╝██║

  ███████║██║     ███████╗██║  ██║██║ ╚═╝ ██║

  ╚══════╝╚═╝     ╚══════╝╚═╝  ╚═╝╚═╝     ╚═╝

    

usage: splam clean [-h] [-@ threads] [-t threshold] [-n bad intron num] [-P] -o DIR

 

options:

  -h, --help            show this help message and exit

  -@ threads, --threads threads

                        set number of sorting, compression and merging threads. This is intended for cleaning BAM alignment files. By default,

                        operation is single-threaded.

  -t threshold, --threshold threshold

                        the cutoff threshold for identifying spurious splice junctions. Default is 0.1.

  -n bad intron num, --bad-intron-num bad intron num

                        the threshold for the number of spurious splice junctions in a transcript determines whether the transcript is considered bad.

                        Default is 8.

  -P, --paired          cleaning up the alignment file in "paired-end" mode.

  -o DIR, --outdir DIR  the directory where the output file is written to. Default output filename is "junction_score.bed".

 

 

テストラン

Splamの主な使用シナリオは2つあり、1つ目はアライメントファイルを使っての実行、2つ目はアノテーションファイルやアセンブルされたトランスクリプトの実行、となっている(link)。

1、アライメントBAMのクリーニング

git clone https://github.com/Kuanhao-Chao/splam #全体で1GBほどある
cd splam/test/

#1 スプライシングジャンクションの抽出
splam extract -P SRR1352129_chr9_sub.bam -o tmp_out_alignment

#2 抽出されたスプライシングジャンクションの採点
splam score -G chr9_subset.fa -m ../model/splam_script.pt -o tmp_out_alignment tmp_out_alignment/junction.bed

#3 クリーニングされソートされtアラインメントBAMの出力
splam clean -P -o tmp_out_alignment -@ 5

> splam extract -P SRR1352129_chr9_sub.bam -o tmp_out_alignment

> splam score -G chr9_subset.fa -m ../model/splam_script.pt -o tmp_out_alignment tmp_out_alignment/junction.bed

> splam clean -P -o tmp_out_alignment -@ 5

tmp_out_alignment/

 

2、アノテーションファイル/アセンブルされたトランスクリプト(GFF)の評価 

#1 スプライシングジャンクションの抽出
splam extract refseq_110_GRCh38_chr_fixed.gff -o tmp_out_annotation

#2 抽出されたスプライシングジャンクションの採点
splam score -G chr9_subset.fa -m ../model/splam_script.pt -o tmp_out_annotation tmp_out_annotation/junction.bed

#3 それぞれのスクリプトの統計の出力
splam clean -o tmp_out_annotation -t 0.8

> splam clean -o tmp_out_annotation -t 0.8

tmp_out_annotation/

 

レポジトリではヒトとマウスのGFFの評価を行なっている。

 

  • Google Colabに再現可能で簡単に実行できるSplamの例がいくつか作られている(link)。

引用
Splam: a deep-learning-based splice site predictor that improves spliced alignments
Kuan-Hao Chao, Alan Mao, Steven L Salzberg, Mihaela Pertea

bioRxiv. Posted July 29, 2023.