macでインフォマティクス

macでインフォマティクス

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

ユーザーが関心のある遺伝子の周辺配列の相同性を調べる Flanker

2021 3/1  renameコマンド修正

2022/03/17 論文引用

 

 関心のある遺伝子の周囲の配列を解析することは、特に抗菌薬耐性遺伝子などの水平遺伝子導入におけるmobile genetic elements (MGEs) の役割を理解する上で非常に重要であることが多い。ここでは、一貫した形式で遺伝子のフランキング配列のアラインメントフリーなクラスタリングを行うPythonパッケージFlankerを紹介する。FlankerはMash距離に基づいてフランキング配列をクラスタリングし、配列間の類似度や類似度の程度を簡単に比較できるようにしている。さらに、Flankerは柔軟にパラメータを設定して、上流と下流の領域を別々に特徴付けしたり、可変長のフランキング配列を調査したりして、出力を微調整することができる。重要な carbapenemase genes(blaOXA-48とblaKPC-2/3)のプラスミド関連キャリッジを記述した最近の2つのデータセットにFlankerを適用し、既知のものと以前には明らかにされていなかった構造変異を含む、異なるフランキング配列のクラスター(フランキングパターン)を識別することに成功したことを示した。その結果、フランキングパターンが地理的地域やカルバペネム表現型と関連していることを示し、それらが疫学的マーカーとして有用である可能性を示唆している。FlankerはMITライセンスのもと、https://github.com/wtmatlock/flanker で自由に利用できる。

 本原稿で行った解析は、Flanker Githubページ(https://github.com/wtmatlock/flanker)で提供されているBinder環境で再現することができる。

 

Documentation

https://flanker.readthedocs.io/en/latest/

 

 

f:id:kazumaxneo:20210228200918p:plain

Flanker. Githubより転載

 

インストール

Github

#conda + pip(ここでは高速なmambaを使う)
mamba create -n flanker -c bioconda python=3 abricate=1.0.1 mash -y
conda activate flanker
pip install git+https://github.com/wtmatlock/flanker

> flanker

$ flanker 

usage: flanker [-h] -i FASTA_FILE (-g GENE [GENE ...] | -log LIST_OF_GENES) [-cm] [-f FLANK] [-m MODE] [-circ] [-inc] [-db DATABASE] [-v [VERBOSE]] [-w WINDOW] [-wstop WINDOW_STOP] [-wstep WINDOW_STEP] [-cl] [-o OUTFILE] [-tr THRESHOLD]

               [-p THREADS] [-k KMER_LENGTH] [-s SKETCH_SIZE]

 

Flanker (version 0.1.5). If you use Flanker in your work, please cite us: Matlock W, Lipworth S, Constantinides B, Peto TEA, Walker AS, Crook D, Hopkins S, Shaw LP, Stoesser N.Flanker: a tool for comparative genomics of gene flanking

regions.BioRxiv. 2021. doi: https://doi.org/10.1101/2021.02.22.432255

 

optional arguments:

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

  -g GENE [GENE ...], --gene GENE [GENE ...]

                        Gene(s) of interest (escape any special characters). Use space seperation for multipe genes (default: None)

  -log LIST_OF_GENES, --list_of_genes LIST_OF_GENES

                        Line separated file containing genes of interest (default: False)

  -cm, --closest_match  Find closest match to query (default: False)

  -f FLANK, --flank FLANK

                        Choose which side(s) of the gene to extract (upstream/downstream/both) (default: both)

  -m MODE, --mode MODE  One of "default" - normal mode, "mm" - multi-allelic cluster, or "sm" - salami-mode (default: default)

  -circ, --circ         Is sequence circularised (default: False)

  -inc, --include_gene  Include the gene of interest (default: False)

  -db DATABASE, --database DATABASE

                        Choose Abricate database e.g. NCBI, resfinder (default: ncbi)

  -v [VERBOSE], --verbose [VERBOSE]

                        Increase verbosity: 0 = only warnings, 1 = info, 2 = debug. No number means info. Default is no verbosity. (default: 0)

 

required arguments:

  -i FASTA_FILE, --fasta_file FASTA_FILE

                        Input fasta file (default: None)

 

window options:

  -w WINDOW, --window WINDOW

                        Length of flanking sequence/first window length (default: 1000)

  -wstop WINDOW_STOP, --window_stop WINDOW_STOP

                        Final window length (default: None)

  -wstep WINDOW_STEP, --window_step WINDOW_STEP

                        Step in window sequence (default: None)

 

clustering options:

  -cl, --cluster        Turn on clustering mode? (default: False)

  -o OUTFILE, --outfile OUTFILE

                        Prefix for the clustering file (default: out)

  -tr THRESHOLD, --threshold THRESHOLD

                        mash distance threshold for clustering (default: 0.001)

  -p THREADS, --threads THREADS

                        threads for mash to use (default: 1)

  -k KMER_LENGTH, --kmer_length KMER_LENGTH

                        kmer length for Mash (default: 21)

  -s SKETCH_SIZE, --sketch_size SKETCH_SIZE

                        sketch size for mash (default: 1000)

 

 

実行方法

1、使用する配列はあらかじめ連結しておく。

cat *fsa > seq.fasta

 

任意のステップ

FASTA ヘッダの名前を変更して、元のファイルと一致するようにする (まだ一致していない場合)。これを行うスクリプトが提供されている。実行すると、fastaのヘッダがファイル名と同じになる。multi-fastaは想定されていない。1つのファイルに2つ以上の配列を含むファイルを使わないこと。

ls *fsa | sed 's/[.]fsa//' > input_files
git clone https://github.com/wtmatlock/flanker.git
python flanker/scripts/multi_fa_rename.py seq.fasta input_files david_plasmids_renamed.fasta
mv david_plasmids_renamed.fasta david_plasmids.fasta

 

2、 周囲の配列の関心のある遺伝子と検出サイズ、そして検出の向き(上流か下流か両方か)を指定してflankerを実行する。例では、blaKPC-2遺伝子の上流 (-f upstream) 方向について、 100bp単位 (-wstep) で0bp (-w) から 5000bp (-wstop) まで抽出して比較している。また、blaKPC-2遺伝子自身も含んでいる(--include_gene)。

flanker -f upstream -w 0 -wstop 5000 -wstep 100 -g blaKPC-2 -i seq.fasta --include_gene
  •  -f   Choose which side(s) of the gene to extract (upstream/downstream/both) (default: both)
  • -w   Length of flanking sequence/first window length (default: 1000)
  • -wstop   Final window length (default: None)
  • -wstep   Step in window sequence (default: None)
  • -g    Gene(s) of interest (escape any special characters). Use space seperation for multipe genes (default: None)
  • -i    Input fasta file (default: None)
  • --include_gene   Include the gene of interest (default: False)
  • -log    Line separated file containing genes of interest (default: False)

出力例

f:id:kazumaxneo:20210301122517p:plain

 

Documentではより発展的な使い方についても解説されています。確認してください。

https://flanker.readthedocs.io/en/latest/

 

引用

Flanker: a tool for comparative genomics of gene flanking regions

William Matlock, Samuel Lipworth, Bede Constantinides, Timothy E.A. Peto, A. Sarah Walker, Derrick Crook, Susan Hopkins, Liam P. Shaw, Nicole Stoesser

bioRxiv, Posted February 22, 2021

 

追記
Flanker: a tool for comparative genomics of gene flanking regions
William Matlock 1, Samuel Lipworth 1 2, Bede Constantinides 1 3, Timothy E A Peto 1 2 3 4, A Sarah Walker 1 3 4, Derrick Crook 1 2 3 4, Susan Hopkins 5, Liam P Shaw 6, Nicole Stoesser 1 2 3

Microb Genom. 2021 Sep;7(9):000634. doi: 10.1099/mgen.0.000634.

 

関連