-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path_bedtools
546 lines (520 loc) · 20.8 KB
/
_bedtools
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
#compdef bedtools annotateBed bamToBed bamToFastq bed12ToBed6 bedpeToBam bedToBam closestBed complementBed coverageBed fisher flankBed genomeCoverageBed fastaFromBed bedToIgv intersectBed mergeBed maskFastaFromBed
# all aliases should also be in the compdef line above
local -A aliases
aliases[annotateBed]="annotate"
aliases[bamToBed]="bamtobed"
aliases[bamToFastq]="bamtofastq"
aliases[bed12ToBed6]="bed12tobed6"
aliases[bedpeToBam]="bedpetobam"
aliases[bedToBam]="bedtobam"
aliases[closestBed]="closest"
aliases[complementBed]="complement"
aliases[coverageBed]="coverage"
aliases[fisher]="fisher"
aliases[flankBed]="flank"
aliases[genomeCoverageBed]="genomecov"
aliases[fastaFromBed]="getfasta"
aliases[bedToIgv]="igv"
aliases[intersectBed]="intersect"
aliases[mergeBed]="merge"
aliases[maskFastaFromBed]="maskfasta"
_bedtools-annotate() {
local ret=1
local -a args
if [[ $service == bedtools ]]; then
args+=('1:command:')
fi
args+=(
'-names[A list of names (one / file) to describe each file in -i]: :'
'(-both)-counts[Report the count of features in each file that overlap -i]'
'(-counts)-both[Report the counts followed by the % coverage]'
'(-S)-s[Require same strandedness]'
'(-s)-S[Require different strandedness]'
'(-names -counts -both -s -S)-i[intervals]:file:_files -g \*.\(bed\|gff\|vcf\)'
)
if (( words[(I)-i] )); then
args+=('(-)-files[input files]:*:file:_files')
fi
_arguments $args[@] && ret=0
return ret
}
_bedtools-bamtobed() {
integer ret=1
local -a args
if [[ $service == bedtools ]]; then
args+=('1:command:')
fi
args+=(
'(-split)-bed12[Write "blocked" BED format (aka "BED12")]'
'(-tag)-bedpe[Write BEDPE format]'
'-cigar[Add the CIGAR string to the BED entry as a 7th column]'
'-color[An R,G,B string for the color used with BED12 format]:color string:'
'-ed[Use BAM edit distance (NM tag) for BED score]'
'-i[Reads]:bam file:_files -g \*.bam'
'-split[Report "split" BAM alignments as separate BED entries]'
'(-split)-splitD[Split alignments based on N and D CIGAR operators]'
'-tag[Use other NUMERIC BAM alignment tag for BED score]'
)
if (( words[(I)-bedpe] )); then
args+=('-mate1[always report mate one as the first BEDPE "block"]')
fi
_arguments $args[@] && ret=0
return ret
}
_bedtools-bamtofastq() {
integer ret=1
local -a args
args+=(
"$extra_arg"
'-i[Reads]:bam file:_files -g \*.bam'
'-fq[Output FASTQ]:fastq file:_files -g \*.\(fq\|fastq\)'
'-fq2[FASTQ for second end]:fastq file:_files -g \*.\(fq\|fastq\)'
'-tags[Create FASTQ based on the mate info]'
)
_arguments $args[@] && ret=0
return ret
}
_bedtools-bed12tobed6() {
integer ret=1
local -a args
args+=(
"$extra_arg"
'-i[Reads]:bam file:_files'
'-n[Force the score to be the (1-based) block number]'
)
_arguments $args[@] && ret=0
return ret
}
_bedtools-bedpetobam() {
integer ret=1
local -a args
args+=(
"$extra_arg"
'-i[feature records]:file:_files -g \*.\(bed\|gff\|vcf\)'
'-g[genome]:str:'
'-mapq[Set the mapping quality for the BAM records]:int:'
'-ubam[Wrinte uncompressed BAM output]'
)
_arguments $args[@] && ret=0
return ret
}
_bedtools-bedtobam() {
integer ret=1
local -a args
args+=(
"$extra_arg"
'-i[feature records]:file:_files -g \*.\(bed\|gff\|vcf\)'
'-g[genome]:str:'
'-bed12[The BED file is in BED12 format]'
'-mapq[Set the mapping quality for the BAM records]:int:'
'-ubam[Wrinte uncompressed BAM output]'
)
_arguments $args[@] && ret=0
return ret
}
_bedtools-closest() {
integer ret=1
local -a args
args+=(
"$extra_arg"
'-a[features to search for]:file:_files -g \*.\(bed\|gff\|vcf\)'
'-b[feature records]:file:_files -g \*.\(bed\|gff\|vcf\)'
'(-D)-d[report closest feature distance as extra column]'
'(-d)-D[report closest feature distance, with negative values for upstream]:orientation:((
ref\:Report\ distance\ with\ respect\ to\ the\ reference\ genome
a\:Report\ distance\ with\ respect\ to\ A
b\:Report\ distance\ with\ respect\ to\ B
))'
'-io[Ignore features in B that overlap A]'
'-iu[Ignore features in B that are upstream of features in A]'
'-id[Ignore features in B that are downstream of features in A]'
'-fu[Choose first from features in B that are upstream of features in A]'
'-fd[Choose first from features in B that are downstream of features in A]'
'-t[How ties for closest feature are handled]:strategy:((
all\:Report\ all\ ties
first\:Report\ the\ first\ tie\ that\ occurred\ in\ the\ B\ file
last\:Report\ the\ last\ tie\ that\ occurred\ in\ the\ B\ file
))'
'-mdb[How multiple databases are resolved]:strategy:((
each\:Report\ closest\ records\ for\ each\ database
all\:Report\ closest\ records\ among\ all\ databases
))'
'-k[Report the k closest hits]:int:'
'-N[Require that the query and the closest hit have different names]'
'(-S)-s[Require same strandedness]'
'(-s)-S[Require different strandedness]'
'-f[Minimum overlap required as a fraction of A]:float:'
'-F[Minimum overlap required as a fraction of B]:float:'
'(-e)-r[Require that the fraction overlap be reciprocal for A AND B]'
'(-r)-e[Require that the minimum fraction be satisfied for A OR B]'
'-split[Treat "split" BAM or BED12 entries as distinct BED intervals]'
'-g[Genome file to enforce consistent chromosome sort order]:file:_files'
'-nonamecheck[do not throw an error if the file has different naming conventions]'
'(-names -filenames -sortout)-names[When using multiple databases, provide an alias for each that will appear instead of a fileId when also printing the DB record]'
'(-names -filenames -sortout)-filenames[When using multiple databases, show each complete filename instead of a fileId when also printing the DB record.]'
'(-names -filenames -sortout)-sortout[When using multiple databases, sort the output DB hits for each record]'
'-bed[If using BAM input, write output as BED]'
'-header[Print the header from the A file prior to results]'
'(-iobuf)-nobuf[Disable buffered output]'
'(-nobuf)-iobuf[Specify amount of memory to use for input buffer]:size:'
)
_arguments $args[@] && ret=0
return ret
}
_bedtools-cluster() {
integer ret=1
local -a args
args+=(
"$extra_arg"
'-i[feature records]:file:_files -g \*.\(bed\|gff\|vcf\)'
'-s[Force strandedness]'
'-d[Maximum merging distance]:int:'
)
_arguments $args[@] && ret=0
return ret
}
_bedtools-complement() {
integer ret=1
local -a args
args+=(
"$extra_arg"
'-i[feature records]:file:_files -g \*.\(bed\|gff\|vcf\)'
'-g[genome]:file:_files'
)
_arguments $args[@] && ret=0
return ret
}
_bedtools-coverage() {
integer ret=1
local -a args
args+=(
"$extra_arg"
'-hist[report histogram]'
'-a[features to search for]:file:_files -g \*.\(bed\|gff\|vcf\)'
'-b[feature records]:file:_files -g \*.\(bed\|gff\|vcf\)'
'-counts[Only report the count of overlaps]'
'-mean[Report the mean depth of all positions in each A feature]'
'-d[report closest feature distance as extra column]'
'(-S)-s[Require same strandedness]'
'(-s)-S[Require different strandedness]'
'-f[Minimum overlap required as a fraction of A]:float:'
'-F[Minimum overlap required as a fraction of B]:float:'
'(-e)-r[Require that the fraction overlap be reciprocal for A AND B]'
'(-r)-e[Require that the minimum fraction be satisfied for A OR B]'
'-split[Treat "split" BAM or BED12 entries as distinct BED intervals]'
'-g[Genome file to enforce consistent chromosome sort order]:file:_files'
'-nonamecheck[do not throw an error if the file has different naming conventions]'
'(-names -filenames -sortout)-names[When using multiple databases, provide an alias for each that will appear instead of a fileId when also printing the DB record]'
'(-names -filenames -sortout)-filenames[When using multiple databases, show each complete filename instead of a fileId when also printing the DB record.]'
'(-names -filenames -sortout)-sortout[When using multiple databases, sort the output DB hits for each record]'
'-bed[If using BAM input, write output as BED]'
'-header[Print the header from the A file prior to results]'
'(-iobuf)-nobuf[Disable buffered output]'
'(-nobuf)-iobuf[Specify amount of memory to use for input buffer]:size:'
)
_arguments $args[@] && ret=0
return ret
}
_bedtools-expand() {
integer ret=1
local -a args
args+=(
"$extra_arg"
'-i[Input file]:file:_files'
'-c[Specify the column (1-based) that should be summarized]:int:'
)
_arguments $args[@] && ret=0
return ret
}
_bedtools-fisher() {
integer ret=1
local -a args
args+=(
"$extra_arg"
'-a[features to search for]:file:_files -g \*.\(bed\|gff\|vcf\)'
'-b[feature records]:file:_files -g \*.\(bed\|gff\|vcf\)'
'-m[Merge overlapping intervals]'
'(-S)-s[Require same strandedness]'
'(-s)-S[Require different strandedness]'
'-f[Minimum overlap required as a fraction of A]:float:'
'-F[Minimum overlap required as a fraction of B]:float:'
'(-e)-r[Require that the fraction overlap be reciprocal for A AND B]'
'(-r)-e[Require that the minimum fraction be satisfied for A OR B]'
'-split[Treat "split" BAM or BED12 entries as distinct BED intervals]'
'-g[Genome file to enforce consistent chromosome sort order]:file:_files'
'-nonamecheck[do not throw an error if the file has different naming conventions]'
'-bed[If using BAM input, write output as BED]'
'-header[Print the header from the A file prior to results]'
'(-iobuf)-nobuf[Disable buffered output]'
'(-nobuf)-iobuf[Specify amount of memory to use for input buffer]:size:'
)
_arguments $args[@] && ret=0
return ret
}
_bedtools-flank() {
integer ret=1
local -a args
args+=(
"$extra_arg"
'-i[features records]:file:_files -g \*.\(bed\|gff\|vcf\)'
'-header[Print the header from the A file prior to results]'
'-b[Create flanking interval(s) using -b base pairs in each direction]:int:'
'(-b)-l[Number of base pairs that a flank should start from original start]:int:'
'(-b)-r[Number of base pairs that a flank should end from original end]:int:'
'(-b)-s[Define -l and -r based on strand]'
'(-b)-pct[Define -l and -r as a fraction of the features length]'
'-g[genome]:file:_files'
)
_arguments $args[@] && ret=0
return ret
}
_bedtools-genomecov() {
integer ret=1
local -a args
args+=(
"$extra_arg"
'-i[features records]:file:_files -g \*.\(bed\|gff\|vcf\)'
'-g[genome]:file:_files'
'-ibam[The input file is in BAM format]:file:_files -g \*.bam'
'(-max -dz)-d[Report the depth at each genome position (with one-based coordinates)]'
'(-max -d)-dz[Report the depth at each genome position (with zero-based coordinates)]'
'(-dz -d)-max[Combine all positions with a depth >= max into a single bin]'
'(-bga)-bg[Report depth in BedGraph format]'
'(-bg)-bga[Report depth in BedGraph format including zero-coverage regions]'
'-split[Treat "split" BAM or BED12 entries as distinct BED intervals]'
'-strand[Calculate coverage of intervals from a specific strand]:string:(\- \+)'
'(-3)-5[Calculate coverage of 5" positions]'
'(-5)-3[Calculate coverage of 3" positions]'
'-scale[Scale the coverage by a constant factor]:float:'
'-trackline[Adds a UCSC/Genome-Browser track line definition in the first line of the output]'
'-trackopts[Writes additional track line definition parameters in the first line]:text:'
)
_arguments $args[@] && ret=0
return ret
}
_bedtools-getfasta() {
integer ret=1
local -a args
args+=(
"$extra_arg"
'-bed[features records]:file:_files -g \*.\(bed\|gff\|vcf\)'
'-split[Treat "split" BAM or BED12 entries as distinct BED intervals]'
'-fi[input fasta file]:file:_files'
'-fo[ouput file]:file:_files'
'-name[Use the name field for the FASTA header]:string:'
'-name\+[Use the name field and coordinates for the FASTA header]:string:'
'-tab[Write output in TAB delimited format]'
'-s[Force strandedness]'
'-fullHeader[Use full fasta header]'
)
_arguments $args[@] && ret=0
return ret
}
_bedtools-igv() {
integer ret=1
local -a args
args+=(
"$extra_arg"
'-i[input file]:file:_files -g \*.\(bed\|gff\|vcf\)'
'-path[The full path to which the IGV snapshots should be written]:directory:_files -/'
'-sess[The full path to an existing IGV session file to be loaded prior to taking snapshots]:file:_files'
'-sort[The type of BAM sorting you would like to apply to each image]:sorting:(base position strand quality sample readGroup)'
'-clps[Collapse the aligned reads prior to taking a snapshot]'
'-name[Use the "name" field (column 4) for each image filename]'
'-slop[Number of flanking base pairs on the left and right of the image]:int:'
'-img[The type of image to be created]:type:(png eps svg)'
)
_arguments $args[@] && ret=0
return ret
}
_bedtools-intersect() {
integer ret=1
local -a args
args+=(
"$extra_arg"
'-a[input file]:file:_files -g \*.\(bed\|gff\|vcf\|bam\)'
'-b[input file]:file:_files -g \*.\(bed\|gff\|vcf\|bam\)'
'-wa[Write the original entry in A for each overlap]'
'-wb[Write the original entry in B for each overlap]'
'-loj[Perform a "left outer join"]'
'-wo[Write the original A and B entries plus the number of base pairs of overlap between the two features (only A features with overlap are reported)]'
'-wao[Write the original A and B entries plus the number of base pairs of overlap between the two features (features w/o overlap are also reported)]'
'-u[Write the original A entry _once_ if _any_ overlaps found in B]'
'-c[For each entry in A, report the number of overlaps with B]'
'-v[Only report those entries in A that have _no overlaps_ with B]'
'-ubam[Write uncompressed BAM output (default writes compressed BAM)]'
'-s[Require same strandedness]'
'-S[Require different strandedness]'
'-f[Minimum overlap required as a fraction of A]:float:'
'-F[Minimum overlap required as a fraction of B]:float:'
'-r[Require that the fraction overlap be reciprocal for A AND B]'
'-e[Require that the minimum fraction be satisfied for A OR B]'
'-split[Treat "split" BAM or BED12 entries as distinct BED intervals]'
'-g[Provide a genome file to enforce consistent chromosome sort order across input files (only applies when used with -sorted option)]:file:_files'
'-nonamecheck[For sorted data, do not throw an error if the file has different naming conventions for the same chromosome]'
'-sorted[Use the "chromsweep" algorithm for sorted (-k1,1 -k2,2n) input]'
'-names[When using multiple databases, provide an alias for each that will appear instead of a fileId when also printing the DB record]'
'-filenames[When using multiple databases, show each complete filename instead of a fileId when also printing the DB record]'
'-sortout[When using multiple databases, sort the output DB hits for each record]'
'-bed[If using BAM input, write output as BED]'
'-header[Print the header from the A file prior to results]'
'-nobuf[Disable buffered output]'
'-iobuf[Specify amount of memory to use for input buffer]:int:'
)
_arguments $args[@] && ret=0
return ret
}
_bedtools-maskfasta() {
integer ret=1
local -a args
args+=(
"$extra_arg"
'-bed[features records]:file:_files -g \*.\(bed\|gff\|vcf\)'
'-fi[input fasta file]:file:_files'
'-fo[ouput file]:file:_files'
'-soft[Mask with lower-case bases, instead of masking with Ns]'
'-mc[Replace masking character]:str:'
'-fullHeader[Use full fasta header]'
)
_arguments $args[@] && ret=0
return ret
}
_bedtools-makewindows() {
integer ret=1
local -a args
args+=(
"$extra_arg"
'-g[genome file]:file:_files'
'-b[BED file]:file:_files -g \*.bed'
'-w[window size]:int:'
'-s[step size]:int:'
'-n[number of windows]:int:'
'-reverse[reverse numbering]'
"-i[ID naming]:str:((
src\:use\ the\ source\ interval\'s\ name
winnum\:use\ the\ window\ number\ as\ the\ ID
srcwinnum\:use\ the\ source\ interval\'s\ name\ with\ the\ window\ number
))"
)
_arguments $args[@] && ret=0
return ret
}
_bedtools-merge() {
integer ret=1
local -a args
args+=(
"$extra_arg"
'-i[input file]:file:_files -g \*.\(bed\|gff\|vcf\)'
'-s[Force strandedness]'
'-S[Force merge for one specific strand only]'
'-d[Maximum distance between features allowed for features to be merged]:int:'
'-c[Specify columns from the B file to map onto intervals in A (default: 5, multiple columns can be specified in a comma-delimited list)]:int:'
'-o[Specify the operation that should be applied to -c (default: sum, multiple columns can be specified in a comma-delimited list)]:str:((
sum
min
max
absmin
absmax
mean
median
mode
antimode
stdev
sstdev
collapse\:print\ a\ delimited\ list\ \(duplicates\ allowed\)
distinct\:print\ a\ delimited\ list\ \(NO\ duplicates\ allowed\)
distinct_sort_num\:as\ distinct\,\ sorted\ numerically\,\ ascending
distinct_sort_num_desc\:as\ distinct\,\ sorted\ numerically\,\ desscending
distinct_only\:delimited\ list\ of\ only\ unique\ values
count
count_distinct\:a\ count\ of\ the\ unique\ values\ in\ the\ column
first\:just\ the\ first\ value\ in\ the\ column
last\:just\ the\ last\ value\ in\ the\ column
))'
'-delim[Specify a custom delimiter for the collapse operations (default: ",")]:str:'
'-prec[Sets the decimal precision for output (default: 5)]:int:'
'-bed[If using BAM input, write output as BED]'
'-header[Print the header from the A file prior to results]'
'-nobuf[Disable buffered output]'
'-iobuf[Specify amount of memory to use for input buffer]:int:'
)
_arguments $args[@] && ret=0
return ret
}
# More to come
_bedtools-subcommand() {
local ret=1
local subcmd=_bedtools-$1
if ! _call_function ret $subcmd; then
_message "unknown subcomand: $subcmd"
_arguments '*:file:_files'
fi
return ret
}
_bedtools-main() {
local ret=1
if (( CURRENT == 2)); then
local -a args
args+=(
'1:command:((
annotate\:Annotate\ coverage\ of\ features\ from\ multiple\ files
bamtobed\:Convert\ BAM\ alignments\ to\ BED\ and\ other\ formats
bamtofastq\:Convert\ BAM\ records\ to\ FASTQ\ records
bed12tobed6\:Breaks\ BED12\ intervals\ into\ discrete\ BED6\ intervals
bedpetobam\:Convert\ BEDPE\ intervals\ to\ BAM\ records
bedtobam\:Convert\ intervals\ to\ BAM\ records
closest\:Find\ the\ closest,\ potentially\ non-overlapping\ interval
cluster\:Cluster\ \(but\ do\ not\ merge\)\ overlapping\/nearby\ intervals
complement\:Extract\ intervals\ not\ represented\ by\ an\ interval\ file
coverage\:Compute\ the\ coverage\ over\ defined\ intervals
expand\:Replicate\ lines\ based\ on\ lists\ of\ values\ in\ columns
fisher\:Calculate\ Fisher\ statistic\ b/w\ two\ feature\ files
flank\:Create\ new\ intervals\ from\ the\ flanks\ of\ existing\ intervals
genomecov\:Compute\ the\ coverage\ over\ an\ entire\ genome
getfasta\:Use\ intervals\ to\ extract\ sequences\ from\ a\ FASTA\ file
groupby\:Group\ by\ common\ cols.\ and\ summarize\ other\ cols
igv\:Create\ an\ IGV\ snapshot\ batch\ script
intersect\:Find\ overlapping\ intervals\ in\ various\ ways
jaccard\:Calculate\ the\ Jaccard\ statistic\ b/w\ two\ sets\ of\ intervals
links\:Create\ a\ HTML\ page\ of\ links\ to\ UCSC\ locations
makewindows\:Make\ interval\ windows\ across\ a\ genome
map\:Apply\ a\ function\ to\ a\ column\ for\ each\ overlapping\ interval
maskfasta\:Use\ intervals\ to\ mask\ sequences\ from\ a\ FASTA\ file
merge\:Combine\ overlapping/nearby\ intervals\ into\ a\ single\ interval
multicov\:Counts\ coverage\ from\ multiple\ BAMs\ at\ specific\ intervals
multiinter\:Identifies\ common\ intervals\ among\ multiple\ interval\ files
nuc\:Profile\ the\ nucleotide\ content\ of\ intervals\ in\ a\ FASTA\ file
overlap\:Computes\ the\ amount\ of\ overlap\ from\ two\ intervals
pairtobed\:Find\ pairs\ that\ overlap\ intervals\ in\ various\ ways
pairtopair\:Find\ pairs\ that\ overlap\ other\ pairs\ in\ various\ ways
random\:Generate\ random\ intervals\ in\ a\ genome
reldist\:Calculate\ the\ distribution\ of\ relative\ distances\ b/w\ two\ files
sample\:Sample\ random\ records\ from\ file\ using\ reservoir\ sampling
shift\:Adjust\ the\ position\ of\ intervals
shuffle\:Randomly\ redistrubute\ intervals\ in\ a\ genome
slop\:Adjust\ the\ size\ of\ intervals
sort\:Order\ the\ intervals\ in\ a\ file
spacing\:Report\ the\ gap\ lengths\ between\ intervals\ in\ a\ file
split\:Split\ a\ file\ into\ multiple\ files\ with\ equal\ records\ or\ base\ pairs
subtract\:Remove\ intervals\ based\ on\ overlaps\ b/w\ two\ files
tag\:Tag\ BAM\ alignments\ based\ on\ overlaps\ with\ interval\ files
unionbedg\:Combines\ coverage\ intervals\ from\ multiple\ BEDGRAPH\ files
window\:Find\ overlapping\ intervals\ within\ a\ window\ around\ an\ interval
))'
'(- *)--help[Print help menu]'
'(- *)--version[What version of bedtools are you using?]'
'(- *)--contact[Feature requests, bugs, mailing lists, etc]'
)
_arguments $args[@] && ret=0
else
_bedtools-subcommand $words[2] && ret=0
fi
return ret
}
extra_arg=""
if [[ $service == bedtools ]]; then
extra_arg='1:command:'
_bedtools-main
else
_bedtools-subcommand $aliases[$service]
fi