File: manual.html

package info (click to toggle)
spades 3.15.5%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 96,896 kB
  • sloc: cpp: 850,748; ansic: 156,813; python: 23,134; perl: 4,547; sh: 2,352; makefile: 1,273; java: 890; pascal: 875; xml: 19
file content (879 lines) | stat: -rw-r--r-- 88,343 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
<html>     <head>         <title>SPAdes 3.15.5 Manual</title>         <style type="text/css">             .highlight  pre {               background-color: #f0f2f4;               border-radius: 2px;               font-size: 100%;               line-height: 1.45;               overflow: auto;               padding: 16px;             }         </style>     </head>     <body><p dir="auto"></p>
<p dir="auto"><strong>SPAdes 3.15.5 Manual</strong></p>
<ol dir="auto">
<li><a href="#sec1">About SPAdes</a> <br>
1.1. <a href="#sec1.1">Supported data types</a><br>
1.2. <a href="#sec1.2">SPAdes pipeline</a><br>
1.3. <a href="#sec1.3">SPAdes performance</a><br></li>
<li><a href="#sec2">Installation</a><br>
2.1. <a href="#sec2.1">Downloading SPAdes Linux binaries</a><br>
2.2. <a href="#sec2.2">Downloading SPAdes binaries for Mac</a><br>
2.3. <a href="#sec2.3">Downloading and compiling SPAdes source code</a><br>
2.4. <a href="#sec2.4">Verifying your installation</a><br></li>
<li><a href="#sec3">Running SPAdes</a><br>
3.1. <a href="#sec3.1">SPAdes input</a><br>
3.2. <a href="#sec3.2">SPAdes command line options</a><br>
3.3. <a href="#sec3.3">Assembling IonTorrent reads</a><br>
3.4. <a href="#sec3.4">Assembling long Illumina paired reads (2x150 and 2x250)</a><br>
3.5. <a href="#hmm">HMM-guided mode</a><br>
3.6. <a href="#spadesoutput">SPAdes output</a><br>
3.7. <a href="#plasmidout">plasmidSPAdes output</a><br>
3.8. <a href="#metapv">metaplasmidSPAdes and metaviralSPAdes output</a><br>
3.9. <a href="#bgc">biosyntheticSPAdes output</a><br>
3.10. <a href="#eval">Assembly evaluation</a><br></li>
<li><a href="#sec4">Stand-alone binaries released within SPAdes package</a><br>
4.1. <a href="#sec4.1">k-mer counting</a><br>
4.2. <a href="#sec4.2">k-mer coverage read filter</a><br>
4.3. <a href="#sec4.3">k-mer cardinality estimating</a><br>
4.4. <a href="#sec4.4">Graph construction</a><br>
4.5. <a href="#sec4.5">Long read to graph alignment</a><br>
4.5.1. <a href="#sec4.5.1">hybridSPAdes aligner</a><br>
4.5.2. <a href="#sec4.5.2">SPAligner</a><br></li>
<li><a href="#sec5">Citation</a><br></li>
<li><a href="#sec6">Feedback and bug reports</a><br></li>
</ol>
<p dir="auto"><a name="sec1"></a></p>
<h1 dir="auto">About SPAdes</h1>
<p dir="auto">SPAdes - St. Petersburg genome assembler - is an assembly toolkit containing various assembly pipelines. This manual will help you to install and run SPAdes. SPAdes version 3.15.5 was released under GPLv2 on July 14th, 2022 and can be downloaded from <a href="http://cab.spbu.ru/software/spades/" rel="nofollow">http://cab.spbu.ru/software/spades/</a>.</p>
<p dir="auto">The latest SPAdes paper describing various pipelines in a protocol format is available <a href="https://currentprotocols.onlinelibrary.wiley.com/doi/abs/10.1002/cpbi.102" rel="nofollow">here</a>.</p>
<p dir="auto"><a name="sec1.1"></a></p>
<h2 dir="auto">Supported data types</h2>
<p dir="auto">The current version of SPAdes works with Illumina or IonTorrent reads and is capable of providing hybrid assemblies using PacBio, Oxford Nanopore and Sanger reads. You can also provide additional contigs that will be used as long reads.</p>
<p dir="auto">Version 3.15.5 of SPAdes supports paired-end reads, mate-pairs and unpaired reads. SPAdes can take as input several paired-end and mate-pair libraries simultaneously. Note, that SPAdes was initially designed for small genomes. It was tested on bacterial (both single-cell MDA and standard isolates), fungal and other small genomes. SPAdes is not intended for larger genomes (e.g. mammalian size genomes). For such purposes you can use it at your own risk.</p>
<p dir="auto">If you have high-coverage data for bacterial/viral isolate or multi-cell organism, we highly recommend to use <a href="#isolate"><code class="notranslate">--isolate</code></a> option.</p>
<p dir="auto">SPAdes 3.15.5 includes the following additional pipelines:</p>
<ul dir="auto">
<li>metaSPAdes - a pipeline for metagenomic data sets (see <a href="#meta">metaSPAdes options</a>).</li>
<li>plasmidSPAdes - a pipeline for extracting and assembling plasmids from WGS data sets (see <a href="#plasmid">plasmid options</a>).</li>
<li>metaplasmidSPAdes - a pipeline for extracting and assembling plasmids from <em>metagenomic</em> data sets (see <a href="#plasmid">plasmid options</a>).</li>
<li>rnaSPAdes - a <em>de novo</em> transcriptome assembler from RNA-Seq data (see <a href="rnaspades_manual.html">rnaSPAdes manual</a>).</li>
<li>biosyntheticSPAdes - a module for biosynthetic gene cluster assembly with paired-end reads (see <a href="#biosynthetic">biosynthicSPAdes options</a>).</li>
<li>rnaviralSPAdes - a <em>de novo</em> assembler tailored for RNA viral datasets (transcriptome, metatranscriptome and metavirome).</li>
<li>coronaSPAdes is a special mode of rnaviralSPAdes specifically aimed for SARS-CoV-2 <em>de novo</em> assembly.</li>
<li>truSPAdes - (DEPRECATED) a module for TruSeq barcode assembly (see <a href="truspades_manual.html">truSPAdes manual</a>).</li>
</ul>
<p dir="auto">In addition, we provide several stand-alone binaries with relatively simple command-line interface: <a href="#sec4.1">k-mer counting</a> (<code class="notranslate">spades-kmercounter</code>), <a href="#sec4.2">assembly graph construction</a> (<code class="notranslate">spades-gbuilder</code>) and <a href="#sec4.3">long read to graph aligner</a> (<code class="notranslate">spades-gmapper</code>). To learn options of these tools you can either run them without any parameters or read <a href="#sec4">this section</a>.</p>
<p dir="auto"><a href=""></a></p>
<p dir="auto"><a name="sec1.2"></a></p>
<h2 dir="auto">SPAdes pipeline</h2>
<p dir="auto">SPAdes comes in several separate modules:</p>
<ul dir="auto">
<li><a href="http://bioinf.spbau.ru/en/spades/bayeshammer" rel="nofollow">BayesHammer</a> - read error correction tool for Illumina reads, which works well on both single-cell and standard data sets.</li>
<li>IonHammer - read error correction tool for IonTorrent data, which also works on both types of data.</li>
<li>SPAdes - iterative short-read genome assembly module; values of K are selected automatically based on the read length and data set type.</li>
<li>MismatchCorrector - a tool which improves mismatch and short indel rates in resulting contigs and scaffolds; this module uses the <a href="http://bio-bwa.sourceforge.net" rel="nofollow">BWA</a> tool [<a href="http://www.ncbi.nlm.nih.gov/pubmed/19451168" rel="nofollow">Li H. and Durbin R., 2009</a>]; MismatchCorrector is turned off by default, but we recommend to turn it on (see <a href="#correctoropt">SPAdes options section</a>).</li>
</ul>
<p dir="auto">We recommend to run SPAdes with BayesHammer/IonHammer to obtain high-quality assemblies. However, if you use your own read correction tool, it is possible to turn error correction module off. It is also possible to use only the read error correction stage, if you wish to use another assembler. See the <a href="#pipelineopt">SPAdes options section</a>. <a href=""></a></p>
<p dir="auto"><a name="sec1.3"></a></p>
<h2 dir="auto">SPAdes performance</h2>
<p dir="auto">In this section we give approximate data about SPAdes performance on two data sets:</p>
<ul dir="auto">
<li><a href="https://www.ncbi.nlm.nih.gov/sra/?term=ERR008613" rel="nofollow">Standard isolate <em>E. coli</em></a>; 6.2Gb, 28M reads, 2x100bp, insert size ~ 215bp</li>
<li><a href="http://cab.spbu.ru/files/spades_test_datasets/ecoli_sc/" rel="nofollow">MDA single-cell <em>E. coli</em></a>; 6.3 Gb, 29M reads, 2x100bp, insert size ~ 270bp (originally downloaded from <a href="http://bix.ucsd.edu/projects/singlecell/nbt_data.html" rel="nofollow">here</a>)</li>
</ul>
<p dir="auto">We ran SPAdes with default parameters using 16 threads on a server with Intel Xeon 2.27GHz processors. BayesHammer runs in approximately half an hour and takes up to 8Gb of RAM to perform read error correction on each data set. Assembly takes about 10 minutes for the <em>E. coli</em> isolate data set and 20 minutes for the <em>E. coli</em> single-cell data set. Both data sets require about 8Gb of RAM (see notes below). MismatchCorrector runs for about 15 minutes on both data sets, and requires less than 2Gb of RAM. All modules also require additional disk space for storing results (corrected reads, contigs, etc) and temporary files. See the table below for more precise values.</p>
<table border="1" cellpadding="4" cellspacing="0" role="table">
<tbody><tr>
<td align="right"> Data set </td>
<td colspan="3" align="center"> <i>E. coli</i> isolate </td> 
<td colspan="3" align="center"> <i>E. coli</i> single-cell </td>
</tr>
<tr>
<td> Stage </td>
<td align="center" width="110">  Time  </td> 
<td align="center" width="110">  Peak RAM <br> usage (Gb)  </td>
<td align="center" width="110">  Additional <br> disk space (Gb)  </td>
<td align="center" width="110">  Time </td> 
<td align="center" width="110">  Peak RAM <br> usage (Gb)  </td>
<td align="center" width="110">  Additional <br> disk space (Gb) </td>
</tr>
<tr>
<td> BayesHammer </td>
<td align="center"> 24m </td>
<td align="center"> 7.8 </td>
<td align="center"> 8.5 </td>
<td align="center"> 25m </td>
<td align="center"> 7.7 </td>
<td align="center"> 8.6 </td>
</tr>
<tr>
<td> SPAdes </td>
<td align="center"> 8m </td>
<td align="center"> 8.4 </td>
<td align="center"> 1.4 </td>
<td align="center"> 10m </td>
<td align="center"> 8.3 </td>
<td align="center"> 2.1 </td>
</tr>
<tr>
<td> MismatchCorrector </td>
<td align="center"> 10m </td>
<td align="center"> 1.7 </td>
<td align="center"> 21.4 </td>
<td align="center"> 12m </td>
<td align="center"> 1.8 </td>
<td align="center"> 22.4 </td>
</tr>
<tr>
<td> Whole pipeline </td>
<td align="center"> 42m </td>
<td align="center"> 8.4 </td>
<td align="center"> 23.9 </td>
<td align="center"> 47m </td>
<td align="center"> 8.3 </td>
<td align="center"> 25.1 </td>
</tr>
</tbody></table>
<p dir="auto">Notes:</p>
<ul dir="auto">
<li>Running SPAdes without preliminary read error correction (e.g. without BayesHammer or IonHammer) will likely require more time and memory.</li>
<li>Each module removes its temporary files as soon as it finishes.</li>
<li>SPAdes uses 512 Mb per thread for buffers, which results in higher memory consumption. If you set memory limit manually, SPAdes will use smaller buffers and thus less RAM.</li>
<li>Performance statistics is given for SPAdes version 3.14.1.</li>
</ul>
<p dir="auto"><a name="sec2"></a></p>
<h1 dir="auto">Installation</h1>
<p dir="auto">SPAdes requires a 64-bit Linux system or Mac OS and Python (supported versions are Python 2.7, and Python3: 3.2 and higher) to be pre-installed on it. To obtain SPAdes you can either download binaries or download source code and compile it yourself. <a href=""></a></p>
<p dir="auto">In case of successful installation the following files will be placed in the <code class="notranslate">bin</code> directory:</p>
<ul dir="auto">
<li><code class="notranslate">spades.py</code> (main executable script)</li>
<li><code class="notranslate">metaspades.py</code> (main executable script for <a href="#meta">metaSPAdes</a>)</li>
<li><code class="notranslate">plasmidspades.py</code> (main executable script for <a href="#plasmid">plasmidSPAdes</a>)</li>
<li><code class="notranslate">metaplasmidspades.py</code> (main executable script for <a href="#metaextrachromosomal">metaplasmidSPAdes</a>)</li>
<li><code class="notranslate">metaviralspades.py</code> (main executable script for <a href="#metaextrachromosomal">metaviralSPAdes</a>)</li>
<li><code class="notranslate">rnaspades.py</code> (main executable script for <a href="rnaspades_manual.html">rnaSPAdes</a>)</li>
<li><code class="notranslate">truspades.py</code> (main executable script for <a href="truspades_manual.html">truSPAdes</a>, DEPRECATED)</li>
<li><code class="notranslate">rnaviralspades.py</code> (main executable script for rnaviralSPAdes)</li>
<li><code class="notranslate">coronaspades.py</code> (wrapper script for coronaSPAdes mode)</li>
<li><code class="notranslate">spades-core</code>  (assembly module)</li>
<li><code class="notranslate">spades-gbuilder</code>  (standalone graph builder application)</li>
<li><code class="notranslate">spades-gmapper</code>  (standalone long read to graph aligner)</li>
<li><code class="notranslate">spades-kmercount</code>  (standalone k-mer counting application)</li>
<li><code class="notranslate">spades-hammer</code>  (read error correcting module for Illumina reads)</li>
<li><code class="notranslate">spades-ionhammer</code>  (read error correcting module for IonTorrent reads)</li>
<li><code class="notranslate">spades-bwa</code>  (<a href="http://bio-bwa.sourceforge.net" rel="nofollow">BWA</a> alignment module which is required for mismatch correction)</li>
<li><code class="notranslate">spades-corrector-core</code>  (mismatch correction module)</li>
<li><code class="notranslate">spades-truseq-scfcorrection</code>  (executable used in truSPAdes pipeline)</li>
</ul>
<p dir="auto"><a name="sec2.1"></a></p>
<h2 dir="auto">Downloading SPAdes Linux binaries</h2>
<p dir="auto">To download <a href="http://cab.spbu.ru/files/release3.15.5/SPAdes-3.15.5-Linux.tar.gz" rel="nofollow">SPAdes Linux binaries</a> and extract them, go to the directory in which you wish SPAdes to be installed and run:</p>
<div class="highlight highlight-source-shell"><pre>    wget http://cab.spbu.ru/files/release3.15.5/SPAdes-3.15.5-Linux.tar.gz
    tar -xzf SPAdes-3.15.5-Linux.tar.gz
    <span class="pl-c1">cd</span> SPAdes-3.15.5-Linux/bin/</pre></div>
<p dir="auto">In this case you do not need to run any installation scripts - SPAdes is ready to use. We also suggest adding SPAdes installation directory to the <code class="notranslate">PATH</code> variable. <a href=""></a></p>
<p dir="auto">Note, that pre-build binaries do not work on new Linux kernels.</p>
<p dir="auto"><a name="sec2.2"></a></p>
<h2 dir="auto">Downloading SPAdes binaries for Mac</h2>
<p dir="auto">To obtain <a href="http://cab.spbu.ru/files/release3.15.5/SPAdes-3.15.5-Darwin.tar.gz" rel="nofollow">SPAdes binaries for Mac</a>, go to the directory in which you wish SPAdes to be installed and run:</p>
<div class="highlight highlight-source-shell"><pre>    curl http://cab.spbu.ru/files/release3.15.5/SPAdes-3.15.5-Darwin.tar.gz -o SPAdes-3.15.5-Darwin.tar.gz
    tar -zxf SPAdes-3.15.5-Darwin.tar.gz
    <span class="pl-c1">cd</span> SPAdes-3.15.5-Darwin/bin/</pre></div>
<p dir="auto">Just as in Linux, SPAdes is ready to use and no further installation steps are required. We also suggest adding SPAdes installation directory to the <code class="notranslate">PATH</code> variable. <a href=""></a></p>
<p dir="auto"><a name="sec2.3"></a></p>
<h2 dir="auto">Downloading and compiling SPAdes source code</h2>
<p dir="auto">If you wish to compile SPAdes by yourself you will need the following libraries to be pre-installed:</p>
<ul dir="auto">
<li>g++ (version 5.3.1 or higher)</li>
<li>cmake (version 3.5 or higher)</li>
<li>zlib</li>
<li>libbz2</li>
</ul>
<p dir="auto">If you meet these requirements, you can download the <a href="http://cab.spbu.ru/files/release3.15.5/SPAdes-3.15.5.tar.gz" rel="nofollow">SPAdes source code</a>:</p>
<div class="highlight highlight-source-shell"><pre>    wget http://cab.spbu.ru/files/release3.15.5/SPAdes-3.15.5.tar.gz
    tar -xzf SPAdes-3.15.5.tar.gz
    <span class="pl-c1">cd</span> SPAdes-3.15.5</pre></div>
<p dir="auto">and build it with the following script:</p>
<div class="highlight highlight-source-shell"><pre>    ./spades_compile.sh</pre></div>
<p dir="auto">SPAdes will be built in the directory <code class="notranslate">./bin</code>. If you wish to install SPAdes into another directory, you can specify full path of destination folder by running the following command in <code class="notranslate">bash</code> or <code class="notranslate">sh</code>:</p>
<div class="highlight highlight-source-shell"><pre>    PREFIX=<span class="pl-k">&lt;</span>destination_dir<span class="pl-k">&gt;</span> ./spades_compile.sh</pre></div>
<p dir="auto">for example:</p>
<div class="highlight highlight-source-shell"><pre>    PREFIX=/usr/local ./spades_compile.sh</pre></div>
<p dir="auto">which will install SPAdes into <code class="notranslate">/usr/local/bin</code>.</p>
<p dir="auto">After installation you will get the same files (listed above) in <code class="notranslate">./bin</code> directory (or <code class="notranslate">&lt;destination_dir&gt;/bin</code> if you specified PREFIX). We also suggest adding <code class="notranslate">bin</code> directory to the <code class="notranslate">PATH</code> variable. <a href=""></a></p>
<p dir="auto"><a name="sec2.4"></a></p>
<h2 dir="auto">Verifying your installation</h2>
<p dir="auto">For testing purposes, SPAdes comes with a toy data set (reads that align to first 1000 bp of <em>E. coli</em>). To try SPAdes on this data set, run:</p>
<div class="highlight highlight-source-shell"><pre>    <span class="pl-k">&lt;</span>spades installation dir<span class="pl-k">&gt;</span>/bin/spades.py --test</pre></div>
<p dir="auto">If you added <code class="notranslate">bin</code> folder from SPAdes installation directory to the <code class="notranslate">PATH</code> variable, you can run:</p>
<div class="highlight highlight-source-shell"><pre>    spades.py --test</pre></div>
<p dir="auto">For the simplicity we further assume that <code class="notranslate">bin</code> folder from SPAdes installation directory is added to the <code class="notranslate">PATH</code> variable.</p>
<p dir="auto">If the installation is successful, you will find the following information at the end of the log:</p>
<pre lang="plain" class="notranslate"><code class="notranslate">
===== Assembling finished. Used k-mer sizes: 21, 33, 55

 * Corrected reads are in spades_test/corrected/
 * Assembled contigs are in spades_test/contigs.fasta
 * Assembled scaffolds are in spades_test/scaffolds.fasta
 * Assembly graph is in spades_test/assembly_graph.fastg
 * Assembly graph in GFA format is in spades_test/assembly_graph_with_scaffolds.gfa
 * Paths in the assembly graph corresponding to the contigs are in spades_test/contigs.paths
 * Paths in the assembly graph corresponding to the scaffolds are in spades_test/scaffolds.paths

======= SPAdes pipeline finished.

========= TEST PASSED CORRECTLY.

SPAdes log can be found here: spades_test/spades.log

Thank you for using SPAdes!
</code></pre>
<p dir="auto"><a name="sec3"></a></p>
<h1 dir="auto">Running SPAdes</h1>
<p dir="auto"><a name="sec3.1"></a><br>
<a name="input"></a></p>
<h2 dir="auto">SPAdes input</h2>
<p dir="auto">SPAdes takes as input paired-end reads, mate-pairs and single (unpaired) reads in FASTA and FASTQ. For IonTorrent data SPAdes also supports unpaired reads in unmapped BAM format (like the one produced by Torrent Server). However, in order to run read error correction, reads should be in FASTQ or BAM format. Sanger, Oxford Nanopore and PacBio CLR reads can be provided in both formats since SPAdes does not run error correction for these types of data.</p>
<p dir="auto">To run SPAdes 3.15.5 you need at least one library of the following types:</p>
<ul dir="auto">
<li>Illumina paired-end/high-quality mate-pairs/unpaired reads</li>
<li>IonTorrent paired-end/high-quality mate-pairs/unpaired reads</li>
<li>PacBio CCS reads</li>
</ul>
<p dir="auto">Illumina and IonTorrent libraries should not be assembled together. All other types of input data are compatible. SPAdes should not be used if only PacBio CLR, Oxford Nanopore, Sanger reads or additional contigs are available.</p>
<p dir="auto">SPAdes supports mate-pair only assembly. However, we recommend to use only high-quality mate-pair libraries in this case (e.g. that do not have a paired-end part). We tested mate-pair only pipeline using Illumina Nextera mate-pairs. See more <a href="#hqmp">here</a>.</p>
<p dir="auto">Notes:</p>
<ul dir="auto">
<li>It is strongly suggested to provide multiple paired-end and mate-pair libraries according to their insert size (from smallest to longest).</li>
<li>It is not recommended to run SPAdes on PacBio reads with low coverage (less than 5).</li>
<li>We suggest not to run SPAdes on PacBio reads for large genomes.</li>
<li>SPAdes accepts gzip-compressed files.</li>
</ul>
<p dir="auto"><a name="input:pairedend"></a></p>
<h3 dir="auto">Read-pair libraries</h3>
<p dir="auto">By using command line interface, you can specify up to nine different paired-end libraries, up to nine mate-pair libraries and also up to nine high-quality mate-pair ones. If you wish to use more, you can use YAML data set file. We further refer to paired-end and mate-pair libraries simply as to read-pair libraries.</p>
<p dir="auto">By default, SPAdes assumes that paired-end and high-quality mate-pair reads have forward-reverse (fr) orientation and usual mate-pairs have reverse-forward (rf) orientation. However, different orientations can be set for any library by using SPAdes options.</p>
<p dir="auto">To distinguish reads in pairs we refer to them as left and right reads. For forward-reverse orientation, the forward reads correspond to the left reads and the reverse reads, to the right. Similarly, in reverse-forward orientation left and right reads correspond to reverse and forward reads, respectively, etc.</p>
<p dir="auto">Each read-pair library can be stored in several files or several pairs of files. Paired reads can be organized in two different ways:</p>
<ul dir="auto">
<li>In file pairs. In this case left and right reads are placed in different files and go in the same order in respective files.</li>
<li>In interleaved files. In this case, the reads are interlaced, so that each right read goes after the corresponding paired left read.</li>
</ul>
<p dir="auto">For example, Illumina produces paired-end reads in two files: <code class="notranslate">R1.fastq</code> and <code class="notranslate">R2.fastq</code>. If you choose to store reads in file pairs make sure that for every read from <code class="notranslate">R1.fastq</code> the corresponding paired read from <code class="notranslate">R2.fastq</code> is placed in the respective paired file on the same line number. If you choose to use interleaved files, every read from <code class="notranslate">R1.fastq</code> should be followed by the corresponding paired read from <code class="notranslate">R2.fastq</code>.</p>
<p dir="auto">If adapter and/or quality trimming software has been used prior to assembly, files with the orphan reads can be provided as "single read files" for the corresponding read-pair library.</p>
<p dir="auto"><a name="input:merged"></a><br>
If you have merged some of the reads from your paired-end (not mate-pair or high-quality mate-pair) library (using tools s.a. <a href="https://jgi.doe.gov/data-and-tools/bbtools/bb-tools-user-guide/bbmerge-guide/" rel="nofollow">BBMerge</a> or <a href="https://bitbucket.org/yaoornl/align_test/overview" rel="nofollow">STORM</a>), you should provide the file with resulting reads as a "merged read file" for the corresponding library.<br>
Note that non-empty files with the remaining unmerged left/right reads (separate or interlaced) <strong>must</strong> be provided for the same library (for SPAdes to correctly detect the original read length).</p>
<p dir="auto">In an unlikely case some of the reads from your mate-pair (or high-quality mate-pair) library are "merged", you should provide the resulting reads as a SEPARATE single-read library.</p>
<p dir="auto"><a name="input:single"></a></p>
<h3 dir="auto">Unpaired (single-read) libraries</h3>
<p dir="auto">By using command line interface, you can specify up to nine different single-read libraries. To input more libraries, you can use YAML data set file.</p>
<p dir="auto">Single librairies are assumed to have high quality and a reasonable coverage. For example, you can provide PacBio CCS reads as a single-read library.</p>
<p dir="auto">Note, that you should not specify PacBio CLR, Sanger reads or additional contigs as single-read libraries, each of them has a separate <a href="#inputdata">option</a>. <a href=""></a></p>
<p dir="auto"><a name="input:longreads"></a></p>
<h3 dir="auto">PacBio and Oxford Nanopore reads</h3>
<p dir="auto">SPAdes can take as an input an unlimited number of PacBio and Oxford Nanopore libraries.</p>
<p dir="auto">PacBio CLR and Oxford Nanopore reads are used for hybrid assemblies (e.g. with Illumina or IonTorrent). There is no need to pre-correct this kind of data. SPAdes will use PacBio CLR and Oxford Nanopore reads for gap closure and repeat resolution.</p>
<p dir="auto">For PacBio you just need to have filtered subreads in FASTQ/FASTA format. Provide these filtered subreads using <code class="notranslate">--pacbio</code> option. Oxford Nanopore reads are provided with <code class="notranslate">--nanopore</code> option.</p>
<p dir="auto">PacBio CCS/Reads of Insert reads or pre-corrected (using third-party software) PacBio CLR / Oxford Nanopore reads can be simply provided as single reads to SPAdes.</p>
<p dir="auto"><a name="input:contigs"></a></p>
<h3 dir="auto">Additional contigs</h3>
<p dir="auto">In case you have contigs of the same genome generated by other assembler(s) and you wish to merge them into SPAdes assembly, you can specify additional contigs using <code class="notranslate">--trusted-contigs</code> or <code class="notranslate">--untrusted-contigs</code>. First option is used when high quality contigs are available. These contigs will be used for graph construction, gap closure and repeat resolution. Second option is used for less reliable contigs that may have more errors or contigs of unknown quality. These contigs will be used only for gap closure and repeat resolution. The number of additional contigs is unlimited.</p>
<p dir="auto">Note, that SPAdes does not perform assembly using genomes of closely-related species. Only contigs of the same genome should be specified.</p>
<p dir="auto"><a href=""></a><br>
<a name="sec3.2"></a></p>
<h2 dir="auto">SPAdes command line options</h2>
<p dir="auto">To run SPAdes from the command line, type</p>
<div class="highlight highlight-source-shell"><pre>    spades.py [options] -o <span class="pl-k">&lt;</span>output_dir<span class="pl-k">&gt;</span></pre></div>
<p dir="auto">Note that we assume that <code class="notranslate">bin</code> forder from SPAdes installation directory is added to the <code class="notranslate">PATH</code> variable (provide full path to SPAdes executable otherwise: <code class="notranslate">&lt;spades installation dir&gt;/bin/spades.py</code>). <a href=""></a></p>
<p dir="auto"><a name="basicopt"></a></p>
<h3 dir="auto">Basic options</h3>
<p dir="auto"><code class="notranslate">-o &lt;output_dir&gt; </code><br>
Specify the output directory. Required option.</p>
<p dir="auto"><a href=""></a></p>
<p dir="auto"><a name="isolate"></a><br>
<code class="notranslate">--isolate </code><br>
This flag is highly recommended for high-coverage isolate and multi-cell Illumina data; improves the assembly quality and running time.<br>
We also recommend to trim your reads prior to the assembly. More details can be found <a href="http://cab.spbu.ru/benchmarking-tools-for-de-novo-microbial-assembly/" rel="nofollow">here</a>.<br>
This option is not compatible with <code class="notranslate">--only-error-correction</code> or <code class="notranslate">--careful</code> options.</p>
<p dir="auto"><a name="sc"></a><br>
<code class="notranslate">--sc </code><br>
This flag is required for MDA (single-cell) data.</p>
<p dir="auto"><a href=""></a></p>
<p dir="auto"><a name="meta"></a><br>
<code class="notranslate">--meta </code>   (same as <code class="notranslate">metaspades.py</code>)<br>
This flag is recommended when assembling metagenomic data sets (runs metaSPAdes, see <a href="https://genome.cshlp.org/content/27/5/824.short" rel="nofollow">paper</a> for more details). Currently metaSPAdes supports only a <strong><em>single</em></strong> short-read library which has to be <strong><em>paired-end</em></strong> (we hope to remove this restriction soon). In addition, you can provide long reads (e.g. using <code class="notranslate">--pacbio</code> or <code class="notranslate">--nanopore</code> options), but hybrid assembly for metagenomes remains an experimental pipeline and optimal performance is not guaranteed. It does not support <a href="#correctoropt">careful mode</a> (mismatch correction is not available). In addition, you cannot specify coverage cutoff for metaSPAdes. Note that metaSPAdes might be very sensitive to presence of the technical sequences remaining in the data (most notably adapter readthroughs), please run quality control and pre-process your data accordingly.</p>
<p dir="auto"><a href=""></a></p>
<p dir="auto"><a name="plasmid"></a><br>
<code class="notranslate">--plasmid </code>   (same as <code class="notranslate">plasmidspades.py</code>)<br>
This flag is required when assembling only plasmids from WGS data sets (runs plasmidSPAdes, see <a href="https://academic.oup.com/bioinformatics/article/32/22/3380/2525610" rel="nofollow">paper</a> for the algorithm details). Note, that plasmidSPAdes is not compatible with <a href="#sc">single-cell mode</a>. Additionally, we do not recommend to run plasmidSPAdes on more than one library.</p>
<p dir="auto">For plasmidSPAdes output details see <a href="#plasmidout">section 3.6</a>.</p>
<p dir="auto"><a href=""></a></p>
<p dir="auto"><a name="metaextrachromosomal"></a><br>
<code class="notranslate">--metaplasmid </code>   (same as <code class="notranslate">metaplasmidspades.py</code> and <code class="notranslate">--meta</code> <code class="notranslate">--plasmid</code>) and</p>
<p dir="auto"><code class="notranslate">--metaviral </code>   (same as <code class="notranslate">metaviralspades.py</code>)</p>
<p dir="auto">These options works specially for extracting extrachromosomal elements from metagenomic assemblies. They run similar pipelines that slightly differ in the simplification step; another difference is that for metaviral mode we output linear putative extrachromosomal contigs and for metaplasmid mode we do not.<br>
See <a href="https://genome.cshlp.org/content/29/6/961.short" rel="nofollow">metaplasmid paper</a> and <a href="https://academic.oup.com/bioinformatics/article-abstract/36/14/4126/5837667" rel="nofollow">metaviral paper</a> for the algorithms details.</p>
<p dir="auto">For metaplasmidSPAdes/metaviralSPAdes output details see <a href="#metapv">section 3.7</a>.</p>
<p dir="auto"><a href=""></a></p>
<p dir="auto">Additionally for plasmidSPAdes, metaplasmidSPAdes and metaviralSPAdes we recommend to additionally verify resulting contigs with <a href="https://github.com/ablab/viralVerify">viralVerify tool</a>.</p>
<p dir="auto"><a href=""></a></p>
<p dir="auto"><a name="biosynthetic"></a><br>
<code class="notranslate">--bio </code><br>
This flag is required when assembling only non-ribosomal and polyketide gene clusters from WGS data sets (runs biosyntheticSPAdes, see <a href="https://genome.cshlp.org/content/early/2019/06/03/gr.243477.118?top=1" rel="nofollow">paper</a> for the algorithm details). biosyntheticSPAdes is supposed to work on isolate or metagenomic WGS dataset. Note, that biosyntheticSPAdes is not compatible with any other modes. See <a href="#bgc">section 3.8</a> for biosyntheticSPAdes output details.</p>
<p dir="auto"><a href=""></a></p>
<p dir="auto"><a name="rna"></a><br>
<code class="notranslate">--rna </code>   (same as <code class="notranslate">rnaspades.py</code>)<br>
This flag should be used when assembling RNA-Seq data sets (runs rnaSPAdes). To learn more, see <a href="rnaspades_manual.html">rnaSPAdes manual</a>.<br>
Not compatible with <code class="notranslate">--only-error-correction</code> or <code class="notranslate">--careful</code> options.</p>
<p dir="auto"><a href=""></a></p>
<p dir="auto"><a name="rnaviral"></a><br>
<code class="notranslate">--rnaviral</code>   (same as <code class="notranslate">rnaviralspades.py</code>)<br>
This flag should be used when assembling viral RNA-Seq data sets (runs rnaviralSPAdes).<br>
Not compatible with <code class="notranslate">--only-error-correction</code> or <code class="notranslate">--careful</code> options.</p>
<p dir="auto"><code class="notranslate">--iontorrent </code><br>
This flag is required when assembling IonTorrent data. Allows BAM files as input. Carefully read <a href="#sec3.3">section 3.3</a> before using this option.</p>
<p dir="auto"><code class="notranslate">--test</code><br>
Runs SPAdes on the toy data set; see <a href="#sec2.4">section 2.4</a>.</p>
<p dir="auto"><code class="notranslate">-h</code> (or <code class="notranslate">--help</code>)<br>
Prints help.</p>
<p dir="auto"><code class="notranslate">-v</code> (or <code class="notranslate">--version</code>)<br>
Prints SPAdes version.</p>
<p dir="auto"><a href=""></a><br>
<a name="pipelineopt"></a></p>
<h3 dir="auto">Pipeline options</h3>
<p dir="auto"><code class="notranslate">--only-error-correction</code><br>
Performs read error correction only.</p>
<p dir="auto"><code class="notranslate">--only-assembler</code><br>
Runs assembly module only.</p>
<p dir="auto"><a href=""></a><br>
<a name="correctoropt"></a><br>
<code class="notranslate">--careful</code><br>
Tries to reduce the number of mismatches and short indels. Also runs MismatchCorrector - a post processing tool, which uses <a href="http://bio-bwa.sourceforge.net" rel="nofollow">BWA</a> tool (comes with SPAdes). This option is recommended only for assembly of small genomes. We strongly recommend not to use it for large and medium-size eukaryotic genomes. Note, that this options is is not supported by metaSPAdes and rnaSPAdes.</p>
<p dir="auto"><code class="notranslate">--continue</code><br>
Continues SPAdes run from the specified output folder starting from the last available check-point. Check-points are made after:</p>
<ul dir="auto">
<li>error correction module is finished</li>
<li>iteration for each specified K value of assembly module is finished</li>
<li>mismatch correction is finished for contigs or scaffolds</li>
</ul>
<p dir="auto">For example, if specified K values are 21, 33 and 55 and SPAdes was stopped or crashed during assembly stage with K = 55, you can run SPAdes with the <code class="notranslate">--continue</code> option specifying the same output directory. SPAdes will continue the run starting from the assembly stage with K = 55. Error correction module and iterations for K equal to 21 and 33 will not be run again. If <code class="notranslate">--continue</code> is set, the only allowed option is <code class="notranslate">-o &lt;output_dir&gt; </code>.</p>
<p dir="auto"><code class="notranslate">--restart-from &lt;check_point&gt;</code><br>
Restart SPAdes run from the specified output folder starting from the specified check-point. Check-points are:</p>
<ul dir="auto">
<li><code class="notranslate">ec</code> - start from error correction</li>
<li><code class="notranslate">as</code> - restart assembly module from the first iteration</li>
<li><code class="notranslate">k&lt;int&gt;</code> - restart from the iteration with specified k values, e.g. k55 (not available in RNA-Seq mode)</li>
<li><code class="notranslate">mc</code> - restart mismatch correction</li>
<li><code class="notranslate">last</code> - restart from the last available check-point (similar to <code class="notranslate">--continue</code>)</li>
</ul>
<p dir="auto">In contrast to the <code class="notranslate">--continue</code> option, you can change some of the options when using <code class="notranslate">--restart-from</code>. You can change any option except: all basic options, all options for specifying input data (including <code class="notranslate">--dataset</code>), <code class="notranslate">--only-error-correction</code> option and <code class="notranslate">--only-assembler</code> option. For example, if you ran assembler with k values 21,33,55 without mismatch correction, you can add one more iteration with k=77 and run mismatch correction step by running SPAdes with following options:<br>
<code class="notranslate">--restart-from k55 -k 21,33,55,77 --mismatch-correction -o &lt;previous_output_dir&gt;</code>.<br>
Since all files will be overwritten, do not forget to copy your assembly from the previous run if you need it.</p>
<p dir="auto"><code class="notranslate">--disable-gzip-output</code><br>
Forces read error correction module not to compress the corrected reads. If this options is not set, corrected reads will be in <code class="notranslate">*.fastq.gz</code> format.</p>
<p dir="auto"><a href=""></a></p>
<p dir="auto"><a name="inputdata"></a></p>
<h3 dir="auto">Input data</h3>
<p dir="auto"><a name="inputdata:pairedend"></a></p>
<h4 dir="auto">Specifying single library (paired-end or single-read)</h4>
<p dir="auto"><code class="notranslate">--12 &lt;file_name&gt; </code><br>
File with interlaced forward and reverse paired-end reads.</p>
<p dir="auto"><code class="notranslate">-1 &lt;file_name&gt; </code><br>
File with forward reads.</p>
<p dir="auto"><code class="notranslate">-2 &lt;file_name&gt; </code><br>
File with reverse reads.</p>
<p dir="auto"><code class="notranslate">--merged &lt;file_name&gt; </code><br>
File with merged paired reads.<br>
If the properties of the library permit, overlapping paired-end reads can be merged using special software.<br>
Non-empty files with (remaining) unmerged left/right reads (separate or interlaced) <strong>must</strong> be provided for the same library for SPAdes to correctly detect the original read length.</p>
<p dir="auto"><code class="notranslate">-s &lt;file_name&gt; </code><br>
File with unpaired reads.</p>
<p dir="auto"><a name="inputdata:multiple"></a></p>
<h4 dir="auto">Specifying multiple libraries</h4>
<p dir="auto"><strong><em>Single-read libraries</em></strong></p>
<p dir="auto"><code class="notranslate">--s&lt;#&gt; &lt;file_name&gt; </code><br>
File for single-read library number <code class="notranslate">&lt;#&gt;</code> (<code class="notranslate">&lt;#&gt;</code> = 1,2,..,9). For example, for the first paired-end library the option is: <code class="notranslate">--s1 &lt;file_name&gt; </code><br>
Do not use <code class="notranslate">-s</code> options for single-read libraries, since it specifies unpaired reads for the first paired-end library.</p>
<p dir="auto"><strong><em>Paired-end libraries</em></strong></p>
<p dir="auto"><code class="notranslate">--pe&lt;#&gt;-12 &lt;file_name&gt; </code><br>
File with interlaced reads for paired-end library number <code class="notranslate">&lt;#&gt;</code> (<code class="notranslate">&lt;#&gt;</code> = 1,2,..,9). For example, for the first single-read library the option is: <code class="notranslate">--pe1-12 &lt;file_name&gt; </code></p>
<p dir="auto"><code class="notranslate">--pe&lt;#&gt;-1 &lt;file_name&gt; </code><br>
File with left reads for paired-end library number <code class="notranslate">&lt;#&gt;</code> (<code class="notranslate">&lt;#&gt;</code> = 1,2,..,9).</p>
<p dir="auto"><code class="notranslate">--pe&lt;#&gt;-2 &lt;file_name&gt; </code><br>
File with right reads for paired-end library number <code class="notranslate">&lt;#&gt;</code> (<code class="notranslate">&lt;#&gt;</code> = 1,2,..,9).</p>
<p dir="auto"><code class="notranslate">--pe&lt;#&gt;-m &lt;file_name&gt; </code><br>
File with merged reads from paired-end library number <code class="notranslate">&lt;#&gt;</code> (<code class="notranslate">&lt;#&gt;</code> = 1,2,..,9)<br>
If the properties of the library permit, paired reads can be merged using special software. Non-empty files with (remaining) unmerged left/right reads (separate or interlaced) <strong>must</strong> be provided for the same library for SPAdes to correctly detect the original read length.</p>
<p dir="auto"><code class="notranslate">--pe&lt;#&gt;-s &lt;file_name&gt; </code><br>
File with unpaired reads from paired-end library number <code class="notranslate">&lt;#&gt;</code> (<code class="notranslate">&lt;#&gt;</code> = 1,2,..,9)<br>
For example, paired reads can become unpaired during the error correction procedure.</p>
<p dir="auto"><code class="notranslate">--pe&lt;#&gt;-&lt;or&gt; </code><br>
Orientation of reads for paired-end library number <code class="notranslate">&lt;#&gt;</code> (<code class="notranslate">&lt;#&gt;</code> = 1,2,..,9; <code class="notranslate">&lt;or&gt;</code> = "fr","rf","ff").<br>
The default orientation for paired-end libraries is forward-reverse (<code class="notranslate">--&gt; &lt;--</code>). For example, to specify reverse-forward orientation for the second paired-end library, you should use the flag: <code class="notranslate">--pe2-rf </code><br>
Should not be confused with FR and RF strand-specificity for RNA-Seq data (see <a href="rnaspades_manual.html#sec2.3">rnaSPAdes manual</a>).</p>
<p dir="auto"><a name="inputdata:matepairs"></a><br>
<strong><em>Mate-pair libraries</em></strong></p>
<p dir="auto"><code class="notranslate">--mp&lt;#&gt;-12 &lt;file_name&gt; </code><br>
File with interlaced reads for mate-pair library number <code class="notranslate">&lt;#&gt;</code> (<code class="notranslate">&lt;#&gt;</code> = 1,2,..,9).</p>
<p dir="auto"><code class="notranslate">--mp&lt;#&gt;-1 &lt;file_name&gt; </code><br>
File with left reads for mate-pair library number <code class="notranslate">&lt;#&gt;</code> (<code class="notranslate">&lt;#&gt;</code> = 1,2,..,9).</p>
<p dir="auto"><code class="notranslate">--mp&lt;#&gt;-2 &lt;file_name&gt; </code><br>
File with right reads for mate-pair library number <code class="notranslate">&lt;#&gt;</code> (<code class="notranslate">&lt;#&gt;</code> = 1,2,..,9).</p>
<p dir="auto"><code class="notranslate">--mp&lt;#&gt;-&lt;or&gt; </code><br>
Orientation of reads for mate-pair library number <code class="notranslate">&lt;#&gt;</code> (<code class="notranslate">&lt;#&gt;</code> = 1,2,..,9; <code class="notranslate">&lt;or&gt;</code> = "fr","rf","ff").<br>
The default orientation for mate-pair libraries is reverse-forward (<code class="notranslate">&lt;-- --&gt;</code>). For example, to specify forward-forward orientation for the first mate-pair library, you should use the flag: <code class="notranslate">--mp1-ff </code></p>
<p dir="auto"><a name="hqmp"></a><br>
<strong><em>High-quality mate-pair libraries</em></strong> (can be used for mate-pair only assembly)</p>
<p dir="auto"><code class="notranslate">--hqmp&lt;#&gt;-12 &lt;file_name&gt; </code><br>
File with interlaced reads for high-quality mate-pair library number <code class="notranslate">&lt;#&gt;</code> (<code class="notranslate">&lt;#&gt;</code> = 1,2,..,9).</p>
<p dir="auto"><code class="notranslate">--hqmp&lt;#&gt;-1 &lt;file_name&gt; </code><br>
File with left reads for high-quality mate-pair library number <code class="notranslate">&lt;#&gt;</code> (<code class="notranslate">&lt;#&gt;</code> = 1,2,..,9).</p>
<p dir="auto"><code class="notranslate">--hqmp&lt;#&gt;-2 &lt;file_name&gt; </code><br>
File with right reads for high-quality mate-pair library number <code class="notranslate">&lt;#&gt;</code> (<code class="notranslate">&lt;#&gt;</code> = 1,2,..,9).</p>
<p dir="auto"><code class="notranslate">--hqmp&lt;#&gt;-s &lt;file_name&gt; </code><br>
File with unpaired reads from high-quality mate-pair library number <code class="notranslate">&lt;#&gt;</code> (<code class="notranslate">&lt;#&gt;</code> = 1,2,..,9)</p>
<p dir="auto"><code class="notranslate">--hqmp&lt;#&gt;-&lt;or&gt; </code><br>
Orientation of reads for high-quality mate-pair library number <code class="notranslate">&lt;#&gt;</code> (<code class="notranslate">&lt;#&gt;</code> = 1,2,..,9; <code class="notranslate">&lt;or&gt;</code> = "fr","rf","ff").<br>
The default orientation for high-quality mate-pair libraries is forward-reverse (<code class="notranslate">--&gt; &lt;--</code>). For example, to specify reverse-forward orientation for the first high-quality mate-pair library, you should use the flag: <code class="notranslate">--hqmp1-rf </code></p>
<p dir="auto"><a name="inputdata:longreads"></a><br>
<strong><em>Specifying data for hybrid assembly</em></strong></p>
<p dir="auto"><code class="notranslate">--pacbio &lt;file_name&gt; </code><br>
File with PacBio CLR reads. For PacBio CCS reads use <code class="notranslate">-s</code> option. More information on PacBio reads is provided in section 3.1.</p>
<p dir="auto"><code class="notranslate">--nanopore &lt;file_name&gt; </code><br>
File with Oxford Nanopore reads.</p>
<p dir="auto"><code class="notranslate">--sanger &lt;file_name&gt; </code><br>
File with Sanger reads</p>
<p dir="auto"><code class="notranslate">--trusted-contigs &lt;file_name&gt; </code><br>
Reliable contigs of the same genome, which are likely to have no misassemblies and small rate of other errors (e.g. mismatches and indels). This option is not intended for contigs of the related species.</p>
<p dir="auto"><code class="notranslate">--untrusted-contigs &lt;file_name&gt; </code><br>
Contigs of the same genome, quality of which is average or unknown. Contigs of poor quality can be used but may introduce errors in the assembly. This option is also not intended for contigs of the related species.</p>
<p dir="auto"><strong><em>Other input</em></strong></p>
<p dir="auto"><code class="notranslate">--assembly-graph &lt;file_name&gt; </code><br>
File with assembly graph. Could only be used in plasmid, metaplasmid, metaviral and biosynthetic mode. The primary purpose of this option to run these pipelines on already constructed and simplified assembly graph this way skipping a large part of SPAdes pipeline. Original reads the graph was constructed from need to be specified as well. Exact k-mer length (via <code class="notranslate">-k</code> option) should be provided. Note that the output would be different as compared to standalone runs of these pipelines as they setup graph simplification options as well.</p>
<p dir="auto"><a name="inputdata:yaml"></a><br>
<strong><em>Specifying input data with YAML data set file (advanced)</em></strong></p>
<p dir="auto">An alternative way to specify an input data set for SPAdes is to create a <a href="http://www.yaml.org/" rel="nofollow">YAML</a> data set file. By using a YAML file you can provide an unlimited number of paired-end, mate-pair and unpaired libraries. Basically, YAML data set file is a text file, in which input libraries are provided as a comma-separated list in square brackets. Each library is provided in braces as a comma-separated list of attributes. The following attributes are available:</p>
<ul dir="auto">
<li>orientation ("fr", "rf", "ff")</li>
<li>type ("paired-end", "mate-pairs", "hq-mate-pairs", "single", "pacbio", "nanopore", "sanger", "trusted-contigs", "untrusted-contigs")</li>
<li>interlaced reads (comma-separated list of files with interlaced reads)</li>
<li>left reads (comma-separated list of files with left reads)</li>
<li>right reads (comma-separated list of files with right reads)</li>
<li>single reads (comma-separated list of files with single reads or unpaired reads from paired library)</li>
<li>merged reads (comma-separated list of files with merged reads)</li>
</ul>
<p dir="auto">To properly specify a library you should provide its type and at least one file with reads. Orientation is an optional attribute. Its default value is "fr" (forward-reverse) for paired-end libraries and "rf" (reverse-forward) for mate-pair libraries.</p>
<p dir="auto">The value for each attribute is given after a colon. Comma-separated lists of files should be given in square brackets. For each file you should provide its full path in double quotes. Make sure that files with right reads are given in the same order as corresponding files with left reads.</p>
<p dir="auto">For example, if you have one paired-end library split into two pairs of files:</p>
<div class="highlight highlight-source-shell"><pre>    lib_pe1_left_1.fastq
    lib_pe1_right_1.fastq
    lib_pe1_left_2.fastq
    lib_pe1_right_2.fastq</pre></div>
<p dir="auto">one mate-pair library:</p>
<div class="highlight highlight-source-shell"><pre>    lib_mp1_left.fastq
    lib_mp1_right.fastq</pre></div>
<p dir="auto">and PacBio CCS and CLR reads:</p>
<div class="highlight highlight-source-shell"><pre>    pacbio_ccs.fastq
    pacbio_clr.fastq</pre></div>
<p dir="auto">YAML file should look like this:</p>
<div class="highlight highlight-source-shell"><pre>    [
      {
        orientation: <span class="pl-s"><span class="pl-pds">"</span>fr<span class="pl-pds">"</span></span>,
        type: <span class="pl-s"><span class="pl-pds">"</span>paired-end<span class="pl-pds">"</span></span>,
        right reads: [
          <span class="pl-s"><span class="pl-pds">"</span>/FULL_PATH_TO_DATASET/lib_pe1_right_1.fastq<span class="pl-pds">"</span></span>,
          <span class="pl-s"><span class="pl-pds">"</span>/FULL_PATH_TO_DATASET/lib_pe1_right_2.fastq<span class="pl-pds">"</span></span> 
        ],
        left reads: [
          <span class="pl-s"><span class="pl-pds">"</span>/FULL_PATH_TO_DATASET/lib_pe1_left_1.fastq<span class="pl-pds">"</span></span>,
          <span class="pl-s"><span class="pl-pds">"</span>/FULL_PATH_TO_DATASET/lib_pe1_left_2.fastq<span class="pl-pds">"</span></span> 
        ]
      },
      {
        orientation: <span class="pl-s"><span class="pl-pds">"</span>rf<span class="pl-pds">"</span></span>,
        type: <span class="pl-s"><span class="pl-pds">"</span>mate-pairs<span class="pl-pds">"</span></span>,
        right reads: [
          <span class="pl-s"><span class="pl-pds">"</span>/FULL_PATH_TO_DATASET/lib_mp1_right.fastq<span class="pl-pds">"</span></span> 
        ],
        left reads: [
          <span class="pl-s"><span class="pl-pds">"</span>/FULL_PATH_TO_DATASET/lib_mp1_left.fastq<span class="pl-pds">"</span></span>
        ]
      },
      {
        type: <span class="pl-s"><span class="pl-pds">"</span>single<span class="pl-pds">"</span></span>,
        single reads: [
          <span class="pl-s"><span class="pl-pds">"</span>/FULL_PATH_TO_DATASET/pacbio_ccs.fastq<span class="pl-pds">"</span></span> 
        ]
      },
      {
        type: <span class="pl-s"><span class="pl-pds">"</span>pacbio<span class="pl-pds">"</span></span>,
        single reads: [
          <span class="pl-s"><span class="pl-pds">"</span>/FULL_PATH_TO_DATASET/pacbio_clr.fastq<span class="pl-pds">"</span></span> 
        ]
      }
    ]</pre></div>
<p dir="auto">Once you have created a YAML file save it with <code class="notranslate">.yaml</code> extension (e.g. as <code class="notranslate">my_data_set.yaml</code>) and run SPAdes using the <code class="notranslate">--dataset</code> option:<br>
<code class="notranslate">--dataset &lt;your YAML file&gt;</code><br>
Notes:</p>
<ul dir="auto">
<li>The <code class="notranslate">--dataset</code> option cannot be used with any other options for specifying input data.</li>
<li>We recommend to nest all files with long reads of the same data type in a single library block.</li>
</ul>
<p dir="auto"><a href=""></a></p>
<p dir="auto"><a name="advancedopt"></a></p>
<h3 dir="auto">Advanced options</h3>
<p dir="auto"><code class="notranslate">-t &lt;int&gt;</code> (or <code class="notranslate">--threads &lt;int&gt;</code>)<br>
Number of threads. The default value is 16.</p>
<p dir="auto"><code class="notranslate">-m &lt;int&gt;</code> (or <code class="notranslate">--memory &lt;int&gt;</code>)<br>
Set memory limit in Gb. SPAdes terminates if it reaches this limit. The default value is 250 Gb. Actual amount of consumed RAM will be below this limit. Make sure this value is correct for the given machine. SPAdes uses the limit value to automatically determine the sizes of various buffers, etc.</p>
<p dir="auto"><code class="notranslate">--tmp-dir &lt;dir_name&gt;</code><br>
Set directory for temporary files from read error correction. The default value is <code class="notranslate">&lt;output_dir&gt;/corrected/tmp</code></p>
<p dir="auto"><code class="notranslate">-k &lt;int,int,...&gt;</code><br>
Comma-separated list of k-mer sizes to be used (all values must be odd, less than 128 and listed in ascending order). If <code class="notranslate">--sc</code> is set the default values are 21,33,55. For multicell data sets K values are automatically selected using maximum read length (<a href="#sec3.4">see note for assembling long Illumina paired reads for details</a>). To properly select K values for IonTorrent data read <a href="#sec3.3">section 3.3</a>.</p>
<p dir="auto"><code class="notranslate">--cov-cutoff &lt;float&gt;</code><br>
Read coverage cutoff value. Must be a positive float value, or "auto", or "off". Default value is "off". When set to "auto" SPAdes automatically computes coverage threshold using conservative strategy. Note, that this option is not supported by metaSPAdes.</p>
<p dir="auto"><code class="notranslate">--phred-offset &lt;33 or 64&gt;</code><br>
PHRED quality offset for the input reads, can be either 33 or 64. It will be auto-detected if it is not specified.</p>
<p dir="auto"><code class="notranslate">--custom-hmms &lt;file or directory&gt;</code><br>
File or directory with amino acid HMMs for <a href="#hmm">HMM-guided mode</a>.</p>
<p dir="auto"><a name="examples"></a></p>
<h3 dir="auto">Examples</h3>
<p dir="auto">To test the toy data set, you can also run the following command from the SPAdes <code class="notranslate">bin</code> directory:</p>
<div class="highlight highlight-source-shell"><pre>    spades.py --pe1-1 ../share/spades/test_dataset/ecoli_1K_1.fq.gz \
    --pe1-2 ../share/spades/test_dataset/ecoli_1K_2.fq.gz -o spades_test</pre></div>
<p dir="auto">If you have your library separated into several pairs of files, for example:</p>
<div class="highlight highlight-source-shell"><pre>    lib1_forward_1.fastq
    lib1_reverse_1.fastq
    lib1_forward_2.fastq
    lib1_reverse_2.fastq</pre></div>
<p dir="auto">make sure that corresponding files are given in the same order:</p>
<div class="highlight highlight-source-shell"><pre>    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</pre></div>
<p dir="auto">Files with interlacing paired-end reads or files with unpaired reads can be specified in any order with one file per option, for example:</p>
<div class="highlight highlight-source-shell"><pre>    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</pre></div>
<p dir="auto">If you have several paired-end and mate-pair reads, for example:</p>
<p dir="auto">paired-end library 1</p>
<div class="highlight highlight-source-shell"><pre>    lib_pe1_left.fastq
    lib_pe1_right.fastq</pre></div>
<p dir="auto">mate-pair library 1</p>
<div class="highlight highlight-source-shell"><pre>    lib_mp1_left.fastq
    lib_mp1_right.fastq</pre></div>
<p dir="auto">mate-pair library 2</p>
<div class="highlight highlight-source-shell"><pre>    lib_mp2_left.fastq
    lib_mp2_right.fastq</pre></div>
<p dir="auto">make sure that files corresponding to each library are grouped together:</p>
<div class="highlight highlight-source-shell"><pre>    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</pre></div>
<p dir="auto">If you have IonTorrent unpaired reads, PacBio CLR and additional reliable contigs:</p>
<div class="highlight highlight-source-shell"><pre>    it_reads.fastq
    pacbio_clr.fastq
    contigs.fasta</pre></div>
<p dir="auto">run SPAdes with the following command:</p>
<div class="highlight highlight-source-shell"><pre>    spades.py --iontorrent -s it_reads.fastq \
    --pacbio pacbio_clr.fastq --trusted-contigs contigs.fastq \
    -o spades_output</pre></div>
<p dir="auto">If a single-read library is split into several files:</p>
<div class="highlight highlight-source-shell"><pre>    unpaired1_1.fastq
    unpaired1_2.fastq
    unpaired1_3.fasta</pre></div>
<p dir="auto">specify them as one library:</p>
<div class="highlight highlight-source-shell"><pre>    spades.py --s1 unpaired1_1.fastq \
    --s1 unpaired1_2.fastq --s1 unpaired1_3.fastq \
    -o spades_output</pre></div>
<p dir="auto">All options for specifying input data can be mixed if needed, but make sure that files for each library are grouped and files with left and right paired reads are listed in the same order. <a href=""></a></p>
<p dir="auto"><a name="sec3.3"></a></p>
<h2 dir="auto">Assembling IonTorrent reads</h2>
<p dir="auto">Only FASTQ or BAM files are supported as input.</p>
<p dir="auto">The selection of k-mer length is non-trivial for IonTorrent. If the dataset is more or less conventional (good coverage, not high GC, etc), then use our <a href="#sec3.4">recommendation for long reads</a> (e.g. assemble using k-mer lengths 21,33,55,77,99,127). However, due to increased error rate some changes of k-mer lengths (e.g. selection of shorter ones) may be required. For example, if you ran SPAdes with k-mer lengths 21,33,55,77 and then decided to assemble the same data set using more iterations and larger values of K, you can run SPAdes once again specifying the same output folder and the following options: <code class="notranslate">--restart-from k77 -k 21,33,55,77,99,127 --mismatch-correction -o &lt;previous_output_dir&gt;</code>. Do not forget to copy contigs and scaffolds from the previous run. We are planning to tackle issue of selecting k-mer lengths for IonTorrent reads in next versions.</p>
<p dir="auto">You may need no error correction for Hi-Q enzyme at all. However, we suggest trying to assemble your data with and without error correction and select the best variant.</p>
<p dir="auto">For non-trivial datasets (e.g. with high GC, low or uneven coverage) we suggest to enable single-cell mode (setting <code class="notranslate">--sc</code> option) and use k-mer lengths of 21,33,55. <a href=""></a></p>
<p dir="auto"><a name="sec3.4"></a><br>
<a name="illumina_long"></a></p>
<h2 dir="auto">Assembling long Illumina paired reads (2x150 and 2x250)</h2>
<p dir="auto">Recent advances in DNA sequencing technology have led to a rapid increase in read length. Nowadays, it is a common situation to have a data set consisting of 2x150 or 2x250 paired-end reads produced by Illumina MiSeq or HiSeq2500. However, the use of longer reads alone will not automatically improve assembly quality. An assembler that can properly take advantage of them is needed.</p>
<p dir="auto">SPAdes use of iterative k-mer lengths allows benefiting from the full potential of the long paired-end reads. Currently one has to set the assembler options up manually, but we plan to incorporate automatic calculation of necessary options soon.</p>
<p dir="auto">Please note that in addition to the read length, the insert length also matters a lot. It is not recommended to sequence a 300bp fragment with a pair of 250bp reads. We suggest using 350-500 bp fragments with 2x150 reads and 550-700 bp fragments with 2x250 reads.</p>
<p dir="auto"><a name="illumina150"></a></p>
<h3 dir="auto">Multi-cell data set with read length 2x150 bp</h3>
<p dir="auto">Do not turn off SPAdes error correction (BayesHammer module), which is included in SPAdes default pipeline.</p>
<p dir="auto">If you have enough coverage (50x+), then you may want to try to set k-mer lengths of 21, 33, 55, 77 (selected by default for reads with length 150bp).</p>
<p dir="auto">Make sure you run assembler with the <code class="notranslate">--careful</code> option to minimize number of mismatches in the final contigs.</p>
<p dir="auto">We recommend that you check the SPAdes log file at the end of the each iteration to control the average coverage of the contigs.</p>
<p dir="auto">For reads corrected prior to running the assembler:</p>
<div class="highlight highlight-source-shell"><pre>    spades.py -k 21,33,55,77 --careful --only-assembler <span class="pl-k">&lt;</span>your reads<span class="pl-k">&gt;</span> -o spades_output</pre></div>
<p dir="auto">To correct and assemble the reads:</p>
<div class="highlight highlight-source-shell"><pre>    spades.py -k 21,33,55,77 --careful <span class="pl-k">&lt;</span>your reads<span class="pl-k">&gt;</span> -o spades_output</pre></div>
<p dir="auto"><a name="illumina250"></a></p>
<h3 dir="auto">Multi-cell data set with read lengths 2x250 bp</h3>
<p dir="auto">Do not turn off SPAdes error correction (BayesHammer module), which is included in SPAdes default pipeline.</p>
<p dir="auto">By default we suggest to increase k-mer lengths in increments of 22 until the k-mer length reaches 127. The exact length of the k-mer depends on the coverage: k-mer length of 127 corresponds to 50x k-mer coverage and higher. For read length 250bp SPAdes automatically chooses K values equal to 21, 33, 55, 77, 99, 127.</p>
<p dir="auto">Make sure you run assembler with <code class="notranslate">--careful</code> option to minimize number of mismatches in the final contigs.</p>
<p dir="auto">We recommend you to check the SPAdes log file at the end of the each iteration to control the average coverage of the contigs.</p>
<p dir="auto">For reads corrected prior to running the assembler:</p>
<div class="highlight highlight-source-shell"><pre>    spades.py -k 21,33,55,77,99,127 --careful --only-assembler <span class="pl-k">&lt;</span>your reads<span class="pl-k">&gt;</span> -o spades_output</pre></div>
<p dir="auto">To correct and assemble the reads:</p>
<div class="highlight highlight-source-shell"><pre>    spades.py -k 21,33,55,77,99,127 --careful <span class="pl-k">&lt;</span>your reads<span class="pl-k">&gt;</span> -o spades_output</pre></div>
<p dir="auto"><a name="illumina_long_sc"></a></p>
<h3 dir="auto">Single-cell data set with read lengths 2 x 150 or 2 x 250</h3>
<p dir="auto">The default k-mer lengths are recommended. For single-cell data sets SPAdes selects k-mer sizes 21, 33 and 55.</p>
<p dir="auto">However, it might be tricky to fully utilize the advantages of long reads you have. Consider contacting us for more information and to discuss assembly strategy.<br>
<a href=""></a></p>
<p dir="auto"><a name="hmm"></a></p>
<h2 dir="auto">HMM-guided mode</h2>
<p dir="auto">The majority of SPAdes assembly modes (normal multicell, single-cell, rnaviral, meta and of course biosynthetic) also supports HMM-guided mode as implemented in biosyntheticSPAdes. The detailed description could be found in <a href="https://genome.cshlp.org/content/early/2019/06/03/gr.243477.118" rel="nofollow">biosyntheticSPAdes paper</a>, but in short: amino acid profile HMMs are aligned to the edges of assembly graph. After this the subgraphs containing the set of matches ("domains") are extracted and all possible paths through the domains that are supported both by paired-end data (via scaffolds) and graph topology are obtained (putative biosynthetic gene clusters).</p>
<p dir="auto">HMM-guided mode could be enabled via providing a set of HMMs via <code class="notranslate">--custom-hmms</code> option. In HMM guided mode the set of contigs and scaffolds (see section <a href="#spadesoutput">SPAdes output</a> for more information about SPAdes output) is kept intact, however additional <a href="#bgc">biosyntheticSPAdes output</a> represents the output of HMM-guided assembly.</p>
<p dir="auto">Note that normal biosyntheticSPAdes mode (via <code class="notranslate">--bio</code> option) is a bit different from HMM-guided mode: besides using the special set of profile HMMS representing a family of NRSP/PKS domains also includes a set of assembly graph simplification and processing settings aimed for fuller recovery of biosynthetic gene clusters.</p>
<p dir="auto">Given an increased interest in coronavirus research we developed a coronavirus assembly mode for SPAdes assembler (also known as coronaSPAdes). It allows to assemble full-length coronaviridae genomes from the transcriptomic and metatranscriptomic data. Algorithmically, coronaSPAdes is an rnaviralSPAdes that uses the set of HMMs from Pfam SARS-CoV-2 2.0 set as well as additional HMMs as outlined by <a href="https://doi.org/10.1093/ve/vey035" rel="nofollow">(Phan et al, 2019)</a>. coronaSPAdes could be run via a dedicated <code class="notranslate">coronaspades.py</code> script. See <a href="https://www.biorxiv.org/content/10.1101/2020.07.28.224584v1" rel="nofollow">coronaSPAdes preprint</a> for more information about rnaviralSPAdes,  coronaSPAdes and HMM-guided mode. Output for any HMM-related mode (--bio, --corona, or --custom-hmms flags) is the same with biosyntheticSPAdes' output.</p>
<p dir="auto"><a name="spadesoutput"></a></p>
<h2 dir="auto">SPAdes output</h2>
<p dir="auto">SPAdes stores all output files in <code class="notranslate">&lt;output_dir&gt; </code>, which is set by the user.</p>
<ul dir="auto">
<li><code class="notranslate">&lt;output_dir&gt;/corrected/</code> directory contains reads corrected by BayesHammer in <code class="notranslate">*.fastq.gz</code> files; if compression is disabled, reads are stored in uncompressed <code class="notranslate">*.fastq</code> files</li>
<li><code class="notranslate">&lt;output_dir&gt;/scaffolds.fasta</code> contains resulting scaffolds (recommended for use as resulting sequences)</li>
<li><code class="notranslate">&lt;output_dir&gt;/contigs.fasta</code> contains resulting contigs</li>
<li><code class="notranslate">&lt;output_dir&gt;/assembly_graph_with_scaffolds.gfa</code> contains SPAdes assembly graph and scaffolds paths in <a href="https://github.com/GFA-spec/GFA-spec/blob/master/GFA1.md">GFA 1.0 format</a></li>
<li><code class="notranslate">&lt;output_dir&gt;/assembly_graph.fastg</code> contains SPAdes assembly graph in <a href="http://fastg.sourceforge.net/FASTG_Spec_v1.00.pdf" rel="nofollow">FASTG format</a></li>
<li><code class="notranslate">&lt;output_dir&gt;/contigs.paths</code> contains paths in the assembly graph corresponding to contigs.fasta (see details below)</li>
<li><code class="notranslate">&lt;output_dir&gt;/scaffolds.paths</code> contains paths in the assembly graph corresponding to scaffolds.fasta (see details below)</li>
</ul>
<p dir="auto"><a name="spadesoutput:contigs"></a></p>
<h3 dir="auto">Contigs and scaffolds format</h3>
<p dir="auto">Contigs/scaffolds names in SPAdes output FASTA files have the following format:<br>
<code class="notranslate">&gt;NODE_3_length_237403_cov_243.207</code><br>
Here <code class="notranslate">3</code> is the number of the contig/scaffold, <code class="notranslate">237403</code> is the sequence length in nucleotides and <code class="notranslate">243.207</code> is the k-mer coverage for the last (largest) k value used. Note that the k-mer coverage is always lower than the read (per-base) coverage.</p>
<p dir="auto">In general, SPAdes uses two techniques for joining contigs into scaffolds. First one relies on read pairs and tries to estimate the size of the gap separating contigs. The second one relies on the assembly graph: e.g. if two contigs are separated by a complex tandem repeat, that cannot be resolved exactly, contigs are joined into scaffold with a fixed gap size of 100 bp. Contigs produced by SPAdes do not contain N symbols.</p>
<p dir="auto"><a name="spadesoutput:graph"></a></p>
<h3 dir="auto">Assembly graph formats</h3>
<p dir="auto">To view FASTG and GFA files we recommend to use <a href="http://rrwick.github.io/Bandage/" rel="nofollow">Bandage visualization tool</a>. Note that sequences stored in <code class="notranslate">assembly_graph.fastg</code> correspond to contigs before repeat resolution (edges of the assembly graph). Paths corresponding to contigs after repeat resolution (scaffolding) are stored in <code class="notranslate">contigs.paths</code> (<code class="notranslate">scaffolds.paths</code>) in the format accepted by Bandage (see <a href="https://github.com/rrwick/Bandage/wiki/Graph-paths">Bandage wiki</a> for details). The example is given below.</p>
<p dir="auto">Let the contig with the name <code class="notranslate">NODE_5_length_100000_cov_215.651</code> consist of the following edges of the assembly graph:</p>
<pre lang="plain" class="notranslate"><code class="notranslate">    &gt;EDGE_2_length_33280_cov_199.702
    &gt;EDGE_5_length_84_cov_321.414"
    &gt;EDGE_3_length_111_cov_175.304
    &gt;EDGE_5_length_84_cov_321.414"
    &gt;EDGE_4_length_66661_cov_223.548
</code></pre>
<p dir="auto">Then, <code class="notranslate">contigs.paths</code> will contain the following record:</p>
<pre lang="plain" class="notranslate"><code class="notranslate">    NODE_5_length_100000_cov_215.651
    2+,5-,3+,5-,4+
</code></pre>
<p dir="auto">Since the current version of Bandage does not accept paths with gaps, paths corresponding contigs/scaffolds jumping over a gap in the assembly graph are split by semicolon at the gap positions. For example, the following record</p>
<pre lang="plain" class="notranslate"><code class="notranslate">    NODE_3_length_237403_cov_243.207
    21-,17-,15+,17-,16+;
    31+,23-,22+,23-,4-
</code></pre>
<p dir="auto">states that <code class="notranslate">NODE_3_length_237403_cov_243.207</code> corresponds to the path with 10 edges, but jumps over a gap between edges <code class="notranslate">EDGE_16_length_21503_cov_482.709</code> and <code class="notranslate">EDGE_31_length_140767_cov_220.239</code>.</p>
<p dir="auto"><a name="spadesoutput:full"></a></p>
<h3 dir="auto">Complete list of output files</h3>
<p dir="auto">The full list of <code class="notranslate">&lt;output_dir&gt;</code> content is presented below:</p>
<ul dir="auto">
<li>
<p dir="auto">scaffolds.fasta - resulting scaffolds (recommended for use as resulting sequences)</p>
</li>
<li>
<p dir="auto">contigs.fasta - resulting contigs</p>
</li>
<li>
<p dir="auto">assembly_graph.fastg - assembly graph</p>
</li>
<li>
<p dir="auto">contigs.paths - contigs paths in the assembly graph</p>
</li>
<li>
<p dir="auto">scaffolds.paths - scaffolds paths in the assembly graph</p>
</li>
<li>
<p dir="auto">before_rr.fasta - contigs before repeat resolution</p>
</li>
<li>
<p dir="auto">corrected/ - files from read error correction</p>
<ul dir="auto">
<li>configs/ - configuration files for read error correction</li>
<li>corrected.yaml - internal configuration file</li>
<li>Output files with corrected reads</li>
</ul>
</li>
<li>
<p dir="auto">params.txt - information about SPAdes parameters in this run</p>
</li>
<li>
<p dir="auto">spades.log - SPAdes log</p>
</li>
<li>
<p dir="auto">dataset.info - internal configuration file</p>
</li>
<li>
<p dir="auto">input_dataset.yaml - internal YAML data set file</p>
</li>
<li>
<p dir="auto">K&lt;##&gt;/ - directory containing intermediate files from the run with K=&lt;##&gt;. These files should not be used as assembly results; use resulting contigs/scaffolds in files mentioned above.</p>
</li>
</ul>
<p dir="auto">SPAdes will overwrite these files and directories if they exist in the specified <code class="notranslate">&lt;output_dir&gt;</code>. <a href=""></a></p>
<p dir="auto"><a name="plasmidout"></a></p>
<h2 dir="auto">plasmidSPAdes output</h2>
<p dir="auto">plasmidSPAdes and metaplasmidSPAdes output only DNA sequences from putative plasmids. Output file names and formats remain the same as in SPAdes (see <a href="#spadesoutput">previous</a> section), with the following differences.</p>
<p dir="auto">For all plasmidSPAdes' contig names in <code class="notranslate">contigs.fasta</code>, <code class="notranslate">scaffolds.fasta</code> and <code class="notranslate">assembly_graph.fastg</code> we append suffix <code class="notranslate">_component_X</code>, where <code class="notranslate">X</code> is the id of the putative plasmid, which the contig belongs to. Note that plasmidSPAdes may not be able to separate similar plasmids and thus their contigs may appear with the same id. <a href=""></a></p>
<p dir="auto"><a name="metapv"></a></p>
<h2 dir="auto">metaplasmidSPAdes/metaviralSPAdes output</h2>
<p dir="auto">The repeat resolution and extrachromosomal element detection in metaplasmidSPAdes/metaviralSPAdes is run independently for different coverage cutoffs values (see <a href="https://genome.cshlp.org/content/29/6/961.short" rel="nofollow">paper</a> for details). In order to distinguish contigs with putative plasmids detected at different cutoff levels we extend the contig name in FASTA file with cutoff value used for this particular contig (in format <code class="notranslate">_cutoff_N</code>). This is why, in the contrast to regular SPAdes pipeline, there might be a contig with <code class="notranslate">NODE_1_</code> prefix for each cutoff with potential plasmids detected. In following example, there were detected two potential viruses using cutoff 0, one virus was detected with cutoff 5 and one with cutoff 10.<br>
Also, we add a suffix that shows the structure of the suspective extrachromosomal element.<br>
For metaplasmid mode we output only circular putative plasmids.<br>
For metaviral mode we also output linear putative viruses and linear viruses with simple repeats ('9'-shaped components in the assembly graph) sequences.</p>
<pre lang="plain" class="notranslate"><code class="notranslate">&gt;NODE_1_length_40003_cov_13.48_cutoff_0_type_circular
&gt;NODE_2_length_30000_cov_4.20_cutoff_0_type_linear
&gt;NODE_1_length_20000_cov_20.42_cutoff_5_type_circular
&gt;NODE_1_length_10000_cov_198.4_cutoff_10_type_linearrepeat
</code></pre>
<p dir="auto"><a name="bgc"></a></p>
<h2 dir="auto">biosyntheticSPAdes output</h2>
<p dir="auto">biosyntheticSPAdes outputs four files of interest:</p>
<ul dir="auto">
<li>scaffolds.fasta – contains DNA sequences from putative biosynthetic gene clusters (BGC). Since each sample may contain multiple BGCs and biosyntheticSPAdes can output several putative DNA sequences for eash cluster, for each contig name we append suffix <code class="notranslate">_cluster_X_candidate_Y</code>, where X is the id of the BGC and Y is the id of the candidate from the BGC.</li>
<li>raw_scaffolds.fasta – SPAdes scaffolds generated without domain-graph related algorithms. Very close to regular scaffolds.fasta file.</li>
<li>hmm_statistics.txt – contains statistics about BGC composition in the sample. First, it outputs number of domain hits in the sample. Then, for each BGC candidate we output domain order with positions on the corresponding DNA sequence from scaffolds.fasta.</li>
<li>domain_graph.dot – contains domain graph structure, that can be used to assess complexity of the sample and structure of BGCs. For more information about domain graph construction, please refer to the paper.</li>
</ul>
<p dir="auto"><a name="eval"></a></p>
<h2 dir="auto">Assembly evaluation</h2>
<p dir="auto"><a href="http://cab.spbu.ru/software/quast/" rel="nofollow">QUAST</a> may be used to generate summary statistics (N50, maximum contig length, GC %, # genes found in a reference list or with built-in gene finding tools, etc.) for a single assembly. It may also be used to compare statistics for multiple assemblies of the same data set (e.g., SPAdes run with different parameters, or several different assemblers).<br>
<a href=""></a></p>
<p dir="auto"><a name="sec4"></a></p>
<h1 dir="auto">Stand-alone binaries released within SPAdes package</h1>
<p dir="auto"><a name="sec4.1"></a></p>
<h2 dir="auto">k-mer counting</h2>
<p dir="auto">To provide input data to SPAdes k-mer counting tool <code class="notranslate">spades-kmercounter </code> you may just specify files in <a href="#sec3.1">SPAdes-supported formats</a> without any flags (after all options) or provide dataset description file in YAML format.</p>
<p dir="auto">Output: &lt;output_dir&gt;/final_kmers - unordered set of kmers in binary format. Kmers from both forward a<br>
nd reverse-complementary reads are taken into account.</p>
<p dir="auto">Output format: All kmers are written sequentially without any separators. Each kmer takes the same nu<br>
mber of bits. One kmer of length K takes 2*K bits. Kmers are aligned by 64 bits. For example, one kme<br>
r with length=21 takes 8 bytes, with length=33 takes 16 bytes, and with length=55 takes 16 bytes. Eac<br>
h nucleotide is coded with 2 bits: 00 - A, 01 - C, 10 - G, 11 - T.</p>
<p dir="auto">Example:</p>
<pre class="notranslate"><code class="notranslate">    For kmer: AGCTCT
    Memory: 6 bits * 2 = 12, 64 bits (8 bytes)
    Let’s describe bytes:
    data[0] = AGCT -&gt; 11 01 10 00 -&gt; 0xd8                                
    data[1] = CT00 -&gt; 00 00 11 01 -&gt; 0x0d
    data[2] = 0000 -&gt; 00 00 00 00 -&gt; 0x00
    data[3] = 0000 -&gt; 00 00 00 00 -&gt; 0x00
    data[4] = 0000 -&gt; 00 00 00 00 -&gt; 0x00
    data[5] = 0000 -&gt; 00 00 00 00 -&gt; 0x00
    data[6] = 0000 -&gt; 00 00 00 00 -&gt; 0x00
    data[7] = 0000 -&gt; 00 00 00 00 -&gt; 0x00
</code></pre>
<p dir="auto">Synopsis: <code class="notranslate">spades-kmercount [OPTION...] &lt;input files&gt;</code></p>
<p dir="auto">The options are:</p>
<p dir="auto"><code class="notranslate">-d, --dataset file &lt;file name&gt; </code><br>
dataset description (in YAML format), input files ignored</p>
<p dir="auto"><code class="notranslate">-k, --kmer &lt;int&gt; </code><br>
k-mer length (default: 21)</p>
<p dir="auto"><code class="notranslate">-t, --threads &lt;int&gt; </code><br>
number of threads to use (default: number of CPUs)</p>
<p dir="auto"><code class="notranslate">-w, --workdir &lt;dir name&gt; </code><br>
working directory to use (default: current directory)</p>
<p dir="auto"><code class="notranslate">-b, --bufsize &lt;int&gt; </code><br>
sorting buffer size in bytes, per thread (default 536870912)</p>
<p dir="auto"><code class="notranslate">-h, --help </code><br>
print help message</p>
<p dir="auto"><a name="sec4.2"></a></p>
<h2 dir="auto">k-mer coverage read filter</h2>
<p dir="auto"><code class="notranslate">spades-read-filter</code> is a tool for filtering reads with median kmer coverage less than threshold.</p>
<p dir="auto">To provide input data to SPAdes k-mer read filter tool <code class="notranslate">spades-read-filter </code> you should provide dataset description file in YAML format.</p>
<p dir="auto">Synopsis: <code class="notranslate">spades-read-filter [OPTION...] -d &lt;yaml&gt;</code></p>
<p dir="auto">The options are:</p>
<p dir="auto"><code class="notranslate">-d, --dataset file &lt;file name&gt; </code><br>
dataset description (in YAML format)</p>
<p dir="auto"><code class="notranslate">-k, --kmer &lt;int&gt; </code><br>
k-mer length (default: 21)</p>
<p dir="auto"><code class="notranslate">-t, --threads &lt;int&gt; </code><br>
number of threads to use (default: number of CPUs)</p>
<p dir="auto"><code class="notranslate">-o, --outdir &lt;dir&gt; </code><br>
output directory to use (default: current directory)</p>
<p dir="auto"><code class="notranslate">-c, --cov &lt;value&gt; </code><br>
median kmer count threshold (read pairs, s.t. kmer count median for BOTH reads LESS OR EQUAL to this value will be ignored)</p>
<p dir="auto"><code class="notranslate">-h, --help </code><br>
print help message</p>
<p dir="auto"><a name="sec4.3"></a></p>
<h2 dir="auto">k-mer cardinality estimating</h2>
<p dir="auto"><code class="notranslate">spades-kmer-estimating </code> is a tool for estimating approximate number of unique k-mers in the provided reads. Kmers from reverse-complementary reads aren"t taken into account for k-mer cardinality estimating.</p>
<p dir="auto">To provide input data to SPAdes k-mer cardinality estimating tool <code class="notranslate">spades-kmer-estimating </code> you should provide dataset description file in YAML format.</p>
<p dir="auto">Synopsis: <code class="notranslate">spades-kmer-estimating [OPTION...] -d &lt;yaml&gt;</code></p>
<p dir="auto">The options are:</p>
<p dir="auto"><code class="notranslate">-d, --dataset file &lt;file name&gt; </code><br>
dataset description (in YAML format)</p>
<p dir="auto"><code class="notranslate">-k, --kmer &lt;int&gt; </code><br>
k-mer length (default: 21)</p>
<p dir="auto"><code class="notranslate">-t, --threads &lt;int&gt; </code><br>
number of threads to use (default: number of CPUs)</p>
<p dir="auto"><code class="notranslate">-h, --help </code><br>
print help message</p>
<p dir="auto"><a name="sec4.4"></a></p>
<h2 dir="auto">Graph construction</h2>
<p dir="auto">Graph construction tool <code class="notranslate">spades-gbuilder </code> has two mandatory options: dataset description file in YAML format and an output file name.</p>
<p dir="auto">Synopsis: <code class="notranslate">spades-gbuilder &lt;dataset description (in YAML)&gt; &lt;output filename&gt; [-k &lt;value&gt;] [-t &lt;value&gt;] [-tmpdir &lt;dir&gt;] [-b &lt;value&gt;] [-unitigs|-fastg|-gfa|-spades]</code></p>
<p dir="auto">Additional options are:</p>
<p dir="auto"><code class="notranslate">-k &lt;int&gt; </code><br>
k-mer length used for construction (must be odd)</p>
<p dir="auto"><code class="notranslate">-t &lt;int&gt; </code><br>
number of threads</p>
<p dir="auto"><code class="notranslate">-tmp-dir &lt;dir_name&gt;  </code><br>
scratch directory to use</p>
<p dir="auto"><code class="notranslate">-b &lt;int&gt; </code><br>
sorting buffer size (per thread, in bytes)</p>
<p dir="auto"><code class="notranslate">-unitigs </code><br>
k-mer length used for construction (must be odd)</p>
<p dir="auto"><code class="notranslate">-fastg </code><br>
output graph in FASTG format</p>
<p dir="auto"><code class="notranslate">-gfa </code><br>
output graph in GFA1 format</p>
<p dir="auto"><code class="notranslate">-spades </code><br>
output graph in SPAdes internal format</p>
<p dir="auto"><a name="sec4.5"></a></p>
<h2 dir="auto">Long read to graph alignment</h2>
<p dir="auto"><a name="sec4.5.1"></a></p>
<h3 dir="auto">hybridSPAdes aligner</h3>
<p dir="auto">A tool <code class="notranslate">spades-gmapper </code> gives opportunity to extract long read alignments generated with hybridSPAdes pipeline options. It has three mandatory options: dataset description file in YAML format, graph file in GFA format and an output file name.</p>
<p dir="auto">Synopsis: <code class="notranslate">spades-gmapper &lt;dataset description (in YAML)&gt; &lt;graph (in GFA)&gt; &lt;output filename&gt; [-k &lt;value&gt;] [-t &lt;value&gt;] [-tmpdir &lt;dir&gt;]</code></p>
<p dir="auto">Additional options are:</p>
<p dir="auto"><code class="notranslate">-k &lt;int&gt; </code><br>
k-mer length that was used for graph construction</p>
<p dir="auto"><code class="notranslate">-t &lt;int&gt; </code><br>
number of threads</p>
<p dir="auto"><code class="notranslate">-tmpdir &lt;dir_name&gt;  </code><br>
scratch directory to use</p>
<p dir="auto">While <code class="notranslate">spades-mapper</code> is a solution for those who work on hybridSPAdes assembly and want to get exactly its intermediate results, <a href="#sec4.5.2">SPAligner</a> is an end-product application for sequence-to-graph alignment with tunable parameters and output types.</p>
<p dir="auto"><a name="sec4.5.2"></a></p>
<h3 dir="auto">SPAligner</h3>
<p dir="auto">A tool for fast and accurate alignment of nucleotide sequences to assembly graphs. It takes file with sequences (in fasta/fastq format) and assembly in GFA format and outputs long read to graph alignment in various formats (such as tsv, fasta and <a href="https://github.com/ocxtal/gpa" title="GPA-format spec">GPA</a>).</p>
<p dir="auto">Synopsis: <code class="notranslate">spaligner assembly/src/projects/spaligner_config.yaml -d &lt;value&gt; -s &lt;value&gt; -g &lt;value&gt; -k &lt;value&gt; [-t &lt;value&gt;] [-o &lt;value&gt;]</code></p>
<p dir="auto">Parameters are:</p>
<p dir="auto"><code class="notranslate">-d &lt;type&gt; </code><br>
long reads type: nanopore, pacbio</p>
<p dir="auto"><code class="notranslate">-s &lt;filename&gt; </code><br>
file with sequences (in fasta/fastq)</p>
<p dir="auto"><code class="notranslate">-g &lt;filename&gt; </code><br>
file with graph (in GFA)</p>
<p dir="auto"><code class="notranslate">-k &lt;int&gt; </code><br>
k-mer length that was used for graph construction</p>
<p dir="auto"><code class="notranslate">-t &lt;int&gt; </code><br>
number of threads (default: 8)</p>
<p dir="auto"><code class="notranslate">-o, --outdir &lt;dir&gt; </code><br>
output directory to use (default: spaligner_result/)</p>
<p dir="auto">For more information on parameters and options please refer to main SPAligner manual (assembler/src/projects/spaligner/README.md).</p>
<p dir="auto">Also if you want to align protein sequences please refer to our <a href="https://github.com/ablab/spades/releases/tag/spaligner-paper">pre-release version</a>.</p>
<p dir="auto"><a name="sec5"></a></p>
<h1 dir="auto">Citation</h1>
<p dir="auto">If you use SPAdes in your research, please cite <a href="https://currentprotocols.onlinelibrary.wiley.com/doi/abs/10.1002/cpbi.102" rel="nofollow">our latest paper</a>.</p>
<p dir="auto">In case you perform hybrid assembly using  PacBio or Nanopore reads, you may also cite <a href="http://bioinformatics.oxfordjournals.org/content/early/2015/11/20/bioinformatics.btv688.short" rel="nofollow">Antipov et al., 2015</a>. If you use multiple paired-end and/or mate-pair libraries you may additionally cite papers describing SPAdes repeat resolution algorithms <a href="http://bioinformatics.oxfordjournals.org/content/30/12/i293.short" rel="nofollow">Prjibelski et al., 2014</a> and <a href="http://bioinformatics.oxfordjournals.org/content/31/20/3262.abstract" rel="nofollow">Vasilinetc et al., 2015</a>.</p>
<p dir="auto">If you use other pipelines, please cite the following papers:</p>
<ul dir="auto">
<li>metaSPAdes: <a href="https://genome.cshlp.org/content/27/5/824.short" rel="nofollow">Nurk et al., 2017</a>.</li>
<li>plasmidSPAdes: <a href="https://academic.oup.com/bioinformatics/article/32/22/3380/2525610" rel="nofollow">Antipov et al., 2016</a>.</li>
<li>metaplasmidSPAdes / plasmidVerify: <a href="https://genome.cshlp.org/content/29/6/961.short" rel="nofollow">Antipov et al., 2019</a></li>
<li>metaviralSPAdes / viralVerify: <a href="https://academic.oup.com/bioinformatics/article-abstract/36/14/4126/5837667" rel="nofollow">Antipov et al., 2020</a></li>
<li>rnaSPAdes: <a href="https://academic.oup.com/gigascience/article/8/9/giz100/5559527" rel="nofollow">Bushmanova et al., 2019</a>.</li>
<li>biosyntheticSPAdes: <a href="https://genome.cshlp.org/content/early/2019/06/03/gr.243477.118?top=1" rel="nofollow">Meleshko et al., 2019</a>.</li>
<li>coronaSPAdes paper is currently available at <a href="https://www.biorxiv.org/content/10.1101/2020.07.28.224584v1.abstract" rel="nofollow">bioRxiv</a>.</li>
</ul>
<p dir="auto">You may also include older papers <a href="http://link.springer.com/chapter/10.1007%2F978-3-642-37195-0_13" rel="nofollow">Nurk, Bankevich et al., 2013</a> or <a href="http://online.liebertpub.com/doi/abs/10.1089/cmb.2012.0021" rel="nofollow">Bankevich, Nurk et al., 2012</a>, especially if you assemble single-cell data.</p>
<p dir="auto">In addition, we would like to list your publications that use our software on our website. Please email the reference, the name of your lab, department and institution to <a href="mailto:spades.support@cab.spbu.ru">spades.support@cab.spbu.ru</a></p>
<p dir="auto"><a name="sec6"></a></p>
<h1 dir="auto">Feedback and bug reports</h1>
<p dir="auto">Your comments, bug reports, and suggestions are very welcomed. They will help us to further improve SPAdes. If you have any troubles running SPAdes, please send us <code class="notranslate">params.txt</code> and <code class="notranslate">spades.log</code> from the directory <code class="notranslate">&lt;output_dir&gt;</code>.</p>
<p dir="auto">You can leave your comments and bug reports at <a href="https://github.com/ablab/spades/issues">our GitHub repository tracker</a> or sent it via e-mail: <a href="mailto:spades.support@cab.spbu.ru">spades.support@cab.spbu.ru</a></p><br/><br/><br/><br/><br/> </body> </html>