macでインフォマティクス

macでインフォマティクス

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

タンパク質やヌクレオチド配列からレジストームを予測する RGI

2022/06/04 追記

2023/10/17 追記

 

 2019年春、CARDのRGIソフトウェアバージョン5がリリースされた。これは、CARDの統合情報を使用して、CARDのウェブサイトまたはコマンドラインツールとして、ゲノムおよびメタゲノムデータのレジストムを予測するものである。RGIは、Prodigalによるオープンリーディングフレーム予測、BLASTまたはDIAMONDによる配列アライメント、およびAMR検出モデルに含まれる耐性変異のキュレーションを組み合わせて、提出されたゲノムからAMR遺伝子と変異をアルゴリズム的に予測するもので、簡単に言うと、RGIは、AMR検出モデルで使用された耐性変異を予測する。RGIのアルゴリズムの詳細については現在準備中だが、CARDの内容の変更を反映したいくつかの改良点は注目に値する。まず、RGIは、これまでサポートされていたゲノムまたはゲノムアセンブリ配列のアノテーションに加え、メタゲノム解析リードのアノテーションをサポートするようになった。メタゲノム解析(すなわちRGI bwt)では、シーケンスリードのBowtie2またはBWAによるCARDのPHM参照配列へのマッピングのみを使用し、ゲノムまたはアセンブリコンティグのアノテーションでは、CARDのAMR検出モデルのうち4つを使用してレジストームを予測する。RGIは、現在、非同義置換のみをスキャンし、フレームシフト、欠失、挿入はスキャンしない。どちらも、CARDの新しいARO分類タグを使用して結果を分類する。メタゲノム解析では、標準的なリードマッピング統計(MAPQ、カバレッジの深さ、カバレッジの長さなど)を使用し、ゲノムやアセンブリコンティグのアノテーションでは、RGI の Perfect/Strict/Loose パラダイムが維持されている。Perfect」アルゴリズムは、CARD参照配列と完全(100%)に一致するAMRタンパク質を検出する。一方、「Strict」アルゴリズムはより柔軟で、配列がキュレーションしたBLASTビットスコアのカットオフ内にある限り、CARD参照配列からの変動を許容し、AMR遺伝子または突然変異によって変化した抗生物質標的の未知の変異体を検出するのに有効になっている。Loose」アルゴリズムは、検出モデルのカットオフの外側で機能し、AMR遺伝子の新しい脅威やより遠いホモログの検出を提供するが、AMRにおける役割を持たない可能性のある相同配列や偽の部分ヒットもカタログ化される。表現型スクリーニングと組み合わせることで、Looseアルゴリズムは新規AMR遺伝子の発見と研究を促進する。

 

Githubより

RGI解析は、CARDウェブサイトのRGIポータル、Galaxyプラットフォーム用のGalaxyラッパー、またはCondaからRGIをインストールしたりDockerからRGIを実行できます。RGIはゲノム、ゲノムアセンブリ、プロテオーム、メタゲノムシーケンスに対応しており、コマンドラインからRGIを使用することができます。CARDの参照配列と有意差のカットオフは常にキュレーション中であり、CARDのキュレーションの進化に伴い、RGIの結果も進化しています。

 

RGIポータル

https://card.mcmaster.ca/analyze/rgi

Galaxy

https://toolshed.g2.bx.psu.edu/repository?repository_id=32ab97c96900983b&changeset_revision=715bc9aeef69

 

インストール

依存

  • Python 3.6
  • NCBI BLAST 2.9.0
  • zlib
  • Prodigal 2.6.3
  • DIAMOND 0.8.36
  • Biopython 1.78
  • filetype 1.0.0+
  • pytest 3.0.0+
  • pandas 0.15.0+
  • Matplotlib 2.1.2+
  • seaborn 0.8.1+
  • pyfaidx 0.5.4.1+
  • pyahocorasick 1.1.7+
  • OligoArrayAux 3.8
  • samtools 1.9
  • bamtools 2.5.1
  • bedtools 2.27.1
  • Jellyfish 2.2.10
  • Bowtie2 2.3.4.3
  • BWA 0.7.17 (r1188)
  • KMA 1.3.4

Github

mamba create -n rgi -y
conda activate rgi
mamba install --channel conda-forge --channel bioconda --channel defaults rgi -y

#docker(hub)
docker pull finlaymaguire/rgi:latest

> rgi --help

usage: rgi <command> [<args>]

            commands are:

               ---------------------------------------------------------------------------------------

               Database

               ---------------------------------------------------------------------------------------

               auto_load Automatically loads CARD database, annotations and k-mer database

               load      Loads CARD database, annotations and k-mer database

               clean     Removes BLAST databases and temporary files

               database  Information on installed card database

               galaxy    Galaxy project wrapper

 

               ---------------------------------------------------------------------------------------

               Genomic

               ---------------------------------------------------------------------------------------

 

               main     Runs rgi application

               tab      Creates a Tab-delimited from rgi results

               parser   Creates categorical JSON files RGI wheel visualization

               heatmap  Heatmap for multiple analysis

 

               ---------------------------------------------------------------------------------------

               Metagenomic

               ---------------------------------------------------------------------------------------

               bwt                   Align reads to CARD and in silico predicted allelic variants (beta)

               

               ---------------------------------------------------------------------------------------

               Baits validation

               ---------------------------------------------------------------------------------------

               tm                    Baits Melting Temperature

 

               ---------------------------------------------------------------------------------------

               Annotations

               ---------------------------------------------------------------------------------------

               card_annotation       Create fasta files with annotations from card.json

               wildcard_annotation   Create fasta files with annotations from variants

               baits_annotation      Create fasta files with annotations from baits (experimental)

               remove_duplicates     Removes duplicate sequences (experimental)

 

               ---------------------------------------------------------------------------------------

               Pathogen of origin

               ---------------------------------------------------------------------------------------

               

               kmer_build            Build AMR specific k-mers database used for pathogen of origin (beta)

               kmer_query            Query sequences against AMR k-mers database to predict pathogen of origin (beta)

 

               

 

Resistance Gene Identifier - 5.2.1

 

positional arguments:

  {main,tab,parser,load,auto_load,clean,galaxy,database,bwt,tm,card_annotation,wildcard_annotation,baits_annotation,remove_duplicates,heatmap,kmer_build,kmer_query}

                        Subcommand to run

 

optional arguments:

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

 

Use the Resistance Gene Identifier to predict resistome(s) from protein or nucleotide data based on homology and SNP models. Check https://card.mcmaster.ca/download for software and data updates. Receive email notification of monthly CARD updates via the CARD

Mailing List (https://mailman.mcmaster.ca/mailman/listinfo/card-l)

 

> rgi load -h

usage: rgi load [-h] [-i CARD_JSON] [--card_annotation CARD_ANNOTATION] [--wildcard_annotation WILDCARD_ANNOTATION] [--wildcard_index WILDCARD_INDEX] [--wildcard_version WILDCARD_VERSION] [--baits_annotation BAITS_ANNOTATION] [--baits_index BAITS_INDEX]

                [--kmer_database KMER_DATABASE] [--amr_kmers AMR_KMERS] [--kmer_size KMER_SIZE] [--local] [--debug]

 

Resistance Gene Identifier - 5.2.1 - Load

 

optional arguments:

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

  -i CARD_JSON, --card_json CARD_JSON

                        must be a card database json file

  --card_annotation CARD_ANNOTATION

                        annotated reference FASTA

  --wildcard_annotation WILDCARD_ANNOTATION

                        annotated reference FASTA

  --wildcard_index WILDCARD_INDEX

                        wildcard index file (index-for-model-sequences.txt)

  --wildcard_version WILDCARD_VERSION

                        specify variants version used

  --baits_annotation BAITS_ANNOTATION

                        annotated reference FASTA

  --baits_index BAITS_INDEX

                        baits index file (baits-probes-with-sequence-info.txt)

  --kmer_database KMER_DATABASE

                        json of kmer database

  --amr_kmers AMR_KMERS

                        txt file of all amr kmers

  --kmer_size KMER_SIZE

                        kmer size if loading kmer files

  --local               use local database (default: uses database in executable directory)

  --debug               debug mode

 

> rgi card_annotation -h

usage: rgi card_annotation [-h] -i INPUT [--ncbi]

 

Creates card annotations for RGI BWT from card.json

 

optional arguments:

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

  -i INPUT, --input INPUT

                        card.json file

  --ncbi                adds ncbi accession to FASTA headers

 

> rgi heatmap -h

usage: rgi heatmap [-h] -i INPUT [-cat {drug_class,resistance_mechanism,gene_family}] [-f] [-o OUTPUT] [-clus {samples,genes,both}] [-d {plain,fill,text}] [--debug]

 

Creates a heatmap when given multiple RGI results.

 

optional arguments:

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

  -i INPUT, --input INPUT

                        Directory containing the RGI .json files (REQUIRED)

  -cat {drug_class,resistance_mechanism,gene_family}, --category {drug_class,resistance_mechanism,gene_family}

                        The option to organize resistance genes based on a category.

  -f, --frequency       Represent samples based on resistance profile.

  -o OUTPUT, --output OUTPUT

                        Name for the output EPS and PNG files. The number of files run will automatically be appended to the end of the file name. (default=RGI_heatmap)

  -clus {samples,genes,both}, --cluster {samples,genes,both}

                        Option to use SciPy's hiearchical clustering algorithm to cluster rows (AMR genes) or columns (samples).

  -d {plain,fill,text}, --display {plain,fill,text}

                        Specify display options for categories (deafult=plain).

  --debug               debug mode

 

 

データベースの準備

解析を開始するには、まずCARDから最新のAMRリファレンスデータを取得する。CARDデータベースは、システムレベルまたはローカルレベルでインストールできる。

wget https://card.mcmaster.ca/latest/data
tar -xvf data ./card.json

#System wide
rgi load --card_json card.json
  • --local   use local database (default: uses database in executable directory)

 

メタゲノム解析では、さらにCARDのResistomes & Variantsデータを使う。CARDデータを読み込んだ後、システムレベルまたはローカルレベルでインストールすることが可能。

rgi card_annotation -i card.json > card_annotation.log
rgi load -i card.json --card_annotation card_database_v3.2.2.fasta

WildCARDのデータを取得。

wget -O wildcard_data.tar.bz2 https://card.mcmaster.ca/latest/variants
mkdir -p wildcard
tar -xjf wildcard_data.tar.bz2 -C wildcard
gunzip wildcard/*.gz

rgi wildcard_annotation -i wildcard --card_json card.json \
-v version_number > wildcard_annotation.log
rgi load --wildcard_annotation wildcard_database_v3.0.2.fasta \
--wildcard_index wildcard/index-for-model-sequences.txt \
--card_annotation card_database_v3.0.2.fasta

上記の Required CARD Reference Data と Additional Reference Data for Metagenomics Analyses の手順をすべて完了した後、k-mer reference data をロードする。

rgi load --kmer_database wildcard/61_kmer_db.json \
--amr_kmers wildcard/all_amr_61mers.txt --kmer_size 61 \
--debug > kmer_load.61.log

 

 

実行方法

ゲノムアセンブリやゲノム配列の Perfect または Strict ヒットを生成

rgi main --input_sequence nucleotide.fasta \
--output_file output_file --input_type contig --local --clean

 

短いコンティグや低品質のコンティグを部分的に遺伝子予測し、Looseヒットも含む。

rgi main --input_sequence nucleotide.fasta \
--output_file /path/to/output_file --input_type contig --local \
--include_loose --exclude_nudge --clean

 

タンパク質配列を使う。

rgi main --input_sequence /path/to/protein.fasta \
--output_file output_file --input_type protein --clean

#Loose hitsも含む
rgi main --input_sequence protein.fasta \
--output_file output_file --input_type protein --local \
--include_loose --clean

#BLASTの代わりにDIAMONDを使う。40スレッド使用
rgi main --input_sequence protein.fasta \
--output_file output_file --input_type protein --local \
  --alignment_tool DIAMOND --num_threads 40 --clean

JSON形式とプレーンテキストとして結果は出力される。

出力例(詳細

 

 

ヒートマップで視覚化する()。

rgi heatmap --input rgi_dir/ --output output_file

#do hiearchical clustering (デンドログラム図は表示されない)
rgi heatmap --input rgi_dir/ --output output_file -clus both

#結果をAMR遺伝子ファミリーで整理する。3つのカテゴリが利用できる。
rgi heatmap --input rgi_dir/ --output output_file -cat drug_class
  • -cat {drug_class, resistance_mechanism, gene_family}  The option to organize resistance genes based on a category.
  • -f  Represent samples based on resistance profile.
  • -o     Name for the output EPS and PNG files. The number of files run will automatically be appended to the end of the file name. (default=RGI_heatmap)
  • -clus {samples, genes, both}   Option to use SciPy's hiearchical clustering algorithm to cluster rows (AMR genes) or columns (samples).

 

Githubより

  • RGIは、PerfectStrictLoose(通称:Discovery)の3つのパラダイムでゲノムやプロテオーム配列を解析する。
  • Perfectアルゴリズムは、キュレーションされた参照配列やCARDの変異と完全に一致するものを検出するため、臨床監視に最もよく適用されている。
  • Strict アルゴリズムは、既知の AMR 遺伝子の未知の変異を検出する。重要な変異の二次スクリーニングを含め、CARD のキュレーションされた類似性カットオフを使用した検出モデルにより、検出された変異が機能する AMR 遺伝子である可能性が高いことを確認できる。
  • Looseアルゴリズムは、検出モデルのカットオフの外で動作し、新しい脅威やAMR遺伝子のより遠いホモログの検出ビューを提供するが、AMRに役割を持たない可能性のある相同な配列や偽の部分ヒットもカタログ化される(Looseアルゴリズムは、表現型スクリーニングと組み合わせ、新しいAMR遺伝子を探索するために利用できる)。
  • デフォルトでは、--exclude_nudge フラグが使用されていない限り、同一性が 95% 以上の Loose RGI ヒットは、アライメント長に関わらず、すべて Strict として自動的にリストアップされる。
  • JSONはCARD D.Bのhttps://card.mcmaster.ca/analyze/externalrgiからアップロードして環状プロットとして視覚化できる。

 

引用

CARD 2020: antibiotic resistome surveillance with the comprehensive antibiotic resistance database
Brian P Alcock , Amogelang R Raphenya , Tammy T Y Lau , Kara K Tsang , Megane Bouchard, Arman Edalatmand , William Huynh , Anna-Lisa V Nguyen, Annie A Cheng , Sihan Liu , Sally Y Min , Anatoly Miroshnichenko , Hiu-Ki Tran , Rafik E Werfalli , Jalees A Nasir , Martins Oloni , David J Speicher , Alexandra Florescu, Bhavya Singh, Mateusz Faltyn, Anastasia Hernandez-Koutoucheva, Arjun N Sharma , Emily Bordeleau , Andrew C Pawlowsk, Haley L Zubyk , Damion Dooley, Emma Griffiths 0, Finlay Maguire , Geoff L Winsor 0, Robert G Beiko , Fiona S L Brinkman 0, William W L Hsiao, Gary V Domselaar, Andrew G McArthur 

Nucleic Acids Res. 2020 Jan 8;48(D1):D517-D525

 

参考

”レジストームという概念はすべての抗生物質耐性メカニズムの集合に相当する。 病原菌に認められる耐性だけでなく通常は疾患とは無関係の環境中生物の耐性遺伝子もこれに含まれる。 自己毒性を避けるために耐性と産生を相互進化させなければなら ない抗生物質産生菌がその例である。”

140 0145 Seasonal variation of Campylobacter types from ...http://www.maff.go.jp › sikkou › syouan_ippan › pdf