macでインフォマティクス

macでインフォマティクス

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

未知微生物種も含めてメタゲノムプロファイリングする MetaPhlAn 4

2022/8/26 追記

2022/09/07 インストール修正

2023/02/26 論文引用

DB追記2023/12/02追記

 

 

 メタゲノム解析は、微生物群集から新規生物を発見することを可能にするが、多くのメタゲノムからは、少数の豊富な生物しか捕らえることができない。そこで、メタゲノム解析と単離ゲノムの情報を統合し、より包括的なメタゲノム分類学的プロファイリングを行う手法「MetaPhlAn 4」を紹介する。原核生物のリファレンスゲノムとメタゲノムから収集した101万個のゲノムから、26,970の種レベルのゲノムビン(うち4,992は種レベルでは分類学的に未同定)について固有のマーカー遺伝子を定義した。MetaPhlAn 4は、ほとんどの国際的なヒト腸内細菌叢で約20%、ルーメン微生物叢のような特性の低い環境では40%以上のリードを説明し、合成評価において利用可能な代替法よりも精度が高いことを証明するとともに、培養単離株を持たない生物も確実に定量化することができた。この方法を24,500以上のメタゲノムに適用したところ、これまで検出されていなかった種が、ヒトやマウスのマイクロバイオームにおける宿主の条件や生活習慣の強力なバイオマーカーとなることが明らかになった。また、これまで知られていなかった種でも、単一微生物株の分解能で遺伝学的にプロファイリングできることが示された。MetaPhlAn 4は、メタゲノム解析の新規性とリファレンスベースの解析の感度および忠実性を統合し、未特定種の効率的なメタゲノムプロファイリングを実現し、より深く包括的なマイクロバイオームバイオマーカーの検出を可能にする。

 

version 4の新機能(Githubより)

  • 種レベルゲノムビンシステム(SGB)の採用
  • 約100万個の微生物ゲノムから抽出された新しいMetaPhlAnマーカー遺伝子
  • 21,978種の既知(kSGBs)および4,992種の未知(uSGBs)微生物種をプロファイリングする能力
  • ヒトの腸内細菌だけでなく、他の多くの動物や生態環境をよりよく表現
  • パラメータ--unclassified_estimationにより、データベースに含まれない微生物が構成するメタゲノムも推定することが可能
  • MetaPhlAn 3 データベースとの互換性 (パラメータ --mpa3)

 

Installation 

https://github.com/biobakery/MetaPhlAn/wiki/MetaPhlAn-4#installation

 

2023/02/28  DBアップデートのアナウンス

https://forum.biobakery.org/t/metaphlan-4-published-database-update/4850/1

 

インストール

condaで仮想環境を作ってpipで導入した。

 本体 Github

#conda (link)
mamba create -n mpa -c bioconda python=3.7 -y
conda activate mpa
mamba install -c conda-forge -c bioconda metaphlan -y

#pip(bowtie2は別に導入する必要がある)
pip install metaphlan

#docker
docker pull biobakery/metaphlan

> metaphlan -h

$ metaphlan -h

usage: metaphlan --input_type {fastq,fasta,bowtie2out,sam} [--force]

                 [--bowtie2db METAPHLAN_BOWTIE2_DB] [-x INDEX]

                 [--bt2_ps BowTie2 presets] [--bowtie2_exe BOWTIE2_EXE]

                 [--bowtie2_build BOWTIE2_BUILD] [--bowtie2out FILE_NAME]

                 [--min_mapq_val MIN_MAPQ_VAL] [--no_map] [--tmp_dir]

                 [--tax_lev TAXONOMIC_LEVEL] [--min_cu_len]

                 [--min_alignment_len] [--add_viruses] [--ignore_eukaryotes]

                 [--ignore_bacteria] [--ignore_archaea] [--ignore_ksgbs]

                 [--ignore_usgbs] [--stat_q] [--perc_nonzero]

                 [--ignore_markers IGNORE_MARKERS] [--avoid_disqm] [--stat]

                 [-t ANALYSIS TYPE] [--nreads NUMBER_OF_READS]

                 [--pres_th PRESENCE_THRESHOLD] [--clade] [--min_ab]

                 [-o output file] [--sample_id_key name]

                 [--use_group_representative] [--sample_id value]

                 [-s sam_output_file] [--legacy-output] [--CAMI_format_output]

                 [--unclassified_estimation] [--mpa3] [--biom biom_output]

                 [--mdelim mdelim] [--nproc N] [--install] [--force_download]

                 [--read_min_len READ_MIN_LEN] [-v] [-h]

                 [INPUT_FILE] [OUTPUT_FILE]

 

DESCRIPTION

 MetaPhlAn version 4.0.0 (22 Aug 2022): 

 METAgenomic PHyLogenetic ANalysis for metagenomic taxonomic profiling.

 

AUTHORS: Aitor Blanco-Miguez (aitor.blancomiguez@unitn.it), Francesco Beghini (francesco.beghini@unitn.it), Nicola Segata (nicola.segata@unitn.it), Duy Tin Truong, Francesco Asnicar (f.asnicar@unitn.it)

 

COMMON COMMANDS

 

 We assume here that MetaPhlAn is installed using the several options available (pip, conda, PyPi)

 Also BowTie2 should be in the system path with execution and read permissions, and Perl should be installed)

 

========== MetaPhlAn clade-abundance estimation ================= 

 

The basic usage of MetaPhlAn consists in the identification of the clades (from phyla to species ) 

present in the metagenome obtained from a microbiome sample and their 

relative abundance. This correspond to the default analysis type (-t rel_ab).

 

*  Profiling a metagenome from raw reads:

$ metaphlan metagenome.fastq --input_type fastq -o profiled_metagenome.txt

 

*  You can take advantage of multiple CPUs and save the intermediate BowTie2 output for re-running

   MetaPhlAn extremely quickly:

$ metaphlan metagenome.fastq --bowtie2out metagenome.bowtie2.bz2 --nproc 5 --input_type fastq -o profiled_metagenome.txt

 

*  If you already mapped your metagenome against the marker DB (using a previous MetaPhlAn run), you

   can obtain the results in few seconds by using the previously saved --bowtie2out file and 

   specifying the input (--input_type bowtie2out):

$ metaphlan metagenome.bowtie2.bz2 --nproc 5 --input_type bowtie2out -o profiled_metagenome.txt

 

*  bowtie2out files generated with MetaPhlAn versions below 3 are not compatibile.

   Starting from MetaPhlAn 3.0, the BowTie2 ouput now includes the size of the profiled metagenome and the average read length.

   If you want to re-run MetaPhlAn using these file you should provide the metagenome size via --nreads:

$ metaphlan metagenome.bowtie2.bz2 --nproc 5 --input_type bowtie2out --nreads 520000 -o profiled_metagenome.txt

 

*  You can also provide an externally BowTie2-mapped SAM if you specify this format with 

   --input_type. Two steps: first apply BowTie2 and then feed MetaPhlAn with the obtained sam:

$ bowtie2 --sam-no-hd --sam-no-sq --no-unal --very-sensitive -S metagenome.sam -x ${mpa_dir}/metaphlan_databases/mpa_v30_CHOCOPhlAn_201901 -U metagenome.fastq

$ metaphlan metagenome.sam --input_type sam -o profiled_metagenome.txt

 

*  We can also natively handle paired-end metagenomes, and, more generally, metagenomes stored in 

  multiple files (but you need to specify the --bowtie2out parameter):

$ metaphlan metagenome_1.fastq,metagenome_2.fastq --bowtie2out metagenome.bowtie2.bz2 --nproc 5 --input_type fastq

 

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

 

 

========== Marker level analysis ============================ 

 

MetaPhlAn introduces the capability of characterizing organisms at the strain level using non

aggregated marker information. Such capability comes with several slightly different flavours and 

are a way to perform strain tracking and comparison across multiple samples.

Usually, MetaPhlAn is first ran with the default -t to profile the species present in

the community, and then a strain-level profiling can be performed to zoom-in into specific species

of interest. This operation can be performed quickly as it exploits the --bowtie2out intermediate 

file saved during the execution of the default analysis type.

 

*  The following command will output the abundance of each marker with a RPK (reads per kilo-base) 

   higher 0.0. (we are assuming that metagenome_outfmt.bz2 has been generated before as 

   shown above).

$ metaphlan -t marker_ab_table metagenome_outfmt.bz2 --input_type bowtie2out -o marker_abundance_table.txt

   The obtained RPK can be optionally normalized by the total number of reads in the metagenome 

   to guarantee fair comparisons of abundances across samples. The number of reads in the metagenome

   needs to be passed with the '--nreads' argument

 

*  The list of markers present in the sample can be obtained with '-t marker_pres_table'

$ metaphlan -t marker_pres_table metagenome_outfmt.bz2 --input_type bowtie2out -o marker_abundance_table.txt

   The --pres_th argument (default 1.0) set the minimum RPK value to consider a marker present

 

*  The list '-t clade_profiles' analysis type reports the same information of '-t marker_ab_table'

   but the markers are reported on a clade-by-clade basis.

$ metaphlan -t clade_profiles metagenome_outfmt.bz2 --input_type bowtie2out -o marker_abundance_table.txt

 

*  Finally, to obtain all markers present for a specific clade and all its subclades, the 

   '-t clade_specific_strain_tracker' should be used. For example, the following command

   is reporting the presence/absence of the markers for the B. fragilis species and its strains

   the optional argument --min_ab specifies the minimum clade abundance for reporting the markers

 

$ metaphlan -t clade_specific_strain_tracker --clade s__Bacteroides_fragilis metagenome_outfmt.bz2 --input_type bowtie2out -o marker_abundance_table.txt

 

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

 

positional arguments:

  INPUT_FILE            the input file can be:

                        * a fastq file containing metagenomic reads

                        OR

                        * a BowTie2 produced SAM file. 

                        OR

                        * an intermediary mapping file of the metagenome generated by a previous MetaPhlAn run 

                        If the input file is missing, the script assumes that the input is provided using the standard 

                        input, or named pipes.

                        IMPORTANT: the type of input needs to be specified with --input_type

  OUTPUT_FILE           the tab-separated output file of the predicted taxon relative abundances 

                        [stdout if not present]

 

Required arguments:

  --input_type {fastq,fasta,bowtie2out,sam}

                        set whether the input is the FASTA file of metagenomic reads or 

                        the SAM file of the mapping of the reads against the MetaPhlAn db.

 

Mapping arguments:

  --force               Force profiling of the input file by removing the bowtie2out file

  --bowtie2db METAPHLAN_BOWTIE2_DB

                        Folder containing the MetaPhlAn database. You can specify the location by exporting the DEFAULT_DB_FOLDER variable in the shell.[default /home/kazu/mambaforge/envs/mpa/lib/python3.7/site-packages/metaphlan/metaphlan_databases]

  -x INDEX, --index INDEX

                        Specify the id of the database version to use. If "latest", MetaPhlAn will get the latest version.

                        If an index name is provided, MetaPhlAn will try to use it, if available, and skip the online check.

                        If the database files are not found on the local MetaPhlAn installation they

                        will be automatically downloaded [default latest]

  --bt2_ps BowTie2 presets

                        Presets options for BowTie2 (applied only when a FASTA file is provided)

                        The choices enabled in MetaPhlAn are:

                         * sensitive

                         * very-sensitive

                         * sensitive-local

                         * very-sensitive-local

                        [default very-sensitive]

  --bowtie2_exe BOWTIE2_EXE

                        Full path and name of the BowTie2 executable. This option allowsMetaPhlAn to reach the executable even when it is not in the system PATH or the system PATH is unreachable

  --bowtie2_build BOWTIE2_BUILD

                        Full path to the bowtie2-build command to use, deafult assumes that 'bowtie2-build is present in the system path

  --bowtie2out FILE_NAME

                        The file for saving the output of BowTie2

  --min_mapq_val MIN_MAPQ_VAL

                        Minimum mapping quality value (MAPQ) [default 5]

  --no_map              Avoid storing the --bowtie2out map file

  --tmp_dir             The folder used to store temporary files [default is the OS dependent tmp dir]

 

Post-mapping arguments:

  --tax_lev TAXONOMIC_LEVEL

                        The taxonomic level for the relative abundance output:

                        'a' : all taxonomic levels

                        'k' : kingdoms

                        'p' : phyla only

                        'c' : classes only

                        'o' : orders only

                        'f' : families only

                        'g' : genera only

                        's' : species only

                        't' : SGBs only

                        [default 'a']

  --min_cu_len          minimum total nucleotide length for the markers in a clade for

                        estimating the abundance without considering sub-clade abundances

                        [default 2000]

  --min_alignment_len   The sam records for aligned reads with the longest subalignment

                        length smaller than this threshold will be discarded.

                        [default None]

  --add_viruses         Together with --mpa3, allow the profiling of viral organisms

  --ignore_eukaryotes   Do not profile eukaryotic organisms

  --ignore_bacteria     Do not profile bacterial organisms

  --ignore_archaea      Do not profile archeal organisms

  --ignore_ksgbs        Do not profile known SGBs (together with --sgb option)

  --ignore_usgbs        Do not profile unknown SGBs (together with --sgb option)

  --stat_q              Quantile value for the robust average

                        [default 0.2]

  --perc_nonzero        Percentage of markers with a non zero relative abundance for misidentify a species

                        [default 0.33]

  --ignore_markers IGNORE_MARKERS

                        File containing a list of markers to ignore. 

  --avoid_disqm         Deactivate the procedure of disambiguating the quasi-markers based on the 

                        marker abundance pattern found in the sample. It is generally recommended 

                        to keep the disambiguation procedure in order to minimize false positives

  --stat                Statistical approach for converting marker abundances into clade abundances

                        'avg_g'  : clade global (i.e. normalizing all markers together) average

                        'avg_l'  : average of length-normalized marker counts

                        'tavg_g' : truncated clade global average at --stat_q quantile

                        'tavg_l' : truncated average of length-normalized marker counts (at --stat_q)

                        'wavg_g' : winsorized clade global average (at --stat_q)

                        'wavg_l' : winsorized average of length-normalized marker counts (at --stat_q)

                        'med'    : median of length-normalized marker counts

                        [default tavg_g]

 

Additional analysis types and arguments:

  -t ANALYSIS TYPE      Type of analysis to perform: 

                         * rel_ab: profiling a metagenomes in terms of relative abundances

                         * rel_ab_w_read_stats: profiling a metagenomes in terms of relative abundances and estimate the number of reads coming from each clade.

                         * reads_map: mapping from reads to clades (only reads hitting a marker)

                         * clade_profiles: normalized marker counts for clades with at least a non-null marker

                         * marker_ab_table: normalized marker counts (only when > 0.0 and normalized by metagenome size if --nreads is specified)

                         * marker_counts: non-normalized marker counts [use with extreme caution]

                         * marker_pres_table: list of markers present in the sample (threshold at 1.0 if not differently specified with --pres_th

                         * clade_specific_strain_tracker: list of markers present for a specific clade, specified with --clade, and all its subclades

                        [default 'rel_ab']

  --nreads NUMBER_OF_READS

                        The total number of reads in the original metagenome. It is used only when 

                        -t marker_table is specified for normalizing the length-normalized counts 

                        with the metagenome size as well. No normalization applied if --nreads is not 

                        specified

  --pres_th PRESENCE_THRESHOLD

                        Threshold for calling a marker present by the -t marker_pres_table option

  --clade               The clade for clade_specific_strain_tracker analysis

  --min_ab              The minimum percentage abundance for the clade in the clade_specific_strain_tracker analysis

 

Output arguments:

  -o output file, --output_file output file

                        The output file (if not specified as positional argument)

  --sample_id_key name  Specify the sample ID key for this analysis. Defaults to 'SampleID'.

  --use_group_representative

                        Use a species as representative for species groups.

  --sample_id value     Specify the sample ID for this analysis. Defaults to 'Metaphlan_Analysis'.

  -s sam_output_file, --samout sam_output_file

                        The sam output file

  --legacy-output       Old MetaPhlAn2 two columns output

  --CAMI_format_output  Report the profiling using the CAMI output format

  --unclassified_estimation

                        Scale relative abundances to the number of reads mapping to identified clades in order to estimate unclassified taxa

  --mpa3                Perform the analysis using the MetaPhlAn 3 algorithm

  --biom biom_output, --biom_output_file biom_output

                        If requesting biom file output: The name of the output file in biom format 

  --mdelim mdelim, --metadata_delimiter_char mdelim

                        Delimiter for bug metadata: - defaults to pipe. e.g. the pipe in k__Bacteria|p__Proteobacteria 

 

Other arguments:

  --nproc N             The number of CPUs to use for parallelizing the mapping [default 4]

  --install             Only checks if the MetaPhlAn DB is installed and installs it if not. All other parameters are ignored.

  --force_download      Force the re-download of the latest MetaPhlAn database.

  --read_min_len READ_MIN_LEN

                        Specify the minimum length of the reads to be considered when parsing the input file with 'read_fastx.py' script, default value is 70

  -v, --version         Prints the current MetaPhlAn version and exit

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

 

 

 

データベースの準備

最新のデータベースをダウンロードする。指定しない場合、初回のランでデータベースのダウンロードが行われる。

metaphlan --install --bowtie2db <path>/<to>/<your>/<DB>

 

 

実行方法

fastqファイルを指定する。同じシークエンスデータをパラメータだけ変えてもう一度ランしたいなら、中間出力であるBowTie2のマッピングファイルも保存する。(-bowtie2out <name>)。データベースを指定するなら、"--index <D.B>"でパスを指定する。indexを付けずにランすると、初回はデータベースがデフォルトのパスにダウンロードされ、2回目以降はそれが自動で使用される("--index"をつけずにランした方が簡単)。

#初回
metaphlan metagenome.fq.gz --bowtie2out metagenome.bowtie2.bz2 --nproc 20 --input_type fastq -o profiled_metagenome.txt

#"同じfastqデータ"をパラメータだけ変えて再度ランするなら、"-bowtie2out"で作ったBowTie2ファイルをfastqの代わりに指定する。
#その時は”--input_type bowtie2out"とする。
metaphlan metagenome.bowtie2.bz2 --nproc 20 --input_type bowtie2out -o profiled_metagenome.txt

(bowtie2は別に導入する必要がある。bowtie2にパスが通ってないと、ラン後しばらくして、データベースチェック後にエラーになる)

 

複数fastq、例えばペアエンドfastqを両方指定する。

metaphlan metagenome_1.fq.gz,metagenome_2.fq.gz --bowtie2out metagenome.bowtie2.bz2 --nproc 20 --input_type fastq --index
<path>/<to>/pa_vJan21_CHOCOPhlAnSGB_202103 -o profiled_metagenome.txt

 

メタゲノム中の未分類の割合を推定する (--unclassified_estimation)。

metaphlan metagenome.fq.gz --bowtie2out metagenome.bowtie2.bz2 --nproc 20 --input_type fastq --index
<path>/<to>/pa_vJan21_CHOCOPhlAnSGB_202103 --unclassified_estimation -o profiled_metagenome.txt

 

出力ファイルのマージは、同じバージョンのMetaPhlAnデータベースでプロファイリングを行った場合のみ可能。

 

SGBベースのMetaPhlAn 4の出力をGTDB-taxonomyベースのプロファイルに変換する。

sgb_to_gtdb_profile.py -i metaphlan_output.txt -o metaphlan_output_gtdb.txt

 

MetaPhlAnの統合されたテーブルから、アルファおよび/またはベータ多様性を、選択したさまざまな指標で計算する。利用可能なアルファ多様性指標は、richness、shannon、simpson、gini。ベータ多様性の距離関数として、Bray-Curtis、Jaccard、weighted-Unifrac、unweighted-Unifrac、centered log-ratio、aitchisonが利用可能。

Rscript calculate_diversity.R -f merged_mpa4_profiles.tsv -d beta -m bray-curtis

 

引用

Extending and improving metagenomic taxonomic profiling with uncharacterized species with MetaPhlAn 4
Aitor Blanco-Miguez, Francesco Beghini, Fabio Cumbo, Lauren J. McIver, Kelsey N. Thompson, Moreno Zolfo, Paolo Manghi, Leonard Dubois, Kun D. Huang, Andrew Maltez Thomas, Gianmarco Piccinno, Elisa Piperni, Michal Pun?ocha?, Mireia Valles-Colomer, Adrian Tett, Francesca Giordano, Richard Davies, Jonathan Wolf, Sarah E. Berry, Tim D. Spector, Eric A. Franzosa, Edoardo Pasolli, Francesco Asnicar, Curtis Huttenhower, Nicola Segata

bioRxiv, Posted August 22, 2022

 

Extending and improving metagenomic taxonomic profiling with uncharacterized species using MetaPhlAn 4

Aitor Blanco-Míguez, Francesco Beghini, Fabio Cumbo, Lauren J. McIver, Kelsey N. Thompson, Moreno Zolfo, Paolo Manghi, Leonard Dubois, Kun D. Huang, Andrew Maltez Thomas, William A. Nickols, Gianmarco Piccinno, Elisa Piperni, Michal Punčochář, Mireia Valles-Colomer, Adrian Tett, Francesca Giordano, Richard Davies, Jonathan Wolf, Sarah E. Berry, Tim D. Spector, Eric A. Franzosa, Edoardo Pasolli, Francesco Asnicar, Curtis Huttenhower & Nicola Segata

Nature Biotechnology, Published: 23 February 2023

 

関連


 

メタゲノムの分類学的プロファイリングを行う mOTUs3

2022/09/07 誤字修正、オプション追記, 10/17 インストール手順修正

2022/12/18 論文引用

2024/02/05 追記

 

 分類学的プロファイリングは、生物試料中の微生物の相対的な存在量を検出・定量することを目的としたマイクロバイオーム研究の基本的なタスクである。ショットガンメタゲノムデータを利用する方法は、一般に、配列決定され分類学的に注釈されたリファレンスゲノムが利用可能であることに依存している。しかし、大半の微生物はまだ培養されておらず、そのようなリファレンスゲノムが存在しない。そのため、特に未踏の環境から採取されたサンプルでは、メタゲノム分類プロファイリングの際に、かなりの割合の微生物群集メンバーが未算入のまま残される。この問題に対処するため、本著者らはメタゲノムのリファレンスゲノムに依存しない種レベルのプロファイリングを可能にするツール、mOTUプロファイラを開発した。このツールは、選択されたマーカー遺伝子に基づき、「既知」と「未知」の両方の種の同定と定量をサポートする。

 本発表では、33,000 以上の種レベルのOTUについてメタゲノムのプロファイリングを可能にするコマンドラインツール、mOTUs3 を紹介する。そのために、土壌、淡水、反芻動物やその他の動物の消化管など、多様なマイクロバイオームから得られた60万以上のドラフトゲノム(そのほとんどがメタゲノムアセンブリゲノム(MAG))の再構成と解析を活用し、リファレンスゲノムに大きく劣ることを明らかにした。全体として、全種レベルの分類群の3分の2がリファレンスゲノムを欠いていた。これらの新規分類群の累積相対存在量は、ヒトの体内部位のようなよく研究されているマイクロバイオームでは低かった(6-11%)。一方、ヒト以外の多様なマイクロバイオームでは、相対存在量のかなりの割合(海洋、淡水、土壌:43-63%)、あるいは大部分(豚、魚、牛:60-80%)を占めた。コミュニティが開発したベンチマークとデータセットを用いて、mOTUs3が他の手法よりも正確で、16S rRNA遺伝子ベースの分類学的プロファイリング手法と一致することを確認した。さらに、mOTUs3は、よく知られた微生物群を種レベルの分類群に分解する能力を大幅に高め、比較メタゲノム研究において、異なる濃度で存在する新しい分類群を同定するのに役立つことを実証した。

 メタゲノムの正確な種レベルのプロファイリングを可能にするためにmOTUs3を開発した。他の手法と比較して、原核生物群集の多様性、特に現在未解明なマイクロバイオームについて、より包括的な見解を得ることができる。研究コミュニティによる比較解析を容易にするため、一般に公開されているメタゲノムについて11,000以上の事前計算されたプロファイルが公開されており、https://github.com/motu-tool/mOTUs で自由に利用できる。

 

HP

https://motu-tool.org/index.html

 

 

インストール

condaで仮想環境を作ってpipで導入した。

依存

  • Python 3 (or higher)
  • the Burrow-Wheeler Aligner v0.7.15 or higher (bwa)
  • SAMtools v1.5 or higher
  • metaSNV v1.0.3 (necessary for snv_call command)

 本体 Github

#conda (link)
mamba create -n motus python=3.8 -y
conda activate motus
mamba install -c conda-forge -c bioconda bwa samtools metasnv -y
mamba install -c conda-forge -c bioconda motus=3.0.3

#pip (pypi)
pip install motu-profiler

 

データベース

ダウンロード用のコマンドが用意されている。

motus downloadDB

#test
motus profile --test

mOTUsデータベースは、3種類のmOTUから構成されている(Githubより)。

  • ref-mOTU:既知の生物種を表す。
  • メタゲノムから得られた未知の生物種を表す「meta-mOTU」。
  • ext-mOTUはMAGから得られた未知の生物種を表す。

なお、meta-mOTUとext-mOTUには種レベルのアノテーションは付かない。mOTUsデータベースは定期的に更新されており、最新版(2.6.1)では、約60万個のドラフトゲノムを収録し、プロファイリング可能な種が倍増した。

(使われているMAGのソースについてはプレプリントの図1に示されています。mOTUs2よりもさらに増えましたね。)

 

#test
> motus profile --test

#help

> motus profile 

Usage: motus profile [options]

 

Input options:

   -f  FILE[,FILE]  input file(s) for reads in forward orientation, fastq(.gz)-formatted

   -r  FILE[,FILE]  input file(s) for reads in reverse orientation, fastq(.gz)-formatted

   -s  FILE[,FILE]  input file(s) for unpaired reads, fastq(.gz)-formatted

   -n  STR          sample name ['unnamed sample']

   -i  FILE[,FILE]  provide SAM or BAM input file(s)  (generated by motus map_tax)

   -m  FILE         provide a mgc reads count file (generated by motus calc_mgc)

   -db DIR          provide a different database directory

 

Output options:

   -o  FILE         output file name [stdout]

   -I  FILE         save the result of BWA in BAM format (output of motus map_tax)

   -M  FILE         save the mgc reads count (output of motus calc_mgc)

   -e               only species with reference genomes (ref-mOTUs)

   -u               print the full name of the species

   -c               print result as counts instead of relative abundances

   -p               print NCBI taxonomy identifiers

   -B               print result in BIOM format

   -C  STR          print result in CAMI format (BioBoxes format 0.9.1)

                    Values: [precision, recall, parenthesis]

   -q               print the full rank taxonomy

   -A               print all taxonomic levels together (kingdom to mOTUs, override -k)

   -k  STR          taxonomic level [mOTU]

                    Values: [kingdom, phylum, class, order, family, genus, mOTU]

 

Algorithm options:

   -g  INT          number of marker genes cutoff: 1=higher recall, 6=higher precision [3]

   -l  INT          min length of the alignment (bp) [75]

   -t  INT          number of threads [1]

   -v  INT          verbosity level: 1=error, 2=warning, 3=message, 4+=debugging [3]

   -y  STR          type of read counts [insert.scaled_counts]

                    Values: [base.coverage, insert.raw_counts, insert.scaled_counts]

 

> motus merge

Usage: motus merge [options]

 

Input options:

   -i FILE[,FILE] list of mOTU profiles to merge (comma separated)

   -d DIR         merge all files in the directory DIR

   -a STR[,STR]   add pre-computed profiles from different environmental samples

                  Values: [all, air, bioreactor, bee, cat,

                  cattle, chicken, dog, fish, freshwater, human,

                  marine, mouse, pig, sheep, soil, termite, wastewater]

 

Output options:

   -o FILE        output file name [stdout]

   -B             print result in BIOM format

 

Algorithm options:

   -v INT         verbosity level: 1=error, 2=warning, 3=message,

4+=debugging [3]

 

 

実行方法

メタゲノムプロファイリング

fastqファイルを指定する。

#unpaired
motus profile -s metagenomic_sample.fq.gz -t 20 -n sample1 -o taxonomy_profile_sample1.txt

#paired
motus profile -f sample_R1.fq.gz -r sample_R2.fq.gz -t 20 -n sample1 -o taxonomy_profile_sample1.txt

#複数回のシークエンシング
motus profile -f sample1_run1.fq,sample1_run2.fq -r sample1_run1_rev.fq,sample1_run2_rev.fq -s sample1_run1_single.fq -t 20 -n sample1 -o taxonomy_profile_sample1.txt
  • -f    input file(s) for reads in forward orientation, fastq(.gz)-formatted
  • -r    input file(s) for reads in reverse orientation, fastq(.gz)-formatted
  • -s    input file(s) for unpaired reads, fastq(.gz)-formatted
  • -n    sample name ['unnamed sample']
  • -t     number of threads [1]
  • -o     output file name [stdout]

motus profileコマンドは、map_tax、calc_mgc 、calc_motu コマンドで行う3つのステップで一括で行う。

 

複数結果のマージ

motus mergeコマンドを使う。

motus profile -s metagenomic_sample_1.fastq -o taxonomy_profile_1.txt
motus profile -s metagenomic_sample_2.fastq -o taxonomy_profile_2.txt
#カンマ区切りでファイルを指定
motus merge -i taxonomy_profile_1.txt,taxonomy_profile_2.txt > all_sample_profiles.txt

#もしくはprofileのディレクトリを指定(無関係のファイルやディレクトリがあるとエラーになるので注意)
motus merge -d profile_fir/ > all_sample_profiles.txt

 

 

引用

Reference genome-independent taxonomic profiling of microbiomes with mOTUs3
Hans-Joachim Ruscheweyh, Alessio Milanese,  Lucas Paoli, Nicolai Karcher, Quentin Clayssen, Marisa Isabell Metzger,  Jakob Wirbel, Peer Bork, Daniel R. Mende, Georg Zeller, Shinichi Sunagawa

bioRxiv, Posted April 08, 2022

 

追記

Cultivation-independent genomes greatly expand taxonomic-profiling capabilities of mOTUs across various environments

Hans-Joachim Ruscheweyh, Alessio Milanese, Lucas Paoli, Nicolai Karcher, Quentin Clayssen, Marisa Isabell Keller, Jakob Wirbel, Peer Bork, Daniel R. Mende, Georg Zeller & Shinichi Sunagawa 
Microbiome volume 10, Article number: 212 (2022) 

 

関連

 

真菌のコア遺伝子データベースとゲノムワイド系統解析のためのパイプライン UFCG

 

 系統発生学では、生物の進化的関係をゲノム情報によって研究する。各生物から関連する遺伝子を抽出し、多重配列アラインメントを構築し、系統樹によって進化関係を再構築するのが一般的なアプローチである。この解析には、分類群内での効率的な自動化を可能にするため、しばしばコア遺伝子と呼ばれる単一コピーで存在する保存性の高い遺伝子群が使用される。ここでは、真菌のゲノムワイド系統解析のためのUniversal Fungal Core Genes (UFCG) データベースとパイプラインを紹介する。UFCGデータベースは、計算によって得られた41個の新規コア遺伝子と文献から得られた20個のcanonical遺伝子、および一般に公開されている真菌ゲノムから抽出したマーカー遺伝子配列からなる61個のキュレーションされた真菌マーカー遺伝子で構成されている。さらに、マーカー遺伝子の抽出、学習、系統樹再構成のための使いやすい全自動パイプラインをオープンソースで提供している。UFCGパイプラインは、ゲノム、プロテオミクス、トランスクリプトームデータからマーカー遺伝子を同定し、同時に既報の系統と矛盾しない系統樹を作成することができる。UFCGデータベースとともに、https://ufcg.steineggerlab.com で一般に公開されている。

 

About

https://ufcg.steineggerlab.com/ufcg/about

Manual (Pipeline)

https://ufcg.steineggerlab.com/ufcg/manual

Tutorial (Pipeline)

https://ufcg.steineggerlab.com/ufcg/tutorial

 

 

Github

 

UFCGプロジェクトの特徴(Aboutより)

  • マーカー遺伝子データベース。配列とHMMをダウンロード可能
  • 分類学的情報と抽出済み遺伝子マーカーを提供するリファレンス真菌種データベース
  • 独自の生物学的配列を解析するためのパイプラインツールおよびマニュアル

 

webサービス

https://ufcg.steineggerlab.comにアクセスする。

Gene list

真菌のcanonical遺伝子とcore遺伝子を組み合わせた遺伝子リスト。canonical遺伝子は、真菌の分類学者が受け入れていて頻繁に使用しているもの。文献検索により定義され、組み込まれた。コア遺伝子は、単一コピーでオーソログであることが証明されている遺伝子。ゲノムに基づく系統樹の再構築に最も広く用いられている。

遺伝子名、機能的注釈、Saccharomyces Genome Database (SGD)のID、Uniprot IDなどが表示されている。

 

遺伝子をクリックすると、MSAが視覚化されて示される。MSA、FASTA配列、HMMプロファイルそれぞれはダウンロードできる。

 

Species list

新規マーカーを定義するために使用された1,587種の種のリストが含まれている。分類名でソートしたり検索できるようになっている。

アクセッションIDはNCBIにリンクしている。

 

それぞれの真菌ゲノムアセンブリについて、ITS配列、UFCGで定義されたコア遺伝子、BUSCO遺伝子をJSON形式でダウンロードできる。

 

ページ下では、分類学的な代表にされているエントリーと冗長なエントリーの両方を含む、10,984のアセンブリからのリソースのアーカイブをダウンロードできる。

 

このほか、LinuxmacでサポートされているjavaのFCG pipelineを使うと、真菌のゲノム配列、トランスクリプトーム配列、プロテオーム配列などからマーカー遺伝子配列を抽出したり、得られたマーカー遺伝子セットから多重整列を行ったり、その結果から系統解析を行うことができる。詳細はmanualを読んで下さい。

引用

UFCG: database of universal fungal core genes and pipeline for genome-wide phylogenetic analysis of fungi
Dongwook Kim,  Cameron L.M. Gilchrist,  Jongsik Chun, Martin Steinegger

bioRxiv, Posted August 17, 2022.

2ラウンドのオーバーラッピングとキャッシュに基づく高速エラー訂正を行う Fec

 

 第3世代シーケンサーは長いリード長でゲノム解析を進めるが、リードのエラーレートが高いため、エラー訂正が必要になる。特にシーケンスカバレッジが高い場合、エラー訂正は時間のかかる作業である。一般に、既存の誤り訂正手法は、重複するリードAを訂正する際にBからAへの塩基レベルアラインメントを行い、リードBを訂正する際にAからBへの別の塩基レベルアラインメントを行うが、著者らの観測によれば、塩基レベルアラインメントの情報を再利用することが可能である。本論文では、2ラウンドのオーバーラッピングとキャッシングを用いた高速誤り訂正ツールFecを紹介する。Fecは単独で、あるいはアセンブリパイプラインのエラー訂正ステップとして使用することができる。第1ラウンドでは、Fecは大きなウィンドウサイズ(20)を用いて、ほとんどのリードを修正するのに十分な重複を高速に見つけることができる。第2ラウンドでは、第1ラウンドで重複が不十分だったリードに対して、小さなウィンドウサイズ(5)でより多くの重複を見つける。塩基配列のアラインメントを行う場合、Fecはまずキャッシュを検索する。キャッシュにアラインメントが存在する場合、Fecはこのアラインメントを取り出し、そこから2回目のアラインメントを推論する。そうでない場合は、Fecはベースレベルアラインメントを行い、アラインメントをキャッシュに格納する。Fecを9つのデータセットでテストした結果、5つのPacBioデータセットでMECAT, CANU, MINICNSと比較して1.24〜38.56倍、4つのnanoporeデータセットでNECAT, CANUと比較して1.16〜27.8倍高速化されることが確認された。

 

インストール

condaを使ってインストールした。

#conda(link)
mamba create -n fec -y
conda activate fec
mamba install -c bioconda fec -y

> Fec

USAGE:

Fec [options] input reads output

 

OPTIONS:

-x <0/1> data type: 0 = PacBio, 1 = Nanopore

-t <Integer> number of threads (CPUs)

-p <Integer> batch size that the reads will be partitioned

-r <Real> minimum mapping ratio

-a <Integer> minimum overlap size

-c <Integer> minimum coverage under consideration

-l <Integer> minimum length of corrected sequence

-k <Integer> number of partition files to open at one time (if < 0, then it will be set to system limit value)

-e <Integer> use cache or not: 0 = not use, 1 = use

-s <Integer> perform second-round overlapping or not: 0 = not perform, 1 = perform

-m <String> filter out top fraction repetitive minimizers of the second-round overlapping

-f <String> minimum overlap ratio used for the second-round overlapping filtering

-K <Integer> k-mer size or the second-round overlapping

-w <Integer> minimizer window size for the second-round overlapping

-H use homopolymer-compressed k-mer for the second-round overlapping

-R resuse long indel

-F full consensus

-h print usage info.

 

Default Options:

-t 1 -p 100000 -r 0.6 -a 1000 -c 4 -l 2000 -k 100 -e 1 -s 1 -m 0.0002 -f 0.6 -K 15 -w 5 -H

 

 

実行方法

PacBio

#small datasets
minimap2 -x ava-pb -w 20 -K 2g -t 20 reads.fq reads.fq | awk '{ if($4 - $3 >= 0.5 * $2 || $9 - $8 >= 0.5 * $7) print $0}' > ovlp.paf
Fec -t 20 -r 0.6 -a 1000 -c 4 -l 2000 ovlp.paf reads.fq corrected.fasta

#large datasets (人など)
minimap2 -x ava-pb -w 20 -K 2g -f 0.005 -t 20 reads.fq reads.fq | awk '{ if($4 - $3 >= 0.2 * $2 || $9 - $8 >= 0.2 * $7) print $0}' > ovlp.paf
Fec -t 20 -r 0.6 -a 1000 -c 4 -l 2000 -m 0.005 -f 0.2 ovlp.paf reads.fq corrected.fasta

注;Fecには非圧縮のシークエンシングリードを提供する必要がある。

 

Nanopore

#two round correction
minimap2 -x ava-ont -w 20 -K 2g -f 0.005 -t 20 ONT.fq ONT.fq | awk '{ if($4 - $3 >= 0.2 * $2 || $9 - $8 >= 0.2 * $7) print $0}' > ovlp.paf
Fec -x 1 -t 20 -r 0.6 -a 400 -c 0 -l 1000 -m 0.005 -f 0.2 ovlp.paf ONT.fq corrected1.fasta
minimap2 -x ava-ont -w 20 -K 2g -f 0.005 -t 20 corrected1.fasta corrected1.fasta | awk '{ if($4 - $3 >= 0.2 * $2 || $9 - $8 >= 0.2 * $7) print $0}' > ovlp2.paf
Fec -x 1 -R -t 20 -r 0.6 -a 1000 -c 4 -l 2000 -m 0.005 -f 0.2 ovlp2.paf corrected1.fasta corrected2.fasta
出力例

(ONT.fqが入力)

 

引用

Fec: a fast error correction method based on two-rounds overlapping and caching

Jun Zhang, Fan Nie, Neng Huang, Peng Ni, Feng Luo, Jianxin Wang

Bioinformatics. 2022 Aug 17

 

関連


 

 

ゲノムアセンブリ間でリードを素早くリマッピングする FastRemap

 

 ゲノムリードデータセットは、一般的に使用されている CrossMap ツールなどの様々なツールを用いて、あるリファレンスから別の類似したリファレンス(例えば、2つのバージョンの異なる間や2つの類似した種間)へ迅速かつ効率的に再マッピングすることができる。ゲノムデータセットとリファレンスが爆発的に増加している現在、高性能なリマッピングツールは、ゲノムアセンブリと解析の計算需要に対応するためにさらに重要になると思われる。ゲノムアセンブリ間でリードをリマップするための高速かつ効率的なツールFastRemapを提供する。FastRemapはCrossMapと比較して、最大7.19倍(平均5.97倍)の高速化と、61.7%(平均80.7%)のメモリ消費量の削減を実現した。FastRemapはC++で記述されている。ソースコードとユーザーマニュアルは以下の場所で自由に入手できる: github.com/CMU-SAFARI/FastRemap。

 

インストール

公開されているdocker imageを使ってテストした。

git clone --recurse-submodules https://github.com/CMU-SAFARI/FastRemap.git FastRemap
cd FastRemap/zlib/
./configure
make
cd ../

#docker(link)
docker pull alkanlab/fastremap:latest

> FastRemap

Usage: ./FastRemap [file_type] [chain file] [input file] [output unmapped file] [output file]

 

Positional arguments:

      [file_type]:            bam, sam, or bed file depending on input file

      [chain file]:           chain file (https://genome.ucsc.edu/goldenPath/help/chain.html) describes regions of similarity between references

      [input file]:           file containing elements to be remapped based on chain file

      [output unmapped file]: file containing all the elements that couldnt be remapped from the input file based on the provided chain file

      [output file]:          file containing all the remapped elements from the input file

 

Optional arguments:

      --append-tags (-a) to append tags in output bam file

      --mean (-m) to set insert size

      --stdev (-s) to set insert_size_stdev

      --times (-t) to set insert_size_fold

 

 

テストラン

remappingするファイルフォーマットの種類、リファレンス間の相同性を示したchainファイル、入力のbam、unmapになったリード、remappingされたリードの出力の順番に指定する。

cd FastRemap/test_data/
docker run -itv $PWD:/data -w /data --rm alkanlab/fastremap:latest bam ce6ToCe10.over.chain little.bam test.unmapped test.out

出力

 

引用

FastRemap: A Tool for Quickly Remapping Reads between Genome Assemblies Get access  Arrow
Jeremie S Kim,  Can Firtina,  Meryem Banu Cavlak,  Damla Senol Cali,  Can Alkan, Onur Mutlu
Bioinformatics, Published: 17 August 2022

 

 

 

関心のあるあらゆる生物のWGSデータセットに対して、SV、SNP、IN/DEL、およびCNVのコールとアノテーションを実行する PerSVade

2022/08/22 オプション追記

 

 構造バリアント(SV)はゲノムの変異の根底にあるものだが、ショートリードからの検出が困難なため、見落とされることがよくある。ほとんどのアルゴリズムはヒトでテストされており、他の生物にどの程度適用できるかはまだ不明である。この問題を解決するために、本著者らはサンプルに合わせたパイプラインであるperSVade(personalized structural variation detection)を開発し、最適にコールされたSVとその推定精度、さらにスモール変異やコピー数変異を提供する。PerSVadeは、6つの真核生物のベンチマークにおいて、SVの呼び出し精度を向上させた。最適なパラメータの普遍的なセットを見つけることができず、サンプル固有のパラメータ最適化の必要性を強調する。PerSVadeは、多様な生物におけるSVの検出と研究を促進する。

 

 

wiki

https://github.com/Gabaldonlab/perSVade/wiki

FAQ

https://github.com/Gabaldonlab/perSVade/wiki/8.-FAQs

 

インストール

配布されているdocker imageを使ってテストした。

Github

#docker(link)
docker pull mikischikora/persvade:v1.02.6

> docker run -i mikischikora/persvade:v1.02.6 scripts/perSVade --help

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

    perSVade: personalized Structural Variation detection

    This is a pipeline to call and annotate small variants, structural

variants (SVs) and/or coverage-derived copy number variants (CNVs)

    Find more information in https://github.com/Gabaldonlab/perSVade

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

 

    These are the available modules (see

https://github.com/Gabaldonlab/perSVade/wiki/1.-Pipeline-overview to

combine them):

 

        trim_reads_and_QC           Trimming (with trimmomatic) and

quality control (with fastqc) of the reads

                                    IMPORTANT: Check the output of

fastqc before using the trimmed reads for other analyses

 

        align_reads                 Align reads, mark duplicates and

calculate coverage per windows

        infer_repeats               Find repeats in a genome, which is

necessary for some of the modules below

        find_homologous_regions     Find regions with pairwise

homology in a genome

        find_knownSVs_regions       Find regions with perSVade-inferred SVs

        optimize_parameters         Find optimal parameters for SV

calling through simulations

        call_SVs                    Call structural variants (SVs)

with gridss and clove

        call_CNVs                   Call copy-number variants (CNVs)

based on coverage

        integrate_SV_CNV_calls      Integrate the variant calls of

'call_SVs' and 'call_CNVs' into a single .vcf file

        annotate_SVs                Annotate the fuctional impact of

the variants from 'integrate_SV_CNV_calls'

        call_small_variants         Call SNPs and small IN/DELs

        annotate_small_vars         Annotate the fuctional impact of

the variants from 'call_small_variants'

        get_cov_genes               Calculate the coverage for each

gene of the genome

 

    Usage:

 

        perSVade <module> <args>. Type 'perSVade <module> -h' for more

information on each of them.

 

 

テストラン

#docker使用時
git clone https://github.com/Gabaldonlab/perSVade.git
cd perSVade/
docker run -v $PWD/perSVade_testing_outputs:/perSVade/installation/test_installation/testing_outputs mikischikora/persvade:v1.02.6 python -u ./installation/test_installation/test_installation_modules.py

test_installation_modules.py スクリプトは、コンテナ内の /perSVade/installation/test_installation/testing_outputs 、ホスト側の./perSVade_testing_outputs内にデータを書き込む。1時間ほどかかる。s

出力例

 

 

実行方法

多段階のステップを得て、ペアエンドfastq、 リファレンスゲノム、 GTF形式のアノテーションファイルからperSVade のすべての可能な出力を取得する。fastqはgzip圧縮して提供することが推奨されている。以前は多段階のコマンドをまとめて実行することもできたが、エラーが発生しやすくて却ってフレンドリーでは無いため、現在は、ステップバイステップでコマンドを実行していく事が推奨されている。

 

1、リードのトリミングと品質管理

mkdir output
docker run -itv $PWD:/data --rm mikischikora/persvade:v1.02.6 python -u ./scripts/perSVade trim_reads_and_QC -f1 /data/read_1.fastq.gz -f2 /data/read_2.fastq.gz -o /data/output/trimmed_reads

出力例

2、リードアライメント

docker run -itv $PWD:/data --rm mikischikora/persvade:v1.02.6 python -u ./scripts/perSVade align_reads -f1 /data/output/trimmed_reads/trimmed_reads1.fastq.gz -f2 /data/output/trimmed_reads/trimmed_reads2.fastq.gz --ref /data/genome.fasta -o /data/output/aligned_reads --fraction_available_mem 0.5 -thr 16
  • --fraction_available_mem    This pipeline calculates the available RAM for several steps, and it may not work well in some systems (i.e. HPC clusters). This parameter allows you to correct possible errors. If --fraction_available_mem is not provided (default behavior), this pipeline will calculate the available RAM by filling the memory, which may give errors. If you want to use all the available memory you should specify --fraction_available_mem 1.0. See the FAQ 'How does the --fraction_available_mem work?' from https://github.com/Gabaldonlab/perSVade/wiki/8.-FAQs for more info.
  • -thr     Number of threads, Default: 16

 

出力例

 

3、リピートの推論

docker run -itv $PWD:/data --rm mikischikora/persvade:v1.02.6 python -u ./scripts/perSVade infer_repeats --ref /data/genome.fasta -o /data/output/repeat_inference --fraction_available_mem 0.5 -thr 16

出力例

 

4、SVの領域を定義する。

docker run -itv $PWD:/data --rm mikischikora/persvade:v1.02.6 python -u ./scripts/perSVade find_homologous_regions --ref /data/genome.fasta -o /data/output/find_hom_regions

docker run -itv $PWD:/data --rm mikischikora/persvade:v1.02.6 python -u ./scripts/perSVade find_knownSVs_regions -o /data/output/find_known_SVs --ref /data/genome.fasta --mitochondrial_chromosome chrM --SVcalling_parameters default --repeats_file skip --close_shortReads_table ./close_shortReads_table.tab

 

5、SVコールに最も適したフィルタリングパラメータを見つける。aligned_reads.bam.sortedがbamファイル。

docker run -itv $PWD:/data --rm mikischikora/persvade:v1.02.6 python -u ./scripts/perSVade optimize_parameters --ref /data/genome.fasta -o /data/output/parameter_optimization -sbam /data/output/aligned_reads/aligned_reads.bam.sorted --mitochondrial_chromosome chrM --repeats_file /data/output/repeat_inference/combined_repeats.tab --regions_SVsimulations random --simulation_ploidies haploid --fraction_available_mem 0.5 -thr 16

 

6、最適化されたパラメータでSVコールを実行。

docker run -itv $PWD:/data --rm mikischikora/persvade:v1.02.6 python -u ./scripts/perSVade call_SVs --ref /data/genome.fasta -o /data/output/call_SVs -sbam /data/output/aligned_reads/aligned_reads.sorted.bam --mitochondrial_chromosome chrM --SVcalling_parameters /data/output/parameter_optimization/optimized_parameters.json --repeats_file /data/output/repeat_inference/combined_repeats.tab --fraction_available_mem 0.5 -thr 16

 

7、カバレッジベースのCNVコールを実行((ウィンドウサイズ500bp、ハプロイドを想定)。

docker run -itv $PWD:/data --rm mikischikora/persvade:v1.02.6 python -u ./scripts/perSVade call_CNVs --ref /data/genome.fasta -o /data/output/call_CNVs -sbam /data/output/aligned_reads/aligned_reads.sorted.bam --mitochondrial_chromosome chrM -p 1 --cnv_calling_algs HMMcopy,AneuFinder --window_size_CNVcalling 500 --fraction_available_mem 0.5 -thr 16

 

8、SVとCNVのコールを1つの.vcfファイルに統合。

docker run -itv $PWD:/data --rm mikischikora/persvade:v1.02.6 python -u ./scripts/perSVade integrate_SV_CNV_calls -o /data/output/integrated_SV_CNV_calls --ref /data/genome.fasta --mitochondrial_chromosome chrM -p 1 -sbam /data/output/aligned_reads/aligned_reads.sorted.bam --outdir_callSVs /data/output/call_SVs --outdir_callCNVs /data/output/call_CNVs --repeats_file skip --fraction_available_mem 0.5 -thr 16

 

9、SVとCNVのコールを1つの.vcfファイルに統合。

docker run -itv $PWD:/data --rm mikischikora/persvade:v1.02.6 python -u ./scripts/perSVade annotate_SVs -o /data/output/annotate_SVs --ref /data/genome.fasta --mitochondrial_chromosome chrM -gff /data/annotations.gff -mcode 3 -gcode 1 --SV_CNV_vcf /data/output/integrated_SV_CNV_calls/SV_and_CNV_variant_calling.vcf --fraction_available_mem 0.5 -thr 16

 

10、3つのアルゴリズム(bcftools,freebayes,HaplotypeCaller)でSNPコールとindelコールを実行。

docker run -itv $PWD:/data --rm mikischikora/persvade:v1.02.6 python -u ./scripts/perSVade call_small_variants -o /data/output/small_vars --ref /data/genome.fasta -p 1 -sbam /data/output/aligned_reads/aligned_reads.sorted.bam --repeats_file /data/output/repeat_inference/combined_repeats.tab --callers bcftools,freebayes,HaplotypeCaller --min_AF 0.9 --min_coverage 20 --fraction_available_mem 0.5 -thr 16

 

12、11で生成されたスモールバリアントの機能的アノテーションを実行(標準gDNA遺伝暗号と酵母ミトコンドリア暗号を想定)。

docker run -itv $PWD:/data --rm mikischikora/persvade:v1.02.6 python -u ./scripts/perSVade annotate_small_vars -o /data/output/annotate_small_vars --ref /data/genome.fasta --mitochondrial_chromosome chrM -gff /data/annotations.gff -mcode 3 -gcode 1 --merged_vcf /data/output/small_vars/merged_vcfs_allVars_ploidy1.vcf --fraction_available_mem 0.5 -thr 16

 

13、遺伝子ごとのカバレッジを計算。

docker run -itv $PWD:/data --rm mikischikora/persvade:v1.02.6 python -u ./scripts/perSVade get_cov_genes -o output/get_cov_genes --ref /data/genome.fasta -gff /data/annotations.gff -sbam /data/output/aligned_reads/aligned_reads.sorted.bam --fraction_available_mem 0.5 -thr 16

 

すべての結果はoutput/に書き込まれる。

作成中

引用

PerSVade: personalized structural variant detection in any species of interest
Miquel Àngel Schikora-Tamarit & Toni Gabaldón 
Genome Biology volume 23, Article number: 175 (2022) 

 

関連


 

シングルブレイクエンドバリアントと構造バリアントのフェージングにより体細胞構造変異の包括的な評価を行う GRIDSS2

 

 GRIDSS2 は、片側のみが明確に決定できるブレイクポイントであるシングルブレイクエンドを明示的に報告する初めての構造的バリアントコーラーである。シングルブレイクエンドをブレイクポイントと同様に基本的なゲノムリアレンジメントシグナルとして扱うことで、GRIDSS2は、非セントロメア配列へのシングルブレイクエンドを用いて体細胞セントロメアのコピー数変化の47%を説明することができる。3782個の詳細な塩基配列を持つ転移性ガンのコホートにおいて、GRIDSS2は3.1%の偽陰性率と3.3%の偽発見率を達成し、32-100 bp重複の新規シグネチャを同定した。GRIDSS2は、ペアエンドシーケンスを用いて16%の体細胞コールをフェージングでき、構造的バリアントのフェージングによる複雑なリシークエンシングの解釈を簡素化する。

 

”シングルブレイクポイントは、片側だけが明確に配置できるブレイクポイントです。Single breakendsは5年以上前からVCFの仕様にありましたが、今まで実際に呼び出すツールがなかった。シングルブレイクポイントを呼び出さないことで、ブレイクポイントコーラーは情報を破棄し、不必要にFNRを増加させていました。”

 

Quick start guide

https://github.com/PapenfussLab/gridss/blob/master/QuickStart.md

 

インストール

レポジトリではあまり推奨されていないが、condaを使って導入した。

依存

To run GRIDSS the following must be installed:

  • java 1.8 or later
  • R 4.0 or later

gridss_somatic_filter and gridss_extract_overlapping_fragments require the

  • following R libraries:
  • argparser
  • tidyverse
  • stringdist
  • testthat
  • stringr
  • StructuralVariantAnnotation
  • rtracklayer
  • BSgenome package for your reference genome (optional)
  • samtools 1.13 or later
  • bwa
  • bash
  • getopt(1) (part of util-linux)

Github

 

#conda(link)
mamba create -n gridss gridss
conda activate gridss

> gridss

Using working directory "."

Wed Aug 17 01:25:09 JST 2022: Full log file is: ./gridss.full.20220817_012509.kazu.34568.log

Wed Aug 17 01:25:09 JST 2022: Found /usr/bin/time

Wed Aug 17 01:25:09 JST 2022: Using GRIDSS jar /home/kazu/mambaforge/envs/gridss/share/gridss-2.13.2-1/gridss.jar

Wed Aug 17 01:25:09 JST 2022: Using reference genome ""

Wed Aug 17 01:25:09 JST 2022: 

Usage: gridss [options] -r <reference.fa> -o <output.vcf.gz> -a <assembly.bam> input1.bam [input2.bam [...]]

 

    -r/--reference: reference genome to use.

    -o/--output: output VCF.

    -a/--assembly: location of the GRIDSS assembly BAM. This file will be

        created by GRIDSS.

    -t/--threads: number of threads to use. (Default: 8)

    -j/--jar: location of GRIDSS jar

    -w/--workingdir: directory to place GRIDSS intermediate and temporary files

        .gridss.working subdirectories will be created. (Default: .)

    -b/--blacklist: BED file containing regions to ignore

    -s/--steps: processing steps to run. Defaults to all steps.

        Multiple steps are specified using comma separators.

        Possible steps are:

        setupreference, preprocess, assemble, call, all

        WARNING: multiple instances of GRIDSS generating reference

        files at the same time will result in file corruption.

        Make sure these files are generated before runninng parallel

        GRIDSS jobs.

    -c/--configuration: configuration file use to override default GRIDSS

        settings.

    -l/--labels: comma separated labels to use in the output VCF for the input

        files. Supporting read counts for input files with the same label are

        aggregated (useful for multiple sequencing runs of the same sample).

        Labels default to input filenames, unless a single read group with a

        non-empty sample name exists in which case the read group sample name

        is used (which can be disabled by "useReadGroupSampleNameCategoryLabel=false"

        in the configuration file). If labels are specified, they must be

        specified for all input files.

    --externalaligner: use the system version of bwa instead of the in-process

        version packaged with GRIDSS (default)

    --internalaligner: use the in-process version of bwa instead of system

        version. Faster but alignment results can change between runs.

    --jvmheap: size of JVM heap for the high-memory component of assembly and

        variant calling. (Default: 30g)

    --otherjvmheap: size of JVM heap for everything else. Useful to prevent

        java out of memory errors when using large (>4Gb) reference genomes.

        Note that some parts of assembly and variant calling use this heap

        size. (Default: 4g)

    --skipsoftcliprealignment: [EXPERIMENTAL] skip soft clip realignment.

        Reduces runtime for aligners that report split read alignments.

    --maxcoverage: maximum coverage. Regions with coverage in excess of this

        are ignored. (Default: 50000)

    --picardoptions: additional standard Picard command line options. Useful

        options include VALIDATION_STRINGENCY=LENIENT and COMPRESSION_LEVEL=0.

        https://broadinstitute.github.io/picard/command-line-overview.html

    --useproperpair: use SAM 'proper pair' flag to determine whether a read

        pair is discordant. Default: use library fragment size distribution to

        determine read pair concordance.

    --concordantreadpairdistribution: portion of 6 sigma read pairs distribution

        considered concordantly mapped. (Default: 0.995)

    --keepTempFiles: keep intermediate files. Not recommended except for

        debugging due to the high disk usage.

    --nojni: do not use JNI native code acceleration libraries JNI libraries:

        snappy, GKL, ssw, bwa

    --jobindex: zero-based assembly job index. Only required when performing

        parallel assembly across multiple processes.

    --jobnodes: total number of assembly jobs. Only required when performing

        parallel assembly across multiple processes.

    

Wed Aug 17 01:25:09 JST 2022: Reference genome must be specified. Specify using the --reference command line argument

"exit $EX_USAGE" command completed with exit code 64.

*****

The underlying error message can be found in ./gridss.full.20220817_012509.kazu.34568.log

*****

 

 

実行方法

リファレンスとbwa memで作成したbamファイル(-aオプションは付けない事)を指定する。

gridss --reference reference.fa --output output.vcf.gz --threads 20 --assembly assembly.bam --workingdir workdir --steps All -b exclude_list.bed --labels input1,input2,... input1.bam input2.bam [...]

出力例

 

詳細はレポジトリのFAQなどを確認して下さい。詳しく説明されています。

引用

GRIDSS2: comprehensive characterisation of somatic structural variation using single breakend variants and structural variant phasing
Daniel L. Cameron, Jonathan Baber, Charles Shale, Jose Espejo Valle-Inclan, Nicolle Besselink, Arne van Hoeck, Roel Janssen, Edwin Cuppen, Peter Priestley & Anthony T. Papenfuss 
Genome Biology volume 22, Article number: 202 (2021)