macでインフォマティクス

macでインフォマティクス

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

(ヒトゲノム)遺伝子の変異プロットを描く Lollipops

2020 4/22 重複した説明を削除

 

 簡潔な可視化は、大量の情報を最小限のスペースで迅速に解釈できるよう提示するために非常に重要である。精密医療における臨床応用は、解釈の時間依存性のため、重要な使用例となっているが、生命科学の分野では可視化の必要性が高まっている。この論文では、パネルシークエンシングやエクソームシークエンシングの結果を表示するためのLollipopsソフトウェアについて説明する。ソースコードとバイナリは https://github.com/pbnjay/lollipops で自由に入手できる。Lollipop Figureを作成するためのソフトウェアやウェブリソースは他にも存在するが、精密医療の要求は、ワークフローに簡単に適合し、手動で介入することなく外部情報を取り込む能力を必要とし、これらのパッケージは臨床応用にはあまり適していない。

 Lollipopソフトウェアは、公式の遺伝子記号と突然変異リストのみ必要とするシンプルなコマンドラインインターフェースを提供し、簡単にスクリプト化することができる。外部情報は、公開されているUniprotとPfamのリソースを使用して統合されている。ヒューリスティックは、最も情報量の多い成分を選択し、簡潔なプロットを出力する。結果は柔軟性のあるScalable Vector Graphic (SVG)ダイアグラムで、Webページやグラフィックイラストレーションツールで表示することができる。

 自動データフェッチャーは、非技術的なユーザーにとってツールの使いやすさの重要な部分である。識別子のトランスレーションとそれに続くタンパク質ドメインの検索という2つのフェーズで動作する。まず、HGNC Gene Symbol(唯一の必須パラメータ)を取得し、Uniprot REST APIに問い合わせて、一致するUniprot/SwissProt Accessionを返す。その後、フェッチされたアクセッションを使用して、PfamグラフィックドメインREST APIエンドポイントにクエリを行う。Pfamレスポンスデータには、キュレーションされたPfam-Aドメイン、関心のある領域(シグナルペプチド、膜貫通ドメインなど)、およびコイルドコイル、無秩序領域、低複雑性領域などの構造的に興味深い予測領域のための有用なアノテーションが含まれている。この情報は抽出され、データハイライターとプレゼンテーション手法に渡される。データハイライターは、複雑な情報を視覚的に解釈しやすくするための簡単なテクニックを網羅している。(以下略)

 

インストール

リリースからmacos向けのバイナリをダウンロードしてテストした。

> ./lollipops

$ ./lollipops 

Usage: ./lollipops [options] {-Q UNIPROT_DB IDENTIFER | -U UNIPROT_ID | GENE_SYMBOL} [PROTEIN CHANGES ...]

 

Protein ID input:

  GENE_SYMBOL is the official human HGNC gene symbol. This will use the

  UniprotKB API to lookup the UNIPROT_ID.

 

  You can provide a UniProt ID directly with -U (e.g. "-U P04637" for TP53)

 

  For more advanced usage, query UniprotKB's database mappings directly using

  a supported identifier with -Q DBNAME. Available DBNAMEs can be found here:

     http://www.uniprot.org/help/programmatic_access#id_mapping_examples

 

     RefSeq ID        e.g. -Q P_REFSEQ_AC NP_001265252.1

     Entrez GeneID    e.g. -Q P_ENTREZGENEID 4336

     Ensembl ID       e.g. -Q ENSEMBL_ID ENSG00000168314

 

Protein changes:

  Currently only point mutations are supported, and may be specified as:

 

    <AMINO><CODON><AMINO><#COLOR><@COUNT>

 

  Only CODON is required, and AMINO tags are not parsed.

 

  Synonymous mutations are denoted if the first AMINO tag matches the second

  AMINO tag, or if the second tag is not present. Otherwise the non-synonymous

  mutation color is used. The COLOR tag will override using the #RRGGBB style

  provided. The COUNT tag can be used to scale the lollipop marker size so that

  the area is exponentially proportional to the count indicated. Examples:

 

    R273C            -- non-synonymous mutation at codon 273

    T125@5           -- synonymous mutation at codon 125 with "5x" marker sizing

    R248Q#00ff00     -- green lollipop at codon 248

    R248Q#00ff00@131 -- green lollipop at codon 248 with "131x" marker sizing

 

  (N.B. color must come before count in tags)

 

Diagram generation options:

  -legend                 draw a legend for colored regions

  -syn-color="#0000ff"    color to use for synonymous mutation markers

  -mut-color="#ff0000"    color to use for non-synonymous mutation markers

  -hide-axis              do not draw the amino position x-axis

  -show-disordered        draw disordered regions on the backbone

  -show-motifs            draw simple motif regions

  -labels                 draw label text above lollipop markers

  -no-patterns            use solid fill instead of patterns (SVG only)

  -domain-labels=fit      hot to apply domain labels (default="truncated")

                            "fit" = only if fits in space available

                            "off" = do not draw text in the domains

 

Output options:

  -o=filename.png         set output filename (.png or .svg supported)

  -w=700                  set diagram pixel width (default = automatic fit)

  -dpi=300                set DPI (PNG output only)

 

Alternative input sources:

  -uniprot                use UniprotKB as an alternative to Pfam for

                          fetching domain/motif information

  -l=filename.json        use local file instead of Pfam API for graphic data

                            see: http://pfam.xfam.org/help#tabview=tab9

パスの通ったディレクトリに移動しておく。

 

 

実行方法

動作時はネットに繋がっている必要がある。

 

与える遺伝子名はHGNC(human gene nomenclature)の命名法に従う一意な遺伝子名になる。TP53遺伝子のバリアントR273C R175H T125 R248Qを表示。

lollipops TP53 R273C R175H T125 R248Q

出力

f:id:kazumaxneo:20200421195341p:plain

 

バリアントの上にラベルを付ける。またレジェンドを表示する。

lollipops -legend -labels TP53 R273C R175H T125 R248Q
  • -legend   draw a legend for colored regions
  • -labels     draw label text above lollipop markers

f:id:kazumaxneo:20200421204729p:plain

  

 

デフォルトでは同義置換は青(上のT125など)、非同義置換(上のR273Cなど)は赤になっている。色は16進数カラーコードで指定する事で変更できる。またシンボルの大きさも変更できる。

R248Qは#7f3333で(=> R248Q#7f3333)、R273Cは5倍の大きさで表示する(=> R273C@5)。

lollipops -legend -labels TP53 R248Q#7f3333 R273C@5

 

f:id:kazumaxneo:20200421210844p:plain

引用
Lollipops in the Clinic: Information Dense Mutation Plots for Precision Medicine.

Jay JJ, Brouwer C

PLoS One. 2016 Aug 4;11(8)

 

参考


 

関連


バリアントコールのVCFを可視化する VIVA

 

 次世代シーケンシングにより、膨大な量のゲノムデータが生成される。ゲノム情報の量は、研究によって異なる。バリアント検出プロセスでは、さまざまな種類のファイル形式が生成される。シーケンス解析で一般的に使用されるファイル形式の1つは、バリアントコールフォーマット(VCF)である。これは、バリアントコールプロセスで生成されるテキストファイル形式で、ゲノム内のバリアントの位置に関する情報が含まれている。この構造には、各ゲノム位置のサンプルの遺伝子型やリードデプスデータなどのバリアント情報が含まれる。リードデプスは、各患者の各バリアント位置でのシーケンスカバレッジの測定値である。VCFファイルには、メタ情報の行、サンプルIDを含むヘッダー、特定のバリアントのゲノム位置のデータ行が含まれる。研究者や臨床医が次世代のシーケンシングにアクセスしやすくなるため、VCFファイルからゲノムデータを簡単に取得して視覚化する機能が必要である。これは、トランスレーショナル医療および個別化医療に有益となる。

 VCFファイルからのデータの解釈には、いくつかの課題がある。多くの場合、ファイルサイズは非常に大きいため、VCFファイルを処理する機能は計算リソースによって制限される。メモリ効率の良いデータ取得を容易にするために、既存のVCFファイル解析および視覚化ツールでは、ユーザーがVCFファイルを前処理する必要がある。これには、VCFToolsなどの外部プログラムでファイルをサブセット化する前、またはTabix2でファイルのインデックスを作成する前に、ゲノム位置によってVCFファイルを圧縮およびソートする必要がある。さらに、VCFデータ構造は密度が高く、その生データ形式で解釈するのが難しく、洞察を引き出すためにデータクエリが必要である。効率的な解釈とデータ共有を促進するために、使いやすいVCFファイル解析および視覚化ツールが必要である。

 VCFファイルからのシーケンス実験のバリアント分析と品質管理のためにゲノムデータを評価および共有するためのコマンドラインユーティリティおよびJupyter Notebookベースのツール“Visualization of Variants” (VIVA)を紹介する。 VIVAは、vcfR、IGV5、Genome Browser、Genome Savant、svviz、jvarkit – JfxNgsなどの既存の類似ツールと比較して、柔軟性、効率性、使いやすさを提供する。 VIVAの際立った機能は次のとおりである。(1)VCFファイルの前処理(圧縮、並べ替え、またはインデックス作成を含む)が不要、 (2)サンプルメタデータによってデータを並べ替え、視覚化する機能、 (3)コーディングが不要、 (4)さまざまなpubliation品質の出力形式、(5)リアルタイムのデータ探索と共有のためのインタラクティブHTML5出力、 そして(6)ヒートマップデータをテキストファイルマトリックスとしてエクスポートし、他のツールを使用して分析する。

 これを実現するために、VIVAは数値計算用の高レベルで高性能な動的プログラミング言語であるjuliaプログラミング言語を採用している。juliaは、ジュリアプログラミング言語で書かれたこの種の最初のツールであり、生物学者および生物情報学者向けのjulia言語コミュニティであるBioJuliaがホストする他のツールとワークフローに統合できる。

VIVAを使用するには、論文図1に示す3つの主要な手順が必要である。

(1)入力ファイルを送信し、必要に応じてフィルタリングオプションを選択する。

(2)VIVAはVCFファイルを読み取り、データを処理する。

(3)VIVAはグラフを作成し、出力ファイルをエクスポートする。

(複数段落省略)

VIVAは複数の視覚化オプションをサポートしている。これらには、遺伝子型のヒートマップや、列のサンプルと行のバリアント位置を含むリードデプスデータが含まれる。遺伝子型ヒートマップは、遺伝子型の値を表示するカテゴリヒートマップである。ホモ接合リファレンス、ヘテロ接合バリアント、ホモ接合バリアント、または選択したすべてのサンプルとバリアントのコールなし。リードデプスヒートマップは、0〜100の連続リードデプス値のプロット、またはコール無しである。 「コール無し」は、この時点までのVCF生成中にデータ品質が低かったことを示している。 100を超えるリードデプスの外れ値は、視覚化で低いリードデプス値の解像度が失われないように制限される。リードデプスの上限である100が選択されたのは、ほとんどの目的で、30 +のリードデプス値がバリアント分析に含めるのに十分であるためである。 VIVAは、サンプルまたはバリアント位置全体の平均リードデプスの散布図も生成できる。ユーザーはこれらを使用して、論文図2に示すように、シーケンスが困難な領域にあるサンプルやバリアントの問題を特定できる。さらに、外部の分析のために、代表的な遺伝子型値または連続リードデプス値のラベル付きデータマトリックスを保存することを選択できる。

 

 

インストール

ubuntu18.04のJulia 1.2.0でテストした。

依存

  • #julia

juliaはHPの指示に従って導入する。

本体 Github

#インストールは以下のコマンドを実行するだけ(fetchしてビルドされる)。
julia
]add VarianatVisualization
exit()

>viva -h

usage: viva -f VCF_FILE [-o OUTPUT_DIRECTORY] [-s SAVE_FORMAT]

            [-r GENOMIC_RANGE] [-p] [-l POSITIONS_LIST]

            [-g GROUP_SAMPLES GROUP_SAMPLES]

            [--select_samples SELECT_SAMPLES] [-m HEATMAP]

            [-y Y_AXIS_LABELS] [-x] [-n] [-t HEATMAP_TITLE]

            [--avg_dp AVG_DP] [--save_remotely] [-h]

 

VIVA VCF Visualization Tool is a tool for creating publication quality

plots of data contained within VCF files. For a complete description

of features with examples read the docs here

https://github.com/compbiocore/VariantVisualization.jl

 

optional arguments:

  -f, --vcf_file VCF_FILE

                        vcf filename in format: file.vcf

  -o, --output_directory OUTPUT_DIRECTORY

                        function checks if directory exists and saves

                        there, if not creates and saves here (default:

                        "output")

  -s, --save_format SAVE_FORMAT

                        file format you wish to save graphics as (eg.

                        pdf, html, png). Defaults to html (default:

                        "html")

  -r, --genomic_range GENOMIC_RANGE

                        select rows within a given chromosome range.

                        Provide chromosome range after this flag in

                        format chr4:20000000-30000000.

  -p, --pass_filter     select rows with PASS in the FILTER field.

  -l, --positions_list POSITIONS_LIST

                        select variants matching list of chromosomal

                        positions. Provide filename of text file

                        formatted with two columns in csv format:

                        1,2000345.

  -g, --group_samples GROUP_SAMPLES GROUP_SAMPLES

                        group samples by common trait using user

                        generated matrix key of traits and sample

                        names following format guidelines in

                        documentation. Provide file name of .csv file

  --select_samples SELECT_SAMPLES

                        select samples to include in visualization by

                        providing tab delimited list of sample names

                        (eg. samplenames.txt). Works for heatmap

                        visualizations and numeric array generation

                        only (not average dp plots)

  -m, --heatmap HEATMAP

                        genotype field to visualize (eg. genotype,

                        read_depth, or 'genotype,read_depth' to

                        visualize each separately) (default:

                        "genotype,read_depth")

  -y, --y_axis_labels Y_AXIS_LABELS

                        specify whether to label y-axis with all

                        chromosome positions (options = positions /

                        chromosome) separators. Defaults to chromosome

                        separators. (default: "chromosomes")

  -x, --x_axis_labels   flag to specify whether to label x-axis with

                        sample ids from vcf file. Defaults to FALSE.

  -n, --num_array       flag to save numeric array of categorical

                        genotype values or read depth values before

                        heatmap plotting. Must be used with --heatmap

                        set.

  -t, --heatmap_title HEATMAP_TITLE

                        Specify filename for heatmap with underscores

                        for spaces.

  --avg_dp AVG_DP       visualize average read depths as line chart.

                        Options: average sample read depth, average

                        variant read depth, or both. eg. =sample,

                        =variant, =sample,variant

  --save_remotely       Save html support files online rather than

                        locally so files can be shared between

                        systems. Files saved in this way require

                        internet access to open.

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

 

Thank you for using VIVA. Please submit any bugs to

https://github.com/compbiocore/VariantVisualization.jl/issues

 

 一部のコンポーネントが正しく導入されない。 

 

実行方法

VCFを指定する。

viva -f filename.vcf -s html -o output_dir

 

導入に成功したら追記します。 

 

依存
VIVA (VIsualization of VAriants): A VCF File Visualization Tool
G. A. Tollefson, J. Schuster, F. Gelin, A. Agudelo, A. Ragavendran, I. Restrepo, P. Stey, J. Padbury, and A. Uzun

Sci Rep. 2019; 9: 12648. Published online 2019 Sep 2.

 

メタゲノムの機能プロファイリングを行う HUMAnN2

2020 4/19 流れを修正

2020 4/21 biom出力とh5pyインストール追記

2020 ステップ2のコマンド修正

 

 

  微生物群集の機能プロファイルは、通常、包括的なメタゲノムやメタトランスクリプトーム配列の検索を用いて作成されるが、これらの検索は時間がかかり、偽のマッピングが発生しやすく、多くの場合、群集レベルでの定量化には限界がある。著者らは、HUMAnN2を開発した。HUMAnN2は、宿主関連コミュニティと環境コミュニティの高速、正確、種分解機能プロファイリングを可能にする階層化された検索戦略である。HUMAnN2は、コミュニティの既知の種を同定し、そのパンゲノムにリードをアラインメントし、分類されていないリードの翻訳検索を行い、最終的に遺伝子ファミリーとパスウェイを定量化する。純粋な翻訳検索と比較して、HUMAnN2は高速で、より正確な遺伝子ファミリープロファイルを生成する。海洋の代謝における連鎖的変動、ヒト微生物パスウェイ間の生態学的貢献パターン、種のゲノム対転写の変動、株のプロファイリングを研究するためにHUMAnN2を適用した。さらに、異なる微生物群集タイプにまたがる生態学的コミュニティのパターンを説明するために「contributional diversity」を導入する。

 

 HUMAnN 2.0は、メタゲノムまたはメタトランスクリプトームシーケンシングデータから、効率的かつ正確にコミュニティ内の微生物パスウェイの豊富さをプロファイリングするためのパイプラインである。このプロセスは機能プロファイリングと呼ばれ、微生物群集とそのメンバーの代謝ポテンシャルを記述することを目的としている。一般的に機能的プロファイリングは、「私の関心のあるコミュニティの微生物は何をしているのか」という質問に答えるものである。

f:id:kazumaxneo:20200419230824p:plain

HUMAnN2の流れ。HPより転載。

詳細は論文のONLINE METHODSセクションを読んでください。

 

huttenhower Lab HP

https://huttenhower.sph.harvard.edu

humann2 HP

https://huttenhower.sph.harvard.edu/humann 

Tutorial

https://bitbucket.org/biobakery/biobakery/wiki/humann2 

インストール

condaでpython2.7環境を作って導入したがテストでエラーを吐いた(macos10.14)。公式dockerイメージを使ってテストした。

依存

  • MetaPhlAn 2.0
  • Bowtie2 (version >= 2.1) (see NOTE)
  • Diamond (0.9.0 > version >= 0.8.22) (see NOTE)
  • MinPath (see NOTE)
  • Python (version >= 2.7)
  • Memory (>= 16 GB)
  • Disk space (>= 10 GB [to accommodate comprehensive sequence databases])
  • Operating system (Linux or Mac)
#bioconda (link) 依存が多いため仮想環境が望ましい
conda create -n humann2 -y python=2.7
conda activate humann2
conda install -c bioconda -y humann2
#biom出力するならh5pyも必要
conda install -c anaconda -y h5py

#ツールの互換性の問題であえて古いバージョンを入れる
conda create -n humann2_0.9.9 -y python=2.7
conda activate humann2_0.9.9

conda install -c bioconda -y humann2==0.9.9

#公式docker image (
dockerhub)
docker pull biobakery/humann2:2.8.2_cloud
#run
docker run -itv $PWD:/data/ biobakery/humann2:2.8.2_cloud
#biom出力するならh5pyも必要
pip
install h5py 

humann2 -h

$ humann2 -h

usage: humann2 [-h] [--version] [-v] [-r] [--bypass-prescreen]

               [--bypass-nucleotide-index] [--bypass-translated-search]

               [--bypass-nucleotide-search] -i <input.fastq> -o <output>

               [--nucleotide-database <nucleotide_database>]

               [--annotation-gene-index <8>]

               [--protein-database <protein_database>] [--evalue <1.0>]

               [--search-mode {uniref50,uniref90}] [--metaphlan <metaphlan>]

               [--metaphlan-options <metaphlan_options>]

               [--o-log <sample.log>]

               [--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}]

               [--remove-temp-output] [--threads <1>]

               [--prescreen-threshold <0.01>] [--identity-threshold <50.0>]

               [--translated-subject-coverage-threshold <50.0>]

               [--translated-query-coverage-threshold <90.0>]

               [--bowtie2 <bowtie2>] [--usearch <usearch>]

               [--rapsearch <rapsearch>] [--diamond <diamond>]

               [--taxonomic-profile <taxonomic_profile.tsv>]

               [--id-mapping <id_mapping.tsv>]

               [--translated-alignment {usearch,rapsearch,diamond}]

               [--xipe {on,off}] [--minpath {on,off}] [--pick-frames {on,off}]

               [--gap-fill {on,off}] [--output-format {tsv,biom}]

               [--output-max-decimals <10>] [--output-basename <sample_name>]

               [--remove-stratified-output]

               [--remove-column-description-output]

               [--input-format {fastq,fastq.gz,fasta,fasta.gz,sam,bam,blastm8,genetable,biom}]

               [--pathways-database <pathways_database.tsv>]

               [--pathways {metacyc,unipathway}]

               [--memory-use {minimum,maximum}]

 

HUMAnN2 : HMP Unified Metabolic Analysis Network 2

 

optional arguments:

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

  --version             show program's version number and exit

  -v, --verbose         additional output is printed

  -r, --resume          bypass commands if the output files exist

  --bypass-prescreen    bypass the prescreen step and run on the full ChocoPhlAn database

  --bypass-nucleotide-index

                        bypass the nucleotide index step and run on the indexed ChocoPhlAn database

  --bypass-translated-search

                        bypass the translated search step

  --bypass-nucleotide-search

                        bypass the nucleotide search steps

  -i <input.fastq>, --input <input.fastq>

                        input file of type {fastq,fastq.gz,fasta,fasta.gz,sam,bam,blastm8,genetable,biom} 

                        [REQUIRED]

  -o <output>, --output <output>

                        directory to write output files

                        [REQUIRED]

  --nucleotide-database <nucleotide_database>

                        directory containing the nucleotide database

                        [DEFAULT: /Users/kazu/anaconda3/envs/metaphylan2/lib/python2.7/site-packages/humann2/data/chocophlan_DEMO]

  --annotation-gene-index <8>

                        the index of the gene in the sequence annotation

                        [DEFAULT: 8]

  --protein-database <protein_database>

                        directory containing the protein database

                        [DEFAULT: /Users/kazu/anaconda3/envs/metaphylan2/lib/python2.7/site-packages/humann2/data/uniref_DEMO]

  --evalue <1.0>        the evalue threshold to use with the translated search

                        [DEFAULT: 1.0]

  --search-mode {uniref50,uniref90}

                        search for uniref50 or uniref90 gene families

                        [DEFAULT: based on translated database selected]

  --metaphlan <metaphlan>

                        directory containing the MetaPhlAn software

                        [DEFAULT: $PATH]

  --metaphlan-options <metaphlan_options>

                        options to be provided to the MetaPhlAn software

                        [DEFAULT: "-t rel_ab"]

  --o-log <sample.log>  log file

                        [DEFAULT: temp/sample.log]

  --log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}

                        level of messages to display in log

                        [DEFAULT: DEBUG]

  --remove-temp-output  remove temp output files

                        [DEFAULT: temp files are not removed]

  --threads <1>         number of threads/processes

                        [DEFAULT: 1]

  --prescreen-threshold <0.01>

                        minimum percentage of reads matching a species

                        [DEFAULT: 0.01]

  --identity-threshold <50.0>

                        identity threshold for alignments

                        [DEFAULT: 50.0]

  --translated-subject-coverage-threshold <50.0>

                        subject coverage threshold for translated alignments

                        [DEFAULT: 50.0]

  --translated-query-coverage-threshold <90.0>

                        query coverage threshold for translated alignments

                        [DEFAULT: 90.0]

  --bowtie2 <bowtie2>   directory containing the bowtie2 executable

                        [DEFAULT: $PATH]

  --usearch <usearch>   directory containing the usearch executable

                        [DEFAULT: $PATH]

  --rapsearch <rapsearch>

                        directory containing the rapsearch executable

                        [DEFAULT: $PATH]

  --diamond <diamond>   directory containing the diamond executable

                        [DEFAULT: $PATH]

  --taxonomic-profile <taxonomic_profile.tsv>

                        a taxonomic profile (the output file created by metaphlan)

                        [DEFAULT: file will be created]

  --id-mapping <id_mapping.tsv>

                        id mapping file for alignments

                        [DEFAULT: alignment reference used]

  --translated-alignment {usearch,rapsearch,diamond}

                        software to use for translated alignment

                        [DEFAULT: diamond]

  --xipe {on,off}       turn on/off the xipe computation

                        [DEFAULT: off]

  --minpath {on,off}    turn on/off the minpath computation

                        [DEFAULT: on]

  --pick-frames {on,off}

                        turn on/off the pick_frames computation

                        [DEFAULT: off]

  --gap-fill {on,off}   turn on/off the gap fill computation

                        [DEFAULT: on]

  --output-format {tsv,biom}

                        the format of the output files

                        [DEFAULT: tsv]

  --output-max-decimals <10>

                        the number of decimals to output

                        [DEFAULT: 10]

  --output-basename <sample_name>

                        the basename for the output files

                        [DEFAULT: input file basename]

  --remove-stratified-output

                        remove stratification from output

                        [DEFAULT: output is stratified]

  --remove-column-description-output

                        remove the description in the output column

                        [DEFAULT: output column includes description]

  --input-format {fastq,fastq.gz,fasta,fasta.gz,sam,bam,blastm8,genetable,biom}

                        the format of the input file

                        [DEFAULT: format identified by software]

  --pathways-database <pathways_database.tsv>

                        mapping file (or files, at most two in a comma-delimited list) to use for pathway computations

                        [DEFAULT: metacyc database ]

  --pathways {metacyc,unipathway}

                        the database to use for pathway computations

                        [DEFAULT: metacyc]

  --memory-use {minimum,maximum}

                        the amount of memory to use

                        [DEFAULT: minimum]

humann2_databases -h

# humann2_databases -h

usage: humann2_databases [-h] [--available]

                         [--download <database> <build> <install_location>]

                         [--update-config {yes,no}]

                         [--database-location DATABASE_LOCATION]

 

HUMAnN2 Databases

 

optional arguments:

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

  --available           print the available databases

  --download <database> <build> <install_location>

                        download the selected database to the install location

  --update-config {yes,no}

                        update the config file to set the new database as the default [DEFAULT: yes]

  --database-location DATABASE_LOCATION

                        location (local or remote) to pull the database

humann2_rename_table -h

# humann2_rename_table -h

usage: humann2_rename_table [-h] [-i INPUT]

                            [-n {pfam,eggnog,metacyc-pwy,ec,metacyc-rxn,go,kegg-pathway,kegg-module,kegg-orthology,infogo1000}]

                            [-c CUSTOM] [-s] [-o OUTPUT]

 

HUMAnN2 utility for renaming table features

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

 

For additional name mapping files, run the following command:

$ humann2_databases --download utility_mapping full $DIR

Replacing, $DIR with the directory to download and install the databases.

 

optional arguments:

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

  -i INPUT, --input INPUT

                        Original output table (tsv or biom format); default=[TSV/STDIN]

  -n {pfam,eggnog,metacyc-pwy,ec,metacyc-rxn,go,kegg-pathway,kegg-module,kegg-orthology,infogo1000}, --names {pfam,eggnog,metacyc-pwy,ec,metacyc-rxn,go,kegg-pathway,kegg-module,kegg-orthology,infogo1000}

                        Table features that can be renamed with included data files

  -c CUSTOM, --custom CUSTOM

                        Custom mapping of feature IDs to full names (.tsv or .tsv.gz)

  -s, --simplify        Remove non-alphanumeric characters from names

  -o OUTPUT, --output OUTPUT

                        Path for modified output table; default=[STDOUT]

humann2_renorm_table -h

# humann2_renorm_table -h

usage: humann2_renorm_table [-h] [-i INPUT] [-u {cpm,relab}]

                            [-m {community,levelwise}] [-s {y,n}] [-p]

                            [-o OUTPUT]

 

HUMAnN2 utility for renormalizing TSV files

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

Each level of a stratified table will be 

normalized using the desired scheme.

 

optional arguments:

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

  -i INPUT, --input INPUT

                        Original output table (tsv or biom format); default=[TSV/STDIN]

  -u {cpm,relab}, --units {cpm,relab}

                        Normalization scheme: copies per million [cpm], relative abundance [relab]; default=[cpm]

  -m {community,levelwise}, --mode {community,levelwise}

                        Normalize all levels by [community] total or [levelwise] totals; default=[community]

  -s {y,n}, --special {y,n}

                        Include the special features UNMAPPED, UNINTEGRATED, and UNGROUPED; default=[y]

  -p, --update-snames   Update '-RPK' in sample names to appropriate suffix; default=off

  -o OUTPUT, --output OUTPUT

                        Path for modified output table; default=[STDOUT]

 > humann2_join_tables -h

# humann2_join_tables -h

usage: humann2_join_tables [-h] [-v] -i INPUT -o OUTPUT

                           [--file_name FILE_NAME] [-s]

 

Join gene, pathway, or taxonomy tables

 

optional arguments:

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

  -v, --verbose         additional output is printed

  -i INPUT, --input INPUT

                        the directory of tables

  -o OUTPUT, --output OUTPUT

                        the table to write

  --file_name FILE_NAME

                        only join tables with this string included in the file name

  -s, --search-subdirectories

                        search sub-directories of input folder for files

humann2_barplot -h

 humann2_barplot 

usage: humann2_barplot [-h] -i <input table> [-f <feature id>] [-t <int>]

                       [-s <sorting methods> [<sorting methods> ...]]

                       [-l <feature>] [-m <feature>] [-c <colormap>]

                       [-k <colormap>] [-x] [-o <file.ext>] [-a <choice>] [-g]

                       [-r] [-z] [-w <int>] [-d <size> <size>]

                       [-y <limit> <limit>] [-e]

humann2_barplot: error: argument -i/--input is required

(metaphylan2) kamisakakazumanoMac-mini:human-unmap kazu$ humann2_barplot -h

usage: humann2_barplot [-h] -i <input table> [-f <feature id>] [-t <int>]

                       [-s <sorting methods> [<sorting methods> ...]]

                       [-l <feature>] [-m <feature>] [-c <colormap>]

                       [-k <colormap>] [-x] [-o <file.ext>] [-a <choice>] [-g]

                       [-r] [-z] [-w <int>] [-d <size> <size>]

                       [-y <limit> <limit>] [-e]

 

HUMAnN2 plotting tool

 

optional arguments:

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

  -i <input table>, --input <input table>

                        HUMAnN2 table with optional metadata

  -f <feature id>, --focal-feature <feature id>

                        Feature ID of interest (give ID not full name)

  -t <int>, --top-strata <int>

                        Number of top stratifications to highlight (top = highest grand means)

  -s <sorting methods> [<sorting methods> ...], --sort <sorting methods> [<sorting methods> ...]

                        Sample sorting methods (can use more than one; will evaluate in order)

                        

                        none        : Default

                        sum         : Sum of stratified values

                        dominant    : Value of the most dominant stratification

                        similarity  : Bray-Curtis agreement of relative stratifications

                        usimilarity : Bray-Curtis agreement of raw stratifications

                        metadata    : Given metadata label

                        

  -l <feature>, --last-metadatum <feature>

                        Indicate end of metadata rows

  -m <feature>, --focal-metadatum <feature>

                        Indicate metadatum to highlight / group by

  -c <colormap>, --colormap <colormap>

                        Color space for stratifications

  -k <colormap>, --meta-colormap <colormap>

                        Color space for metadata levels

  -x, --exclude-unclassified

                        Do not include the 'unclassified' stratum

  -o <file.ext>, --output <file.ext>

                        Where to save the figure

  -a <choice>, --scaling <choice>

                        Scaling options for total bar heights (strata are always proportional to height)

                        

                        none        : Default

                        pseudolog   : Total bar heights log-scaled (strata are NOT log scaled)

                        normalize   : Bars all have height=1 (highlighting relative attribution)

                        

  -g, --as-genera       Collapse species to genera

  -r, --grid            Add y-axis grid

  -z, --remove-zeroes   Do not plot samples with zero sum for this feature

  -w <int>, --width <int>

                        Relative width of the plot vs. legend (default: 5)

  -d <size> <size>, --dimensions <size> <size>

                        Image height and width in inches (default: 8 4)

  -y <limit> <limit>, --ylims <limit> <limit>

                        Fix limits for y-axis

  -e , --legend-stretch 

                        Stretch/compress legend elements

 conda install -c bioconda -y humann2==0.9.9

> humann2_rename_table -h

# humann2_rename_table -h

usage: humann2_rename_table [-h] [-i INPUT]

                            [-n {infogo1000,metacyc-rxn,uniref90,kegg-module,ec,go,metacyc-pwy,pfam,eggnog,uniref50,kegg-pathway,kegg-orthology}]

                            [-c CUSTOM] [-s] [-o OUTPUT]

 

HUMAnN2 utility for renaming table features

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

 

optional arguments:

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

  -i INPUT, --input INPUT

                        Original output table (tsv or biom format); default=[TSV/STDIN]

  -n {infogo1000,metacyc-rxn,uniref90,kegg-module,ec,go,metacyc-pwy,pfam,eggnog,uniref50,kegg-pathway,kegg-orthology}, --names {infogo1000,metacyc-rxn,uniref90,kegg-module,ec,go,metacyc-pwy,pfam,eggnog,uniref50,kegg-pathway,kegg-orthology}

                        Table features that can be renamed with included data files

  -c CUSTOM, --custom CUSTOM

                        Custom mapping of feature IDs to full names (.tsv or .tsv.gz)

  -s, --simplify        Remove non-alphanumeric characters from names

  -o OUTPUT, --output OUTPUT

                        Path for modified output table; default=[STDOUT]

 

 

動作チェック

humann2_test

#run also tool tests
humann2_test --run-functional-tests-end-to-end

 

データベースの準備

#現在ダウンロード可能なデータベースの確認
humann2_databases --available

#ChocoPhlAn database
(5.6GB)
humann2_databases --download chocophlan full <path>/<to>/database_dir

#UniRef database (only download one of 1-4)
#1,UniRef90 EC filtered (推奨,846 MB)
humann2_databases --download uniref uniref90_ec_filtered_diamond <path>/<to>/database_dir
#2,full UniRef90 (11 GB)
humann2_databases --download uniref uniref90_diamond <path>/<to>/database_dir
#3,UniRef50 EC filtered (239 MB)
humann2_databases --download uniref uniref50_ec_filtered_diamond <path>/<to>/database_dir
#4,full UniRef50 (4.6 GB)
humann2_databases --download uniref uniref50_diamond <path>/<to>/database_dir

HUMAnN2におけるヌクレオチドレベルの検索は、種のパンゲノムコレクションを用いて行われ、このコレクションを "ChocoPhlAn "と呼ぶ(ChocoPhlAnの以前のバージョンはMetaRef46として発表された。HUMAnN2に組み込まれたChocoPhlAnのバージョンは、MetaPhlAn2とそのマーカーデータベースの基礎となっているものと同一である)。種のパンゲノムは、種のタンパク質コードの潜在的な可能性の非冗長な表現である。ある種のパンゲノムを構築するために、NCBI GenBankおよび/またはRefSeqから、その種の利用可能な単離ゲノムをすべてダウンロードし、関連するコーディング配列(CDSアノテーションと一緒にダウンロードされた。各単離ゲノムをPhyloPhlAnで解析し、分類学的に正しい配置を確認する。UCLUSTを用いて、与えられた種の高品質の単離株ゲノムから97%のヌクレオチド同一性ですべてのCDSクラスター化する。各クラスタから1つの代表的な(セントロイド)配列を保存した。これらのセントロイド配列は、種のパンゲノムを構成する。これらのステップはMetaPhlAn2開発の過程で行われた。ChocoPhlAnを機能プロファイリングに使用するために、著者らは各パンゲノムのセントロイド配列をUniRef90とUniRef50を使ってアノテーション付けた。(論文より) 

 

 

実行方法

1、fastq,(fastq.gz, fasta, or fasta.gz )、マッピングのsamかbam、遺伝子テーブルファイル(TSVかbiom) を指定する。

cat pair1.fq.gz pair2.fq.gz > paired.fq.gz
#またはseqtkでintaerlace.fqを作る
seqtk mergepe pair1.fq.gz pair2.fq.gz > interleaved.fq.gz

#run - tsv出力
humann2 -i paired.fq.gz –o out_dir --threads 12

#run - biom出力。h5pyがないと最後にエラーに吐くので注意。
humann2 -i paired.fq.gz –o out_dir --threads 12 --output-format biom

#databaseのパスを指定してランする
humann2 -i paired.fq.gz –o out_dir --threads 20 \
--nucleotide-database <path>/<to>/chocophlan \
--protein-database <path>/<to>/uniref90
  • -i <input.fastq>   input file of type {fastq,fastq.gz,fasta,fasta.gz, sam,bam,blastm8,genetable,biom}  [REQUIRED]
  • -o <output>   directory to write output files [REQUIRED]
  • --threads    number of threads/processes  [DEFAULT: 1]
  • --output-format {tsv, biom}   the format of the output files  [DEFAULT: tsv]
  • --remove-stratified-output     remove stratification from output  [DEFAULT: output is stratified]

 主要な3つのファイルが出力される。コミュニティ内の各遺伝子ファミリーの豊富さを表したSAMPLE_genefamilies.tsv、コミュニティ内の各パスウェイの豊富さを表したpathabundance.tsv、コミュニティ内の各パスウェイのカバー率を表したpathcoverage.tsvになる。 

 

option; ファイルサイズを減らすために、フィーチャ名はデフォルトでは出力に含まれない。フィーチャー名をアタッチするには、humann2_rename_table スクリプトを使う。

#version0.9.9
humann2_rename_table --input genefamilies.tsv --output genefamilies-names.tsv --names uniref90

#biom
#version0.9.9
humann2_rename_table --input genefamilies.biom --output genefamilies-names.biom --names uniref90
 

なぜかツールのバージョンによって対応するデータベースが異なってしまっている。例えばdockerイメージ;humann2:2.8.2_cloudではuniref90や50は利用できない。condaでインストールできる最新版はuniref50は利用できる。version0.9.9ならuniref90もuniref50も利用できる( インストールに導入方法は載せています)。 このリネームはステップ4の後に行ってもよい。

 

2、シーケンシングデプスの異なるサンプル間の比較を容易にするために、遺伝子ファミリーとパスウェイのアバンダンスRPK値を組成単位(100万あたりのコピーまたは相対abundance)に正規化する(パスウェイカバレッジは正規化する必要はない)。

#genefamilies abundanceファイルの場合
#tsv input
humann2_renorm_table --input ggenefamilies-names.tsv --output genefamilies-cpm.tsv --units cpm --update-snames

#biom input
humann2_renorm_table --input genefamilies-names.biom --output genefamilies-cpm.biom --units cpm --update-snames

#pathway abundanceファイルの場合
#tsv input
humann2_renorm_table --input pathabundance-name.tsv --output pathabundance-cpm.tsv --units cpm --update-snames
#biom input
humann2_renorm_table --input pathabundance-name..biom --output pathabundance-cpm.biom --units cpm --update-snames
  • --units {cpm, relab}   Normalization scheme: copies per million [cpm], 
  • --update-snames    Update '-RPK' in sample names to appropriate suffix; default=off
  • --output     Path for modified output table; default=[STDOUT]

 100万になるようにスケールされるため、元のファイルよりも大きくなる傾向がある。

 

3、複数の結果をマージする。2の出力の〜merged_genefamilies-cpm.tsvを1つのディレクトリに集め、そのディレクトリを指定する。以下はTSVだがbiomも同様。

#gene
humann2_join_tables -i input_dir -o genefamilies.tsv

 

4、RPKMに再び正規化

humann2_renorm_table -i genefamilies.tsv -o genefamilies_cpm.tsv --units cpm

 

5、1−4で同定した、豊富さが有意に異なるパスウェイのプロットを作成する。

#metadataがない場合
humann2_barplot --input genefamilies_cpm.tsv --output plot.png

 

追記 

 biom => TSV (biom-format)

biom convert -i genefamilies-cpm.biom -o genefamilies-cpm.tsv --to-tsv

 

最近Phylophlanが3になりましたが(ツイート)、 humannも3が開発中になっています。

=>しばらく経ってversion3が公開されました。

引用

Species-level functional profiling of metagenomes and metatranscriptomes

Eric A. Franzosa, Lauren J. McIver, Gholamali Rahnavard, Luke R. Thompson, Melanie Schirmer, George Weingart, Karen Schwarzberg Lipson, Rob Knight, J. Gregory Caporaso, Nicola Segata & Curtis Huttenhower
Nature Methods volume 15, pages962–968(2018)

 

参考


 関連


 

ガン変異のCoMut plotを出力する CoMutPlotter

 

 CoMut plotは、ガン研究のpublicationsで、ガンコホートにおける突然変異の分布を視覚的に要約したものとして広く使用されている。この要約プロットは、遺伝子変異率とサンプルの変異負担を関連する臨床的詳細とともに調べることができ、サンプル間の遺伝子変異の再発とco-occurrenceを分析するための一般的な最初のステップとなっている。cBioPortalとiCoMutは2つのウェブベースのツールで、ユーザーは事前にロードされたTCGAおよびICGCデータから複雑な可視化を作成することができる。カスタムデータ解析については、現在、限られたコマンドラインパッケージしか利用できないため、特に高度なバイオインフォマティクスのスキルを持たない研究者にとっては、CoMut plotの作成が困難な状況にある。そこで、カスタムデータやTCGA/ICGCデータ比較のニーズに対応するために、ウェブベースのツールであるCoMutPlotterを開発し、使いやすく自動で公開品質のグラフを作成することに成功した。

 複雑なガンゲノムデータと研究者間の垣根を低くするために、ウェブベースのツールCoMutPlotterを導入し、TCGA/ICGCプロジェクトやカスタムコホート研究からの変異プロファイルに直感的にアクセスできるようにした。CoMutPlotterは、ガンの突然変異プロファイルを生物学的洞察と臨床応用に変換するために、MAF、タブ区切りのTSVとVCFファイルを含む様々なファイルフォーマットをサポートしている

 要約すると、CoMutPlotterは、最も広く使われているファイル形式であるVCFファイルを入力としてサポートする、この種のツールの中で初めてのツールである。また、カスタムコホートとTCGA/ICGCプロジェクト間の突然変異パターンを比較するために最も必要とされる機能も提供している。また、個々のサンプルにおけるCOSMICの変異シグネチャの寄与もサマリープロットに含まれているのが本ツールの特徴である。CoMutPlotter はhttp://tardis.cgu.edu.tw/comutplotter から無料で入手できる。

 

Tutorial



webサービス

http://tardis.cgu.edu.tw/comutplotter/CoMutPlotter/ にアクセスする。

f:id:kazumaxneo:20200418192128p:plain

VCF、Mutation Annotation Format (GDC MAF)、タブ区切り値 (ICGC TSV) 、カスタムタブ区切りファイル(6フィールド必要なカラムが記載されている事(リンク))を入力に使用する。

 

ここでは上のリンクから入手できるデモデータを使う。

f:id:kazumaxneo:20200418194022p:plain

 

individualsのVCFファイルを含む .zipとindividualsのメタデータファイルをアップロードする。

f:id:kazumaxneo:20200418203726p:plain

 

VCF。zipで圧縮して指定する。

f:id:kazumaxneo:20200418194115p:plain

メタデータ

f:id:kazumaxneo:20200418194025p:plain

MAFを指定する場合、変換スクリプトリンク)が提供されている。ラージコホートの場合、これから変換してMAFをアップロードできる(チュートリアルより)。

 

出力(demo)

出力は3つのパネルからなる。それぞれ「CoMut Plot」パネル、「Cross-project comparison」パネル、「Download & Report Generation」パネルと呼ばれる。

f:id:kazumaxneo:20200418204010p:plain

 

一番上は、SNP、挿入、欠失などの翻訳効果で層別化したサンプルあたりの突然変異率。

f:id:kazumaxneo:20200418204705p:plain

 

サンプルのメタデータはヒートマップで表示される。

f:id:kazumaxneo:20200418204228p:plain

CoMutプロット中央には、異なる患者の多様な遺伝子変異を明らかにするために、カスタムコホートの突然変異プロファイルはが異なる色のヒートマップで表される。

f:id:kazumaxneo:20200418204913p:plain

 

MutSigCVによって同定された有意に変異した遺伝子は、CoMutプロットの左側に棒グラフとして表示される。

f:id:kazumaxneo:20200418204258p:plain

MutSigCVによってFDR (q) <=0.1で有意と判断された遺伝子が、遺伝子変異頻度に従って順序付けて表示されている。

 

CoMutプロットの下部には30のCOSMIC変異シグネチャの寄与がパーセンテージ表示される。

f:id:kazumaxneo:20200418204011p:plain

チュートリアルで説明されているが、左側のメニューから様々なフィルタリングを実行できる。結果はその場で反映される。

f:id:kazumaxneo:20200418205557p:plain

左下からDot Matrixを選択。

入力フォーマットや他の機能の詳細はチュートリアルで確認して下さい。

引用

CoMutPlotter: a web tool for visual summary of mutations in cancer cohorts

Po-Jung Huang, Hou-Hsien Lin, Chi-Ching Lee, Ling-Ya Chiu, Shao-Min Wu, Yuan-Ming Yeh, Petrus Tang, Cheng-Hsun Chiu, Ping-Chiang Lyu, Pei-Chien Tsai
BMC Medical Genomics volume 12, Article number: 99 (2019)

 

ビニングツール MetaBMF

2021 7/14 インストール手順追記

 

 メタゲノミクスは、ヒトの消化管などの生態系における微生物ゲノムを研究する。次世代シーケンシング技術を用いてシーケンスされた、異なる微生物種間の新規微生物種の同定およびそれらの分布変動の定量化は、ほとんどのメタゲノム研究の成功への鍵を握っている。これらの目的を達成するために、本著者らは単純で強力なメタゲノムビニング方法、MetaBMFを提案する。この方法は、リファレンスゲノムの予備知識を必要とせず、そして株レベルでさえも非常に正確な結果を生じる。したがって、それは広く研究されていない疾患関連微生物を同定するために広く使用され得る。
 数学的に、入力行列として異なるサンプルを交差させる各アセンブリされたゲノム断片上のマッピングされたリードの数を数え、この数行列をバイナリ行列と非負行列の積に因数分解するスケーラブルな層別角度回帰アルゴリズムを提案する。二元マトリックスは微生物種を分離するために使用することができ、そして非負行列は異なるサンプル中の種分布を定量化する。シミュレーションと実証研究でMetaBMFが高いビニング精度を持っていることを示す。MetaBMFは種レベルだけでなく株レベルでも正確にDNA断片を分類することができる。例に示すように、MetaBMFは2011年のドイツの大腸菌の集団発生につながった志賀毒素原性大腸菌O104:H4株を正確に同定することができる。これらの分野における著者らの努力は、(1)メタゲノムビニングの根本的な進歩、(2)微生物分布の迅速な同定および定量化のための技術の開発および改良(3)潜在的プロバイオティクスまたは信頼できる病原性細菌株の発見につながるはずである。

 

 

インストール

pyenvでminiconda2.4.0.5と3-4.3.27をactivateしてcondaで依存を導入してテストした(docker使用、ホストos ubuntu16.0.4)。

依存

  • Ray Assembler or MegaHIT Assembler (Users can also choose their preferred assemblers other than Ray and MegaHIT)
  • Bowtie2
  • Samtools
mamba create -n metabmf -y
conda activate metabmf
#ray
mamba install -c bioconda -c conda-forge -y ray
#megahit
mamba install -c bioconda -y megahit
#bowtie2, samtools
mamba install -c bioconda -y bowtie2 samtools

本体 Github

git clone https://github.com/didi10384/MetaBMF

bash ./MetaBMF/MetaBMF.sh -h

# bash MetaBMF/MetaBMF.sh -h

Usage:

    bash MetaBMF.sh [options] -c <contigs> -o <outdir> -p <reads-list>

Options:

-o      Output directory

-c      The path to the contigs fasta file

    -s      list of sample names for single-end reads

    -p      list of sample names for paired-ends reads

    -q      For fastq files

    -a      For fasta files

######## Options for binning

-n Number of threads: Specify the number of CPU cores used for parallel computing. When there is a large number of contigs, it is recommended to set multiple CPU cores to accelerate the computation. The default number is 1.

-l Specify the minimum number of clusters. The default is 2.

-u Specify the maximum number of clusters. The default is 0, which will let the algorithm sets the maximum number of cluster automatically.

-e Specify the increment of the number of clusters from bic_min to bic_max. The default is 1.

-t Specify the threshold for setting the initial value. It is recommended to set this number smaller(0.01-0.1) when the number of samples is less than -h0$ and larger (0.1-0.2) when the number of samples is larger than -h0$. The default value is set to 0.1.

-i Specify how many percent contigs are used to set the initial value of the algorithm. The default value is 1, which means that all the contigs is used to find initial value of the algorithm. The number can be set to a smaller one, when there are a very large number of contigs.

-r Specify the minimum contig length, contigs shorter than this value will not be included. Default is 500.

-c If the value is "T", output the plot of BIC scores. The default is "F".

-m The value is "1" for the simple metagenomic community. The value is "2" for the complex metagenomic community.

    -h  This help documentation.

 

 

 テストラン

1、テストデータのダウンロードとリストファイル作成

mkdir example
cd example
wget https://ndownloader.figshare.com/files/5523092
unzip 5523092

cd ./test_data
for f in *.fasta; do
g=$(echo $f |gawk '{gsub(/.*[/]|.fasta/, "", $0)} 1')
echo -e "$PWD/$g" >> read_list.txt
done

cd ..
mkdir metabmf_work

test_data

f:id:kazumaxneo:20210714195843p:plain

 

実行する。

bash MetaBMF/MetaBMF.sh -a -c ./test_data/ray/Contigs.fasta -o ./metabmf_work -s ./test_data/read_list.txt 

 

 

引用

MetaBMF: a scalable binning algorithm for large-scale reference-free metagenomic studies
Terry Ma, Di Xiao, Xin Xing
Bioinformatics, Volume 36, Issue 2, 15 January 2020, Pages 356–363

 

ShinyCNV(立ち上げだけ紹介)

 

 体細胞コピー数変化(CNV)は、ガンの開始、進行および再発において重要である(Caren et al、2010;Mullighan et al、2007;Mullighan et al、2009;Weir et al、2007)。ガンゲノム研究において、高密度一塩基多型(SNP)アレイは、従来の細胞遺伝学的カリオタイピングまたは蛍光in situハイブリダイゼーションアプローチと比較して、特に局所的なコピー数のゲインおよびロスについて、CNVを同定する上で、より系統的かつ感度の高いプラットフォームであることが証明されている(Mullighan et al、2007;Zhang et al、2016)。しかしながら、様々なCNV検出ソフトウェアから検出されたセグメントは、SNPデータの質の低さ、CNVの複雑さ、および/または十分に訓練されていないセグメンテーションアルゴリズムのために、偽陽性または不正確なブレークポイントを有することが多い。高品質の結果を保証するために、正規化されたSNPデータと報告されたCNVを比較するために、手動によるレビューが必要になる場合がある。いくつかのCNV解析ツールは、この視覚的な比較を可能にしているが(Li, 2008; Li et al)ここでは、外部ツールから報告されたCNV領域と正規化されたSNPデータ(IlluminaまたはAffymetrixプラットフォームのいずれか)を入力とし、ユーザーが信頼性の高いCNVを識別し、不正確なセグメント境界を簡単かつ直感的に調整するのを支援するインタラクティブなShiny/RアプリケーションであるShinyCNVを紹介する。

 ShinyCNVは、プログラミングの経験が浅い研究者でも、CNV解析結果を効率的に可視化し、注釈を付けることができるように設計されている。そのため、本アプリケーションは、広く使われているR環境をベースに開発されており、初回実行時には、依存する追加パッケージが自動的にインストールされる。一般的に、ShinyCNVは、グラフィックス機能とデータテーブル処理機能をRパッケージにラップして開発されており、インタラクティブな機能はShiny Rパッケージから提供されている。

 数十のサンプルから採取した数百万のSNPプローブをインタラクティブなプラットフォーム上に表示するという課題に対応するため、可視化は基本的なRグラフィックツールキットをベースに構築されており、データテーブルは主に効率性の高い'data.table'と'dplyr' Rパッケージによって処理されている。正規化されたSNP強度は、さらにサンプリングされて平滑化され、ユーザーにインタラクティブで応答性の高い体験を提供し、CNVをチェックするための視覚的感度は可能な限り維持されている。

 


 

インストール

本体 Github

コードをダウンロードして中にあるui.RをRstudioで開く。

f:id:kazumaxneo:20200417215947p:plain

 

Runをクリックしてラウンチする。

f:id:kazumaxneo:20200417220201p:plain

 

リファレンスを選択。

f:id:kazumaxneo:20200417215810p:plain

CNVファイルを選択する。
f:id:kazumaxneo:20200417215750p:plain

ここでは付属のテストデータinputCNVs.txtを読み込む。

f:id:kazumaxneo:20200417223026p:plain

 

読み込んだ。Read in SNP dataをクリックする。

f:id:kazumaxneo:20200417223441p:plain

 

クリックする。PrevとNextで前/次のコールに移動する。

f:id:kazumaxneo:20200417224811p:plain

 

動画チュートリアルが詳しいので、詳細はそちらを確認して下さい。

引用
ShinyCNV: a Shiny/R application to view and annotate DNA copy number variations

Gu Z, Mullighan CG

Bioinformatics. 2019 Jan 1;35(1):126-129

vcfをmafに変換する vcf2maf

2020 4/17 画面表示バグ修正, インストール手順修正

 

 vcf2mafはVCFをMutation Annotation Format (MAF)に変換し、各バリアントがすべての可能な遺伝子アイソフォームのうちの1つだけにアノテーションする。VCFをMAFに変換するためには、各バリアントはそれが影響を与える可能性のあるすべての遺伝子転写物/アイソフォームのうちの1つだけにマップされなければならない。変異ごとに単一の効果を選択することは、しばしば主観的なものになる。vcf2maf および maf2maf スクリプトは、その責任のほとんどを Ensembl の VEP に任せつつ、それらの「正規」アイソフォームをオーバーライドしたり、カスタム ExAC VCF をアノテーションに使用したりすることができる。また、MAF ライクなフォーマット(MAFに似た様々なフォーマット)や VCF ライクなフォーマットの解析を幅広くサポートしている。

 

 

インストール

依存が多いのでdocker環境ででテストした(anaconda3.7環境でcondaで導入した。ホスト OSはmacos10.14)。

本体 Github

#bioconda( link)
conda install -c bioconda -y vcf2maf

#dockerhub (link)annnotation等を含むため15GBくらいあります。どちらかといえばVEPのイメージです...
docker pull vanallenlab/vcf2maf:v1.6.17-5a45760
docker run --rm -itv $PWD:/data/ vanallenlab/vcf2maf:v1.6.17-5a45760
> perl /opt/vcf2maf/vcf2maf.pl -h

 > maf2maf.pl --man

# maf2maf.pl --man

NAME

     maf2maf.pl - Reannotate the effects of variants in a MAF by running maf2vcf followed by vcf2maf

 

SYNOPSIS

     perl maf2maf.pl --help

     perl maf2maf.pl --input-maf test.maf --output-maf test.vep.maf

 

OPTIONS

     --input-maf      Path to input file in MAF format

     --output-maf     Path to output MAF file [Default: STDOUT]

     --tmp-dir        Folder to retain intermediate VCFs/MAFs after runtime [Default: usually /tmp]

     --tum-depth-col  Name of MAF column for read depth in tumor BAM [t_depth]

     --tum-rad-col    Name of MAF column for reference allele depth in tumor BAM [t_ref_count]

     --tum-vad-col    Name of MAF column for variant allele depth in tumor BAM [t_alt_count]

     --nrm-depth-col  Name of MAF column for read depth in normal BAM [n_depth]

     --nrm-rad-col    Name of MAF column for reference allele depth in normal BAM [n_ref_count]

     --nrm-vad-col    Name of MAF column for variant allele depth in normal BAM [n_alt_count]

     --retain-cols    Comma-delimited list of columns to retain from the input MAF [Center,Verification_Status,Validation_Status,

     Mutation_Status,Sequencing_Phase,Sequence_Source,Validation_Method,Score,BAM_file,Sequencer,Tumor_Sample_UUID,Matched_Norm_Sample_UUID]

     --custom-enst    List of custom ENST IDs that override canonical selection

     --vep-path       Folder containing the vep script [~/vep]

     --vep-data       VEP's base cache/plugin directory [~/.vep]

     --vep-forks      Number of forked processes to use when running VEP [4]

     --buffer-size    Number of variants VEP loads at a time; Reduce this for low memory systems [5000]

     --any-allele     When reporting co-located variants, allow mismatched variant alleles too

     --filter-vcf     A VCF for FILTER tag common_variant. Set to 0 to disable [~/.vep/ExAC_nonTCGA.r0.3.1.sites.vep.vcf.gz]

     --max-filter-ac  Use tag common_variant if the filter-vcf reports a subpopulation AC higher than this [10]

     --species        Ensembl-friendly name of species (e.g. mus_musculus for mouse) [homo_sapiens]

     --ncbi-build     NCBI reference assembly of variants in MAF (e.g. GRCm38 for mouse) [GRCh37]

     --cache-version  Version of offline cache to use with VEP (e.g. 75, 84, 91) [Default: Installed version]

     --ref-fasta      Reference FASTA file [~/.vep/homo_sapiens/91_GRCh37/Homo_sapiens.GRCh37.75.dna.primary_assembly.fa.gz]

     --help           Print a brief help message and quit

     --man            Print the detailed manual

 

DESCRIPTION

    This script runs a given MAF through maf2vcf to generate per-TN-pair

    VCFs in a temporary folder, and then runs vcf2maf on each VCF to

    reannotate variant effects and create a new combined MAF

 

  Relevant links:

     Homepage: https://github.com/ckandoth/vcf2maf

     VCF format: http://samtools.github.io/hts-specs/

     MAF format: https://wiki.nci.nih.gov/x/eJaPAQ

     VEP: http://ensembl.org/info/docs/tools/vep/index.html

     VEP annotated VCF format: http://ensembl.org/info/docs/tools/vep/vep_formats.html#vcfout

 

AUTHORS

     Cyriac Kandoth (ckandoth@gmail.com)

     Qingguo Wang (josephw10000@gmail.com)

 

LICENSE

     Apache-2.0 | Apache License, Version 2.0 | https://www.apache.org/licenses/LICENSE-2.0

 

maf2maf.pl --man 

# maf2maf.pl --man

NAME

     maf2maf.pl - Reannotate the effects of variants in a MAF by running maf2vcf followed by vcf2maf

 

SYNOPSIS

     perl maf2maf.pl --help

     perl maf2maf.pl --input-maf test.maf --output-maf test.vep.maf

 

OPTIONS

     --input-maf      Path to input file in MAF format

     --output-maf     Path to output MAF file [Default: STDOUT]

     --tmp-dir        Folder to retain intermediate VCFs/MAFs after runtime [Default: usually /tmp]

     --tum-depth-col  Name of MAF column for read depth in tumor BAM [t_depth]

     --tum-rad-col    Name of MAF column for reference allele depth in tumor BAM [t_ref_count]

     --tum-vad-col    Name of MAF column for variant allele depth in tumor BAM [t_alt_count]

     --nrm-depth-col  Name of MAF column for read depth in normal BAM [n_depth]

     --nrm-rad-col    Name of MAF column for reference allele depth in normal BAM [n_ref_count]

     --nrm-vad-col    Name of MAF column for variant allele depth in normal BAM [n_alt_count]

     --retain-cols    Comma-delimited list of columns to retain from the input MAF [Center,Verification_Status,

     Validation_Status,Mutation_Status,Sequencing_Phase,Sequence_Source,Validation_Method,Score,BAM_file,Sequencer,

     Tumor_Sample_UUID,Matched_Norm_Sample_UUID]

     --custom-enst    List of custom ENST IDs that override canonical selection

     --vep-path       Folder containing the vep script [~/vep]

     --vep-data       VEP's base cache/plugin directory [~/.vep]

     --vep-forks      Number of forked processes to use when running VEP [4]

     --buffer-size    Number of variants VEP loads at a time; Reduce this for low memory systems [5000]

     --any-allele     When reporting co-located variants, allow mismatched variant alleles too

     --filter-vcf     A VCF for FILTER tag common_variant. Set to 0 to disable [~/.vep/ExAC_nonTCGA.r0.3.1.sites.vep.vcf.gz]

     --max-filter-ac  Use tag common_variant if the filter-vcf reports a subpopulation AC higher than this [10]

     --species        Ensembl-friendly name of species (e.g. mus_musculus for mouse) [homo_sapiens]

     --ncbi-build     NCBI reference assembly of variants in MAF (e.g. GRCm38 for mouse) [GRCh37]

     --cache-version  Version of offline cache to use with VEP (e.g. 75, 84, 91) [Default: Installed version]

     --ref-fasta      Reference FASTA file [~/.vep/homo_sapiens/91_GRCh37/Homo_sapiens.GRCh37.75.dna.primary_assembly.fa.gz]

     --help           Print a brief help message and quit

     --man            Print the detailed manual

 

DESCRIPTION

    This script runs a given MAF through maf2vcf to generate per-TN-pair

    VCFs in a temporary folder, and then runs vcf2maf on each VCF to

    reannotate variant effects and create a new combined MAF

 

  Relevant links:

     Homepage: https://github.com/ckandoth/vcf2maf

     VCF format: http://samtools.github.io/hts-specs/

     MAF format: https://wiki.nci.nih.gov/x/eJaPAQ

     VEP: http://ensembl.org/info/docs/tools/vep/index.html

     VEP annotated VCF format: http://ensembl.org/info/docs/tools/vep/vep_formats.html#vcfout

 

AUTHORS

     Cyriac Kandoth (ckandoth@gmail.com)

     Qingguo Wang (josephw10000@gmail.com)

 

LICENSE

     Apache-2.0 | Apache License, Version 2.0 | https://www.apache.org/licenses/LICENSE-2.0

 

EnsemblのVEPも導入される。

help

> vep

  

テストラン

vcfとリファレンスを指定する(リファレンス指定フラグ"--ref-fasta"がないとHomo_sapiens.GRCh37.75.dna.primary_assembly.fa.gzが使用される(ファイルがある場合のみ))。

git clone https://github.com/mskcc/vcf2maf.git
cd vcf2maf/
perl vcf2maf.pl --input-vcf tests/test.vcf --output-maf tests/test.vep.maf -ref-fasta <path>/<to>/GRCh37.primary_assembly.fa.gz

 

 

出力MAFの16列目と17列目にtumor/normalの標本IDを記入し、VCFのマッチした遺伝子型から遺伝子型と対立遺伝子数を解析するには、--tumor-idと--normal-idフラグを立てる。

vcf2maf.pl --input-vcf tests/test.vcf --output-maf tests/test.vep.maf --tumor-id WD1309 --normal-id NB1308

マッチしたnormalサンプルがない場合は--normal-idオプションのみスキップする。

 

引用

https://github.com/mskcc/vcf2maf

 

関連

 

関連スクリプト

no longer supported (deprecated)

 

参考

https://www.researchgate.net/post/Vcf2maf_how_does_it_select_only_one_gene_from_overlapping_genes