macでインフォマティクス

macでインフォマティクス

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

既存のシークエンスデータからリアルな人工メタゲノムを生成する SEQ2MGS

 

 全ゲノムシークエンスデータからメタゲノム解析のためのバイオインフォマティクスツールの評価には、現実的なベンチマークセットが必要である。本著者らは、実シーケンス実験から人工メタゲノムを効率的かつ簡便に生成するツールを開発した。このツール(SEQ2MGS)は、入力されたFASTQファイルを解析し、ゲノムコンテンツを事前に計算し、実際のメタゲノム中の異なる配列の単離株やスパイク単離株からのショットガンリードを任意の割合でブレンドする。SEQ2MGS は、シーケンスプラットフォームのバリエーション、リードの分布、プラスミドやウイルスの存在、コンタミネーションなどのシミュレーションを不要にする。このツールは、アセンブルされたゲノムがなくても、新しい生物や研究されていない生物を含む複数の複雑なサンプルを迅速に生成する場合に特に有効である。まず、de novo メタゲノム生成ツール Grinder および CAMISIM と比較して、ASF (altered Schaedler flora) のシミュレーションに SEQ2MGS を使用した場合の使いやすさを説明する。次に、ヒトの腸内細菌叢における病原体の出現をエミュレートしたところ、Kraken、Centrifuge、MetaPhlAnは、Klebsiella pneumoniaeを正しく同定したものの、残りのリアルメタゲノムについては一貫性のない結果を出すことが確認された。最後に、MG-RASTプラットフォームを用いて、SEQ2MGSが単離株のゲノム情報を模擬メタゲノムに正しく転送することを、オリジナルメタゲノムと比較して出現が予想される抗生物質耐性遺伝子を正しく同定することによって確認した。

 

tutorial

https://github.com/pieterjanvc/seq2mgs/blob/master/tutorial.md

 

インストール

mambaで環境を作ってテストした。

依存

  • SQLite3
  • R version 4.0+
    Packages: RSQLite, tidyverse (dplyr 1.0+), jsonlite, httr
  • bbmap
  • sratoolkit
    OPTIONAL
  • pigz

pigz
If installed, faster zipping with multi-cores

Github

#依存するツール
mamba create -n seq2mgs python=3.10 -y
conda activate seq2mgs
mmaba install -c conda-forge -c bioconda -c r r-tidyverse -y
mmaba install -c bioconda bbmap -y
mmaba install -c anaconda sqlite -y

git clone https://github.com/pieterjanvc/seq2mgs.git
cd seq2mgs/

> setup.sh -t #依存するツールの検証 + テストラン(-t)

注;ここではSRA tool kitは入れていない。SRAのシークエンスデータを指定してシミュレートするなら必要

>  seq2mgs.sh -h

$ ./seq2mgs.sh

 

 

--- SEQ2MGS.SH ---

Mix multiple sequencing fastq.gz files together to create artificial metagenomes

 

See the tutorial.md file for examples on setup and running the pipeline.

https://github.com/pieterjanvc/seq2mgs/blob/master/tutorial.md

 

Arguments [h|i|o|l|u|a|b|d|m|t|f|v]

 -h Read the help documentation

 

# Required

 -i The input file (.csv) containing all samples to be mixed (details see below)

 -o The location to save the output file. Filename should end with fastq.gz

 

# Optional

 -d (optional) Change default value of the genomeSize column in the input file.

     Default can also be changed in the settings.txt file

 -m (optional) TRUE or FALSE.

     Generate a meta-data JSON file in the same folder as the output file.

     Default can be changed in the settings.txt file

 -f (optional) If set, force overwriting an existing output file

 -v (optional) TRUE or FALSE. Progress is posted to stdout when TRUE.

     Default can be changed in the settings.txt file

 

# File size limits for relative abundance (optional)

 -l (optional) The min number of bases the mixed file should contain

 -u (optional) The max number of bases the mixed file should contain

 

   By default, file size is defined by the number of bases in the background

    file. If no background file is present, file size is defined as the maximum

    number of reads that can be used from each file without resampling

 

# Background limits for coverage (optional)

 -a (optional) The min number of bases the background should contain

 -b (optional) The max number of bases the background should contain

 

  By default, the number of bases is the difference between the

   bases used for the isolates and the bases in the original background.

   Note that when no backgound is present, the file size is dependent on the

   coverage settings and cannot be changed otherwise

 

 

### INPUT FILE FORMAT ###

 

This is a comma separated CSV file with the following columns

 - type: either I for isolate file or B for background file

   * Minimum of 2 I files if no B file

   * Max 1 B file with 1 or more I files

 - sampleName (optional): custom name for the different input files

 - genomeSize (optional): The size of each genome in bp (e.g. 3.7e6) needed to

    calculate correct genome coverage. If not set or missing values, defaults to

    value of argument -d. The value is left blank for background files (B) or

    when working with relative abundance (column not needed)

 

 DEPENDING ON PREFERENCE EITHER

  - relativeAbundance: RA of the file in the final metagenome (0-1).

     The sum of all must be 1.0 if only isolates

     The sum must be < 1 when there is a background (RA is calculated)

  OR

  - coverage: The times a genome should be covered

  NOTE: background files (B) can have empty values

 

 DEPENDING ON PREFERENCE EITHER

 - readFile: full path to the first read file (fastq.gz format)

 - readFile2: full path to the second read file (fastq.gz format)

    Leave empty in case of 1 data file

  OR

 - getFromSRA: fill in the SRR (leave readFile/readFile2 blank)

    The file will be downloaded from SRA if not found in the

    default download folder (location can be changed in settings.txt)

 

 NOTE: any other columns will be ignored, but kept as meta-data

 

EXAMPLE CSV FILE

```

type,sampleName,relativeAbundance,readFile,readFile2,getFromSRA

I,isolate_1,0.1,/path/isolate1_1.fastq.gz,/path/isolate1_2.fastq.gz,

I,isolate_2,0.3,,,SRR3222075

B,background,,,/path/metagenome.fastq.gz,,

```

 

isolate_1: RA 10%, 2 local input files

isolate_2: Grab file from SRA, RA 30%

background: RA not required, 1 local input file

 

More examples  can be found in the tutorial.md file or at

https://github.com/pieterjanvc/seq2mgs/blob/master/tutorial.md

 

-- END SEQ2MGS.SH ---

 

 

 

テストラン

ランするには菌のシークエンシングリードのパスを記載したCSVファイルが必要。テストデータではSEQ2MGSのルートのdataAndScripts/testData/に配置されている。

1列名はtype。単離(isolate)ゲノムでは'I'で、バックグラウンドは'B'。バックグラウンドファイルは1つだけ必要で、1つもない場合は最低2つの単離ファイルが必要。2列目のsampleNameは名前。3列目のrelativeAbundanceは相対的な存在量。4列目のreadFileはフルパスでfastqの1つ目のパスを記載する。1つ目の菌データはペアエンドなのでreadFile2(ここでは5列目)に2つ目のリードのパスを記載する。シングルエンドでは空白となる。SRAのリードを使いたいなら、getFromSRA列にIDを指定する。ほかにもcoverageやgenomeSizeが使用できる。relativeAbundanceを外してgenomeSizeとcoverageを指定すれば、菌それぞれデプスを調整できる(relativeAbundanceとcoverageは排他関係にある。チュートリアル参照)。Bでバックグランドファイルを使用する場合、カバレッジとゲノムサイズは空白にする(無視される)。

 

CSVファイルと出力名を指定する。拡張子は.fastq.gzでなければならない。

seq2mgs.sh -i dataAndScripts/testData/input.csv -o output.fastq.gz

output.fastq.gzが出力される。テストデータは小さいので5秒ほどで終了した。

 

引用

SEQ2MGS: an effective tool for generating realistic artificial metagenomes from the existing sequencing data
Pieter-Jan Van Camp, Aleksey Porollo

NAR Genom Bioinform. 2022 Jul 25;4(3)

 

関連