1、SPAdes簡(jiǎn)介
1.1 支持的數(shù)據(jù)類型
當(dāng)前版本的SPAdes,輸入文件可以是Illumina或者IonTorrent數(shù)據(jù)并且,可以結(jié)合PacBio的數(shù)據(jù)進(jìn)行組裝。
SPAdes的3.8.2版本,支持paired-end reads, mate-pairs and unpaired reads。多個(gè)paired-end 和mate-pair文庫的數(shù)據(jù)可以同時(shí)輸入。SPAdes最初開發(fā)的目的適用于小的基因組組裝,測(cè)試都是基于單細(xì)胞和標(biāo)準(zhǔn)的細(xì)菌及真菌數(shù)據(jù)。
SPAdes 3.8.2版本,包含有一個(gè)宏基因組分析流程metaSPAdes和一個(gè)從WGS中提取和組裝質(zhì)粒的流程plasmidSPAdes,另外,SPAdes 有獨(dú)立的組裝多倍體雜合基因和TruSeq barcode組裝的模塊。
1.2 SPAdes 流程
SPAdes有一些單獨(dú)的模塊:
a. BayesHammer---用于Illumina reads的read error correction 工具
b. IonHammer--- 用于IonTorrent 數(shù)據(jù)的reads error correction 工具
c. SPAdes---迭代 short-read 基因組組裝模塊;K值根據(jù)read 長(zhǎng)度自動(dòng)選擇
d. MismatchCorrector--- 用于改善組裝得到的contigs和scaffolds中的mismatch 和short indel率的工具
e. dipSPAdes---組裝多倍體雜合基因組的分析模塊
f. truSPAdes---用于Illumina 產(chǎn)生的short reads的組裝
推薦使用 BayesHammer/IonHammer 來獲取高質(zhì)量的組裝結(jié)果。
2. SPAdes的安裝
系統(tǒng)要求:
(1) 64-bit Linux
(2) 安裝Python (支持的版本有2.4,2.5,2.6, 2.7, 3.2, 3.3, 3.4 和 3.5)
下載地址:http://spades.bioinf.spbau.ru/release3.8.2/SPAdes-3.8.2-Linux.tar.gz 下載后解壓即可:
tar -xzf SPAdes-3.8.2-Linux.tar.gz
cd SPAdes-3.8.2-Linux/bin/
測(cè)試是否可以正常運(yùn)行:
./spades.py --test
如果輸出的信息最后為:
===== Assembling finished. * Corrected reads are in spades_test/corrected/ * Assembled contigs are in spades_test/contigs.fasta * Assembled scaffolds are in spades_test/scaffolds.fasta======= SPAdes pipeline finished.SPAdes log can be found here: /home/andrey/ablab/algorithmic-biology/assembler/spades_test/spades.logThank you for using SPAdes!
則說明軟件可以正常運(yùn)行。
3. SPAdes的使用
3.1 輸入文件
輸入文件可以是paired-end reads, mate-pairs and single (unpaired) reads in FASTA and FASTQ。對(duì)于IonTorrent 數(shù)據(jù)輸入文件可以是unmapped BAM 文件。然而,如果要做error correction, reads應(yīng)該是FASTQ 或者 BAM文件格式。
Illumina 數(shù)據(jù)和IonTorrent 文庫的數(shù)據(jù)不能放在一起組裝,其他類型的輸入文件可以放在一起。
SPAdes 支持僅有 mate-pair的組裝,然而,此時(shí)我們推薦使用高質(zhì)量的mate-pair文庫。
注意:
1. 不推薦使用SPAdes進(jìn)行覆蓋度太低(小于5x)的PacBio reads 組裝
2. 不推薦使用SPAdes軟件進(jìn)行大基因組的PacBio reads組裝
3. SPAdes輸入文件可以是壓縮文件
PacBio 和 Oxford Nanopore reads
對(duì)于PacBio CLR 和 Oxford Nanopore reads 用于混合組裝(例如:結(jié)合Illumina 或者 IonTorrent數(shù)據(jù)),此時(shí)不需要reads糾錯(cuò),SPAdes 將使用PacBio CLR 和 Oxford Nanopore reads 用于 gap closure 和處理重復(fù)。
對(duì)于PacBio 的數(shù)據(jù)需要是過濾后的subreads,文件格式為 FASTQ/FASTA格式,參數(shù)為--pacbio。
3.2 Examples
/home/novelbio/software/SPAdes-3.8.2-Linux/bin/spades.py --pe1-1 /home/novelbio/software/SPAdes-3.8.2-Linux/share/spades/test_dataset/ecoli_1K_1.fq.gz --pe1-2 /home/novelbio/software/SPAdes-3.8.2-Linux/share/spades/test_dataset/ecoli_1K_2.fq.gz -o spades_test
(1)如果同一文庫有多個(gè)文件的時(shí)候,使用方法如下:
spades.py --pe1-1 lib1_forward_1.fastq --pe1-2 lib1_reverse_1.fastq --pe1-1 lib1_forward_2.fastq --pe1-2 lib1_reverse_2.fastq -o spades_output
注意順序要一致
(2)當(dāng)輸入文件是interlacing paired-end reads 或者 unpaired reads時(shí)
spades.py --pe1-12 lib1_1.fastq --pe1-12 lib1_2.fastq --pe1-s lib1_unpaired_1.fastq --pe1-s lib1_unpaired_2.fastq -o spades_output
(3)當(dāng)輸入文件是一些paired-end 和 mate-pair reads時(shí),
paired-end library 1
lib_pe1_left.fastq
lib_pe1_right.fastq
mate-pair library 1
lib_mp1_left.fastq
lib_mp1_right.fastq
mate-pair library 2
lib_mp2_left.fastq
lib_mp2_right.fastq
此時(shí),使用的命令為:
spades.py --pe1-1 lib_pe1_left.fastq --pe1-2 lib_pe1_right.fastq --mp1-1 lib_mp1_left.fastq --mp1-2 lib_mp1_right.fastq --mp2-1 lib_mp2_left.fastq --mp2-2 lib_mp2_right.fastq -o spades_output
(4)當(dāng)有IonTorrent unpaired reads, PacBio CLR和 相應(yīng)的contigs時(shí)
使用的命令為:
spades.py --iontorrent -s it_reads.fastq --pacbio pacbio_clr.fastq --trusted-contigs contigs.fastq -o spades_output
(5)當(dāng)single-read library 有多個(gè)單獨(dú)的文件時(shí)
使用的命令為:
spades.py --s1 unpaired1_1.fastq --s1 unpaired1_2.fastq --s1 unpaired1_3.fastq -o spades_output
(6)組裝IonTorrent reads
輸入格式僅支持FASTQ或者BAM文件。對(duì)于IonTorrent數(shù)據(jù),k-mer值的選擇非常重要,如果數(shù)據(jù)集覆蓋度足夠,GC含量不高,那么推薦按照long reads的組裝方式(e.g. 組裝使用k-mer長(zhǎng)度 21,33,55,77,99,127)。然而,由于k-mer長(zhǎng)度改變會(huì)引起錯(cuò)誤率的變化,例如,如果運(yùn)行SPAdes時(shí),設(shè)置k-mer長(zhǎng)度為21,33,55,77,然后,使用迭代和更大的k-mer值進(jìn)行組裝,可以使用參數(shù),-restart-from k77 -k 21,33,55,77,99,127 --mismatch-correction -o.
對(duì)于特殊的數(shù)據(jù)集(e.g. 高GC,低覆蓋度或者覆蓋度不均勻),我們建議使用single-cell 模式(設(shè)置--sc 選項(xiàng))并使用k-mer的長(zhǎng)度為21,33,55
(7)組裝long Illumina paired reads(2x150 and 2x250)
設(shè)置迭代的k-mer值,推薦設(shè)置--careful 選項(xiàng),用來減少最終contigs的mismatches數(shù)。
不做reads corrected 的組裝: spades.py -k 21,33,55,77 --careful --only-assembler-o spades_output
做reads correct 并組裝:spades.py -k 21,33,55,77 --careful-o spades_output
single-cell data set with read lengths 2x150 or 2x250
推薦使用默認(rèn)的k-mer值,對(duì)于single-cell data set SPAdes 選擇的k-mer size 21,33,55。
4. SPAdes 的輸出
/corrected/ 存放使用BayesHammer糾錯(cuò)后的reads,文件名為 *.fastq.gz或者*.fastq
/contigs.fasta contains resulting contigs 組裝的contigs序列文件
/scaffolds.fasta contains resulting scaffolds 組裝得到的scaffolds序列文件
/assembly_graph.fastg contains SPAdes assembly graph in FASTG format SPAdes組裝graph,以FASTG格式存儲(chǔ)
/contigs.paths contains paths in the assembly graph corresponding to contigs.fasta (see details below)
/scaffolds.paths contains paths in the assembly graph corresponding to scaffolds.fasta (see details below)
序列ID說明:
>NODE_3_length_237403_cov_243.207_ID_45
3 表示 contig/scaffold的順序號(hào);237403 表示序列長(zhǎng)度; 243.207 表示k-mer的覆蓋深度(一般情況下會(huì)低于read的覆蓋深度)
組裝結(jié)果評(píng)估:
可以使用QUAST 軟件進(jìn)行結(jié)果的統(tǒng)計(jì)(N50,maximum contig length,GC% 等)
PREFIX=/ /bin/software/SPAdes-3.10.1/spades_compile.sh
taskSPAdes-dataTypetaskSPAdes-dataType
datadict_getlsDataValues/taskSPAdes-dataType
SPAdes v3.10.1 詳細(xì)參數(shù)
SPAdes genome assembler v3.10.1
Usage: /home/novelbio/bianlianle/software/BacteriaAssemble/SPAdes-3.10.1-Linux/bin/spades.py [options] -o
Basic options:
-odirectory to store all the resulting files (required)
--sc this flag is required for MDA (single-cell) data
--meta this flag is required for metagenomic sample data
--rna this flag is required for RNA-Seq data
--plasmid runs plasmidSPAdes pipeline for plasmid detection
--iontorrent this flag is required for IonTorrent data
--test runs SPAdes on toy dataset
-h/--help prints this usage message
-v/--version prints version
Input data:
--12file with interlaced forward and reverse paired-end reads
-1file with forward paired-end reads
-2file with reverse paired-end reads
-sfile with unpaired reads
--pe<#>-12file with interlaced reads for paired-end library number <#> (<#> = 1,2,..,9)
--pe<#>-1file with forward reads for paired-end library number <#> (<#> = 1,2,..,9)
--pe<#>-2file with reverse reads for paired-end library number <#> (<#> = 1,2,..,9)
--pe<#>-sfile with unpaired reads for paired-end library number <#> (<#> = 1,2,..,9)
--pe<#>-orientation of reads for paired-end library number <#> (<#> = 1,2,..,9;= fr, rf, ff)
--s<#>file with unpaired reads for single reads library number <#> (<#> = 1,2,..,9)
--mp<#>-12file with interlaced reads for mate-pair library number <#> (<#> = 1,2,..,9)
--mp<#>-1file with forward reads for mate-pair library number <#> (<#> = 1,2,..,9)
--mp<#>-2file with reverse reads for mate-pair library number <#> (<#> = 1,2,..,9)
--mp<#>-sfile with unpaired reads for mate-pair library number <#> (<#> = 1,2,..,9)
--mp<#>-orientation of reads for mate-pair library number <#> (<#> = 1,2,..,9;= fr, rf, ff)
--hqmp<#>-12file with interlaced reads for high-quality mate-pair library number <#> (<#> = 1,2,..,9)
--hqmp<#>-1file with forward reads for high-quality mate-pair library number <#> (<#> = 1,2,..,9)
--hqmp<#>-2file with reverse reads for high-quality mate-pair library number <#> (<#> = 1,2,..,9)
--hqmp<#>-sfile with unpaired reads for high-quality mate-pair library number <#> (<#> = 1,2,..,9)
--hqmp<#>-orientation of reads for high-quality mate-pair library number <#> (<#> = 1,2,..,9;= fr, rf, ff)
--nxmate<#>-1file with forward reads for Lucigen NxMate library number <#> (<#> = 1,2,..,9)
--nxmate<#>-2file with reverse reads for Lucigen NxMate library number <#> (<#> = 1,2,..,9)
--sangerfile with Sanger reads
--pacbiofile with PacBio reads
--nanoporefile with Nanopore reads
--tslrfile with TSLR-contigs
--trusted-contigsfile with trusted contigs
--untrusted-contigsfile with untrusted contigs
Pipeline options:
--only-error-correction runs only read error correction (without assembling)
--only-assembler runs only assembling (without read error correction)
--careful tries to reduce number of mismatches and short indels
--continue continue run from the last available check-point
--restart-fromrestart run with updated options and from the specified check-point ('ec', 'as', 'k', 'mc')
--disable-gzip-output forces error correction not to compress the corrected reads
--disable-rr disables repeat resolution stage of assembling
Advanced options:
--datasetfile with dataset description in YAML format
-t/--threadsnumber of threads
[default: 16]
-m/--memoryRAM limit for SPAdes in Gb (terminates if exceeded)
[default: 250]
--tmp-dirdirectory for temporary files
[default:/tmp]
-k
less than 128) [default: 'auto']
--cov-cutoffcoverage cutoff value (a positive float number, or 'auto', or 'off') [default: 'off']
--phred-offsetPHRED quality offset in the input reads (33 or 64)
[default: auto-detect]