-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbarracuda.1
392 lines (360 loc) · 11.6 KB
/
barracuda.1
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
.TH barracuda 1 "15 February 2016" "barracuda-0.7.107" "Bioinformatics tools"
.SH NAME
.PP
BarraCUDA - A Fast Short Read Aligner using GPUs
.SH SYNOPSIS
.PP
barracuda index database.fasta
.PP
barracuda aln database.fasta short_read.fastq > aln_sa.sai
.PP
barracuda samse database.fasta aln_sa.sai short_read.fastq > aln.sam
.PP
barracuda sampe database.fasta aln_sa1.sai aln_sa2.sai read1.fq read2.fq > aln.sam
.SH DESCRIPTION
.PP
Barracuda is a high-speed sequence aligner based on Sanger's BWA and
uses the latest Nvidia CUDA architecture for accelerating alignments
of sequence reads generated by next-generation sequencers.
.PP
Before performing any read alignment, the reference genome in the FASTA format
must be first indexed with the
.B `index'
command, which typically takes 1-2 hours. The indexing is an one off procedure
and the indexed genomes can be re-used from time to time. It is also useful to note that
the indexed genomes from BarraCUDA is compatible with
BWA v0.7 or above.
After indexing, the reads can then be mapped using the
.B `aln'
command, which finds the suffix array (SA) coordinates of good hits of
each individual read, and the
.B `samse/sampe'
command, which converts SA coordinates to chromosomal coordinate and
pairs reads (for `sampe').
.SH COMMANDS AND OPTIONS
.TP
.B index
barracuda index [-p prefix] [-a algoType] [-c] <in.db.fasta>
Index database sequences in the FASTA format. If the algorithm is not specified, the program will choose automatically based on the reference genome size.
.B OPTIONS:
.RS
.TP 10
.B -c
Build color-space index. The input fast should be in nucleotide space.
.TP
.BI -p \ STR
Prefix of the output database [same as db filename]
.TP
.BI -a \ STR
Algorithm for constructing BWT index. Available options are:
.RS
.TP
.B is
IS linear-time algorithm for constructing suffix array. It requires
5.37N memory where N is the size of the database. IS is moderately fast,
but does not work with database larger than 2GB.
.TP
.B bwtsw
Algorithm implemented in BWT-SW. This method works with the whole human
genome, but it does not work with database smaller than 10MB and it is
usually slower than IS.
.RE
.RE
.TP
.B aln
barracuda aln [-n maxDiff] [-o maxGapO] [-e maxGapE] [-d nDelTail] [-i
nIndelEnd] [-k maxSeedDiff] [-l seedLen] [-t nThrds] [-cRN] [-M misMsc]
[-O gapOsc] [-E gapEsc] [-L logGap][-B bwaOutput][-C cudaDevice][-a maxAln] <in.db.fasta> <in.query.fq> >
<out.sai>
Find the SA coordinates of the input reads. Maximum
.I maxSeedDiff
differences are allowed in the first
.I seedLen
subsequence and maximum
.I maxDiff
differences are allowed in the whole sequence.
.B OPTIONS:
.RS
.TP 10
.BI -n \ NUM
Maximum edit distance if the value is INT, or the fraction of missing
alignments given 2% uniform base error rate if FLOAT. In the latter
case, the maximum edit distance is automatically chosen for different
read lengths. [0.04]
.TP
.BI -o \ INT
Maximum number of gap opens [1]
.TP
.BI -e \ INT
Maximum number of gap extensions, -1 for k-difference mode (disallowing
long gaps) [-1]
.TP
.BI -d \ INT
Disallow a long deletion within INT bp towards the 3'-end [16]
.TP
.BI -i \ INT
Disallow an indel within INT bp towards the ends [5]
.TP
.BI -l \ INT
Take the first INT subsequence as seed. If INT is larger than the query
sequence, seeding will be disabled. For long reads, this option is
typically ranged from 25 to 35 for `-k 2'. [inf]
.TP
.BI -k \ INT
Maximum edit distance in the seed [2]
.TP
.BI -t \ INT
Number of threads (multi-threading mode), cannot use with CUDA mode[1]
.TP
.BI -M \ INT
Mismatch penalty. BWA will not search for suboptimal hits with a score
lower than (bestScore-misMsc). [3]
.TP
.BI -O \ INT
Gap open penalty [11]
.TP
.BI -E \ INT
Gap extension penalty [4]
.TP
.B -L
Log-scaled gap penalty for long deletions
.TP
.BI -R \ INT
Proceed with suboptimal alignments if there are no more than INT equally
best hits. This option only affects paired-end mapping. Increasing this
threshold helps to improve the pairing accuracy at the cost of speed,
especially for short reads (~32bp).
.TP
.B -c
Reverse query but not complement it, which is required for alignment in
the color space.
.TP
.B -N
Disable iterative search. All hits with no more than
.I maxDiff
differences will be found. This mode is much slower than the default.
.TP
.BI -a \ INT
Specify maximum number of alignments per sequence read
.TP
.BI -C \ INT
Specify CUDA device, by default the program will choose the device with max. no of CUDA processors, cannot use with -t
.TP
.B
.RE
.TP
.B samse
barracuda samse [-t] [-C cudaDevice] [-r RG] [-n maxOcc] <in.db.fasta> <in.sai> <in.fq> > <out.sam>
Generate alignments in the SAM format given single-end reads. Repetitive
hits will be randomly chosen.
.B OPTIONS:
.RS
.TP 10
.B -t
Use CPU instead of GPU for SA conversion, cannot use with CUDA mode
.TP
.BI -C \ INT
Specify CUDA device, by default the program will choose the device with max. no of CUDA processors, cannot use with -t
.TP
.BI -r \ STR
Specify the read group in a format like `@RG\\tID:foo\\tSM:bar'. [null]
.RE
.TP
.B sampe
barracuda sampe [-a maxInsSize] [-o maxOcc] [-c priorChiRate] [-r RG]
[-s disableSW] [-A forceInsSizeEst] <in.db.fasta> <in1.sai> <in2.sai> <in1.fq> <in2.fq> > <out.sam>
Generate alignments in the SAM format given paired-end reads. Repetitive
read pairs will be placed randomly.
.B OPTIONS:
.RS
.TP 8
.BI -a \ INT
Maximum insert size for a read pair to be considered being mapped
properly. Since 0.4.5, this option is only used when there are not
enough good alignment to infer the distribution of insert sizes. [500]
.TP
.BI -o \ INT
Maximum occurrences of a read for pairing. A read with more occurrneces
will be treated as a single-end read. Reducing this parameter helps
faster pairing. [100000]
.TP
.BI -c \ FLOAT
Prior of chimeric rate lower bound. [1.0e-05]
.TP
.BI -r \ STR
Specify the read group in a format like `@RG\\tID:foo\\tSM:bar'. [null]
.TP
.B -s
Disable Smith-Water for the unmapped mate
.TP
.B -A
Disable insert size estimate (force -s)
.TP
.RE
.SH SAM ALIGNMENT FORMAT
.PP
The output of the
.B `aln'
command is binary and designed for BWA use only. BWA outputs the final
alignment in the SAM (Sequence Alignment/Map) format. Each line consists
of:
.TS
center box;
cb | cb | cb
n | l | l .
Col Field Description
_
1 QNAME Query (pair) NAME
2 FLAG bitwise FLAG
3 RNAME Reference sequence NAME
4 POS 1-based leftmost POSition/coordinate of clipped sequence
5 MAPQ MAPping Quality (Phred-scaled)
6 CIAGR extended CIGAR string
7 MRNM Mate Reference sequence NaMe (`=' if same as RNAME)
8 MPOS 1-based Mate POSistion
9 ISIZE Inferred insert SIZE
10 SEQ query SEQuence on the same strand as the reference
11 QUAL query QUALity (ASCII-33 gives the Phred base quality)
12 OPT variable OPTional fields in the format TAG:VTYPE:VALUE
.TE
.PP
Each bit in the FLAG field is defined as:
.TS
center box;
cb | cb | cb
c | l | l .
Chr Flag Description
_
p 0x0001 the read is paired in sequencing
P 0x0002 the read is mapped in a proper pair
u 0x0004 the query sequence itself is unmapped
U 0x0008 the mate is unmapped
r 0x0010 strand of the query (1 for reverse)
R 0x0020 strand of the mate
1 0x0040 the read is the first read in a pair
2 0x0080 the read is the second read in a pair
s 0x0100 the alignment is not primary
f 0x0200 QC failure
d 0x0400 optical or PCR duplicate
.TE
.PP
The Please check <http://samtools.sourceforge.net> for the format
specification and the tools for post-processing the alignment.
BWA generates the following optional fields. Tags starting with `X' are
specific to BWA.
.TS
center box;
cb | cb
cB | l .
Tag Meaning
_
NM Edit distance
MD Mismatching positions/bases
AS Alignment score
BC Barcode sequence
_
X0 Number of best hits
X1 Number of suboptimal hits found by BWA
XN Number of ambiguous bases in the referenece
XM Number of mismatches in the alignment
XO Number of gap opens
XG Number of gap extentions
XT Type: Unique/Repeat/N/Mate-sw
XA Alternative hits; format: (chr,pos,CIGAR,NM;)*
_
XS Suboptimal alignment score
XF Support from forward/reverse alignment
XE Number of supporting seeds
.TE
.PP
Note that XO and XG are generated by BWT search while the CIGAR string
by Smith-Waterman alignment. These two tags may be inconsistent with the
CIGAR string. This is not a bug.
.SH NOTES ON SHORT-READ ALIGNMENT
.SS Alignment Accuracy
.PP
When seeding is disabled, like BWA, BarraCUDA guarantees to find an alignment
containing maximum
.I maxDiff
differences including
.I maxGapO
gap opens which do not occur within
.I nIndelEnd
bp towards either end of the query. Longer gaps may be found if
.I maxGapE
is positive, but it is not guaranteed to find all hits. When seeding is
enabled, BarraCUDA further requires that the first
.I seedLen
subsequence contains no more than
.I maxSeedDiff
differences.
.PP
.SS Estimating Insert Size Distribution
.PP
The insert size distribution is estimated per 256*1024 read pairs.
It first collects pairs of reads with both ends mapped with a single-end
quality 20 or higher and then calculates median (Q2), lower and higher
quartile (Q1 and Q3). It estimates the mean and the variance of the
insert size distribution from pairs whose insert sizes are within
interval [Q1-2(Q3-Q1), Q3+2(Q3-Q1)]. The maximum distance x for a pair
considered to be properly paired (SAM flag 0x2) is calculated by solving
equation Phi((x-mu)/sigma)=x/L*p0, where mu is the mean, sigma is the
standard error of the insert size distribution, L is the length of the
genome, p0 is prior of anomalous pair and Phi() is the standard
cumulative distribution function. For mapping Illumina short-insert
reads to the human genome, x is about 6-7 sigma away from the
mean. Quartiles, mean, variance and x will be printed to the standard
error output.
.PP
.PP
.SH
System Requirements
Before installing BarraCUDA, please ensure that your computer has:
.PP
.PP
- A modern x86-based processor
.PP
- 4 GB of system memory (for large genomes)
.PP
- At least 20 GB of disk space (for large genomes and large sequencing libraries)
.PP
- An NVIDIA GPU with at least 768 RAM (at least 3GB for human genomes, see below) and CUDA capability of 2.0 or above. A Tesla C2050/C2070 is recommended but not required.
.PP
- A Linux/UNIX operating system
.PP
.SH
VRAM Requirements
.PP
BarraCUDA needs a memory space of at least the size of the BWT-encoded genome (the size of .bwt + .rbwt files) + another 675 MB of buffer to perform alignments.
.PP
.PP
.SH SEE ALSO
BarraCUDA website <http://seqbarracuda.sf.net>, BWA website
<http://bio-bwa.sf.net> and Samtools website <http://samtools.sf.net>
.SH AUTHOR
Petr Klus, Simon Lam, Dag Lyberg and Brian Lam developed BarraCUDA
at the Institute of Metabolic Science, University of Cambridge.
The software is largely based on BWA <http://bio-bwa.sf.net>
which was written by Heng Li at the Sanger Institute and contain
other codes such as bwtsw <http://i.cs.hku.hk/~ckwong3/bwtsw/>,
implemented by Chi-Kwong Wong at the University of Hong Kong and IS
<http://yuta.256.googlepages.com/sais> originally proposed by Nong Ge
<http://www.cs.sysu.edu.cn/nong/> at the Sun Yat-Sen University and
implemented by Yuta Mori.
.SH LICENSE AND CITATION
.PP
BarraCUDA and BWA are distributed under GPLv3. Sorting, hash table, BWT and IS
libraries are distributed under the MIT license.
.PP
Please cite the following papers if you use BarraCUDA for alignments:
.PP
Langdon, W.B. et al. Improving CUDA DNA Analysis Software with
Genetic Programming. GECCO-2015 [DOI:10.1145/2739480.2754652]
.PP
Klus et al. (2012) BarraCUDA - a fast short read sequence aligner
using graphics processing units. BMC ResNotes 5:27 [PMID: 22244497]
.PP
Li H. and Durbin R. (2009) Fast and accurate short read alignment with
Burrows-Wheeler transform. Bioinformatics, 25, 1754-60. [PMID: 19451168]
.PP
.PP