forked from samtools/bcftools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbcftools.1
1593 lines (1576 loc) · 38.4 KB
/
bcftools.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
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
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
'\" t
.\" Title: bcftools
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
.\" Date: 02/17/2014
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "BCFTOOLS" "1" "02/17/2014" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
bcftools \- utilities for variant calling and manipulating VCFs and BCFs
.SH "SYNOPSIS"
.sp
\fBbcftools\fR [\fICOMMAND\fR] [\fIOPTIONS\fR]
.SH "DESCRIPTION"
.sp
Bcftools is a set of utilities that manipulate variant calls in the Variant Call Format (VCF) and its binary counterpart BCF\&. All commands work transparently with both VCFs and BCFs, both uncompressed and BGZF\-compressed\&.
.sp
Bcftools is designed to work on a stream\&. It regards an input file "\-" as the standard input (stdin) and outputs to the standard output (stdout)\&. Several commands can thus be combined with Unix pipes\&.
.SH "LIST OF COMMANDS"
.sp
For a full list of available commands, run \fBbcftools\fR without arguments\&. For a full list of available options, run \fBbcftools\fR \fICOMMAND\fR without arguments\&.
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBindex\fR
\&.\&. index VCF/BCF
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBannotate\fR
\&.\&. edit VCF files, add or remove annotations, apply user plugins
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBcall\fR
\&.\&. SNP/indel calling (former "view")
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBfilter\fR
\&.\&. filter VCF/BCF files using fixed thresholds
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBgtcheck\fR
\&.\&. check sample concordance, detect sample swaps and contamination
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBisec\fR
\&.\&. intersections of VCF/BCF files
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBmerge\fR
\&.\&. merge VCF/BCF files to create multi\-sample file
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBnorm\fR
\&.\&. normalize indels
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBquery\fR
\&.\&. transform VCF/BCF into user\-defined formats
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBroh\fR
\&.\&. identify runs of homo/auto\-zygosity
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBstats\fR
\&.\&. produce VCF/BCF stats (former vcfcheck)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBview\fR
\&.\&. subset, filter and convert VCF and BCF files
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBplot\-vcfstats\fR
\&.\&. plots the output of
\fBstats\fR
.RE
.SH "OPTIONS"
.SS "Common Options"
.PP
\fIFILE\fR
.RS 4
Files can be both VCF or BCF, uncompressed or BGZF\-compressed\&. The file "\-" is interpreted as standard input\&. Some tools may require tabix\- or CSI\-indexed files\&.
.RE
.PP
\fB\-c, \-\-collapse\fR \fIsnps\fR|\fIindels\fR|\fIboth\fR|\fIall\fR|\fIsome\fR|\fInone\fR
.RS 4
Controls how to treat records with duplicate positions and defines compatible records across multiple input files\&. Here by "compatible" we mean records which should be considered as identical by the tools\&. For example, when performing line intersections, the desire may be to consider as identical all sites with matching positions (\fBbcftools isec \-c\fR
\fIall\fR), or only sites with matching variant type (\fBbcftools isec \-c\fR
\fIsnps\fR\ \&
\fB\-c\fR
\fIindels\fR), or only sites with all alleles identical (\fBbcftools isec \-c\fR
\fInone\fR)\&.
.PP
\fInone\fR
.RS 4
only records with identical REF and ALT alleles are compatible
.RE
.PP
\fIsome\fR
.RS 4
only records where some subset of ALT alleles match are compatible
.RE
.PP
\fIall\fR
.RS 4
all records are compatible, regardless of whether the ALT alleles match or not\&. In the case of records with the same position, only the first will be considered and appear on output\&.
.RE
.PP
\fIsnps\fR
.RS 4
any SNP records are compatible, regardless of whether the ALT alleles match or not\&. For duplicate positions, only the first SNP record will be considered and appear on output\&.
.RE
.PP
\fIindels\fR
.RS 4
all indel records are compatible, regardless of whether the REF and ALT alleles match or not\&. For duplicate positions, only the first indel record will be considered and appear on output\&.
.RE
.PP
\fIboth\fR
.RS 4
abbreviation of "\fB\-c\fR
\fIindels\fR\ \&
\fB\-c\fR
\fIsnps\fR"
.RE
.RE
.PP
\fB\-f, \-\-apply\-filters\fR \fILIST\fR
.RS 4
Skip sites where FILTER column does not contain any of the strings listed in
\fILIST\fR\&. For example, to include only sites which have no filters set, use
\fB\-f\fR
\fI\&.,PASS\fR\&.
.RE
.PP
\fB\-O, \-\-output\-type\fR \fIb\fR|\fIu\fR|\fIz\fR|\fIv\fR
.RS 4
Output compressed BCF (\fIb\fR), uncompressed BCF (\fIu\fR), compressed VCF (\fIz\fR), uncompressed VCF (\fIv\fR)\&.
.RE
.PP
\fB\-r, \-\-regions\fR \fIfile\fR|\fIchr\fR|\fIchr:pos\fR|\fIchr:from\-to\fR|\fIchr:from\-\fR[,\&...]
.RS 4
Regions can be specified either on command line or in a VCF, BED, or tab\-delimited file (the default)\&. The columns of the tab\-delimited file are: CHROM, POS, and, optionally, POS_TO, where positions are 1\-based and inclusive\&. Uncompressed files are stored in memory, while bgzip\-compressed and tabix\-indexed region files are streamed\&. Note that sequence names must match exactly, "chr20" is not the same as "20"\&. This option requires indexed VCF/BCF files\&.
.RE
.PP
\fB\-s, \-\-samples\fR \fILIST\fR|\fI:FILE\fR
.RS 4
Comma\-separated list of samples to include or, when prefixed with colon
\fI:\fR, read sample names from
\fIFILE\fR
with one sample per line\&. The command
\fBbcftools call\fR
accepts an optional second column indicating ploidy (0, 1 or 2) and can parse also PED files\&. With
\fBbcftools call\fR\fB \-C\fR
\fItrio\fR, PED file is expected\&.
.RE
.PP
\fB\-t, \-\-targets\fR \fIfile\fR|\fIchr\fR|\fIchr:pos\fR|\fIchr:from\-to\fR|\fIchr:from\-\fR[,\&...]
.RS 4
Same as
\fB\-r, \-\-regions\fR, but the next position is accessed by streaming the whole VCF/BCF rather than using the tbi/csi index\&. Both
\fB\-r\fR
and
\fB\-t\fR
options can be applied simultaneously:
\fB\-r\fR
uses the index to jump to a region and
\fB\-t\fR
discards positions which are not in the targets\&. Another difference between the two is that
\fB\-r\fR
checks both start and end positions of indels, whereas
\fB\-t\fR
checks start positions only\&. With the call
\fB\-C\fR
\fIalleles\fR
command, third column of the targets file must be comma\-separated list of alleles, starting with the reference allele\&. Such a file can be easily created from a VCF with:
.RE
.sp
.if n \{\
.RS 4
.\}
.nf
bcftools query \-f\*(Aq%CHROM\et%POS\et%REF,%ALT\en\*(Aq file\&.vcf
.fi
.if n \{\
.RE
.\}
.SS "bcftools annotate \fI[OPTIONS]\fR \fIFILE\fR"
.sp
This command allows to add or remove annotations and apply user\-written plugins\&.
.PP
\fB\-a, \-\-annotations\fR \fIfile\fR
.RS 4
Bgzip\-compressed and tabix\-indexed file with annotations\&. The file can be VCF, BED, or a tab\-delimited file with mandatory columns CHROM, POS (or, alternatively, FROM, TO), optional columns REF and ALT, and arbitrary number of annotation columns\&. In case of tab\-delimited file, the coordinates POS, FROM and TO are one\-based and inclusive\&. When REF and ALT are present, only matching VCF records will be annotated\&. When multiple ALT alleles are present in the annotation file (given as comma\-separated list of alleles), at least one must match one of the alleles in the corresponding VCF record\&. See also
\fB\-c, \-\-columns\fR
and
\fB\-h, \-\-header\-lines\fR\&.
.RE
.PP
\fB\-c, \-\-columns\fR \fIlist\fR
.RS 4
Comma\-separated list of columns present in the annotation file and defined in the header file (see also
\fB\-a, \-\-annotations\fR
and
\fB\-h, \-\-header\-lines\fR)\&. INFO tags can be written both as INFO/TAG or simply TAG\&. Unused columns can be indicated by
\fI\-\fR\&. For example:
.RE
.sp
.if n \{\
.RS 4
.\}
.nf
CHROM,FROM,TO,REF,ALT,\-,INFO/TAG
.fi
.if n \{\
.RE
.\}
.PP
\fB\-h, \-\-header\-lines\fR \fIfile\fR
.RS 4
Header lines to appended to the VCF header\&.
.RE
.PP
\fB\-l, \-\-list\-plugins\fR
.RS 4
List of available plugins\&. The BCFTOOLS_PLUGINS environment variable tells the program which directories to search\&.
.RE
.PP
\fB\-O, \-\-output\-type\fR \fIb\fR|\fIu\fR|\fIz\fR|\fIv\fR
.RS 4
see
\fBCommon Options\fR
.RE
.PP
\fB\-p, \-\-plugins\fR \fIname\fR[,\&...]
.RS 4
Comma\-separated list of plugins to run\&. The BCFTOOLS_PLUGINS environment variable tells the program which directories to search\&. See the examples in plugins/*\&.c coming with this distribution for further details and examples\&.
.RE
.PP
\fB\-r, \-\-regions\fR \fIfile\fR|\fIchr\fR|\fIchr:pos\fR|\fIchr:from\-to\fR|\fIchr:from\-\fR[,\&...]
.RS 4
see
\fBCommon Options\fR
.RE
.PP
\fB\-R, \-\-remove\fR \fIlist\fR
.RS 4
List of annotations to remove\&. Use
\fIFILTER\fR
to remove all filters or
\fIFILTER/SomeFilter\fR
to remove a specific filter\&. More examples:
.RE
.sp
.if n \{\
.RS 4
.\}
.nf
ID,INFO/DP,FORMAT/DP
.fi
.if n \{\
.RE
.\}
.SS "bcftools call \fI[OPTIONS]\fR \fIFILE\fR"
.sp
This command replaces the former \fBbcftools view\fR caller\&. Some of the original functionality has been temporarily lost in the process of transition under htslib, but will be added back on popular demand\&. The original calling model can be invoked with the \fB\-c\fR option\&.
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBFile format options:\fR
.RS 4
.PP
\fB\-O, \-\-output\-type\fR \fIb\fR|\fIu\fR|\fIz\fR|\fIv\fR
.RS 4
see
\fBCommon Options\fR
.RE
.PP
\fB\-r, \-\-regions\fR \fIfile\fR|\fIchr\fR|\fIchr:pos\fR|\fIchr:from\-to\fR|\fIchr:from\-\fR[,\&...]
.RS 4
see
\fBCommon Options\fR
.RE
.PP
\fB\-s, \-\-samples\fR \fIFILE\fR|\fILIST\fR
.RS 4
see
\fBCommon Options\fR
.RE
.RE
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBInput/output options:\fR
.RS 4
.PP
\fB\-A, \-\-keep\-alts\fR
.RS 4
output all alternate alleles present in the alignments even if they do not appear in any of the genotypes
.RE
.PP
\fB\-M, \-\-keep\-masked\-ref\fR
.RS 4
output sites where REF allele is N
.RE
.PP
\fB\-S, \-\-skip\fR \fIsnps\fR|\fIindels\fR
.RS 4
skip indel/SNP sites
.RE
.PP
\fB\-v, \-\-variants\-only\fR
.RS 4
output variant sites only
.RE
.RE
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBConsensus/variant calling options:\fR
.RS 4
.PP
\fB\-c, \-\-consensus\-caller\fR
.RS 4
the original
\fBsamtools\fR/\fBbcftools\fR
calling method (conflicts with
\fB\-m\fR)
.RE
.PP
\fB\-C, \-\-constrain\fR \fIalleles\fR|\fItrio\fR
.RS 4
.PP
\fIalleles\fR
.RS 4
call genotypes given alleles\&. See also
\fB\-t, \-\-targets\fR\&.
.RE
.PP
\fItrio\fR
.RS 4
call genotypes given the father\-mother\-child constraint\&. See also
\fB\-s, \-\-samples\fR
and
\fB\-n, \-\-novel\-rate\fR\&.
.RE
.RE
.PP
\fB\-m, \-\-multiallelic\-caller\fR
.RS 4
alternative modelfor multiallelic and rare\-variant calling designed to overcome known limitations in
\fB\-c\fR
calling model (conflicts with
\fB\-c\fR)
.RE
.PP
\fB\-n, \-\-novel\-rate\fR \fIfloat\fR[,\&...]
.RS 4
likelihood of novel mutation for constrained
\fB\-C\fR
\fItrio\fR
calling\&. The trio genotype calling maximizes likelihood of a particular combination of genotypes for father, mother and the child P(F=i,M=j,C=k) = P(unconstrained) * Pn + P(constrained) * (1\-Pn)\&. By providing three values, the mutation rate Pn is set explictly for SNPs, deletions and insertions, respectively\&. If two values are given, the first is interpreted as the mutation rate of SNPs and the second is used to calculate the mutation rate of indels according to their length as Pn=\fIfloat\fR*exp(\-a\-b*len), where a=22\&.8689, b=0\&.2994 for insertions and a=21\&.9313, b=0\&.2856 for deletions [pubmed:23975140]\&. If only one value is given, the same mutation rate Pn is used for SNPs and indels\&.
.RE
.PP
\fB\-p, \-\-pval\-threshold\fR \fIfloat\fR
.RS 4
with
\fB\-c\fR, accept variant if P(ref|D) <
\fIfloat\fR\&. With
\fB\-m\fR, accept another ALT allele if P(chi^2)>=1\-\fIfloat\fR
.RE
.PP
\fB\-t, \-\-targets\fR \fIfile\fR|\fIchr\fR|\fIchr:pos\fR|\fIchr:from\-to\fR|\fIchr:from\-\fR[,\&...]
.RS 4
see
\fBCommon Options\fR
.RE
.PP
\fB\-X, \-\-chromosome\-X\fR
.RS 4
haploid output for male samples (requires PED file with
\fB\-s\fR)
.RE
.PP
\fB\-Y, \-\-chromosome\-Y\fR
.RS 4
haploid output for males and skips females (requires PED file with
\fB\-s\fR)
.RE
.RE
.SS "bcftools filter \fI[OPTIONS]\fR \fIFILE\fR"
.sp
Apply fixed\-threshold filters\&.
.PP
\fB\-e, \-\-exclude\fR \fIEXPRESSION\fR
.RS 4
exclude sites for which
\fIEXPRESSION\fR
is true\&. For valid expressions see
\fBEXPRESSIONS\fR\&.
.RE
.PP
\fB\-g, \-\-SnpGap\fR \fIINT\fR
.RS 4
filter SNPs within
\fIINT\fR
base pairs of an indel\&. The following example demonstrates the logic of
\fB\-\-SnpGap\fR
\fI3\fR
applied on a deletion and an insertion:
.RE
.sp
.if n \{\
.RS 4
.\}
.nf
The SNPs at positions 1 and 7 are filtered, positions 0 and 8 are not:
0123456789
ref \&.G\&.GT\&.\&.G\&.\&.
del \&.A\&.G\-\&.\&.A\&.\&.
Here the positions 1 and 6 are filtered, 0 and 7 are not:
0123\-456789
ref \&.G\&.G\-\&.\&.G\&.\&.
ins \&.A\&.GT\&.\&.A\&.\&.
.fi
.if n \{\
.RE
.\}
.PP
\fB\-G, \-\-IndelGap\fR \fIINT\fR
.RS 4
filter clusters of indels separated by
\fIINT\fR
or fewer base pairs allowing only one to pass\&. The following example demonstrates the logic of
\fB\-\-IndelGap\fR
\fI2\fR
applied on a deletion and an insertion:
.RE
.sp
.if n \{\
.RS 4
.\}
.nf
The second indel is filtered:
012345678901
ref \&.GT\&.GT\&.\&.GT\&.\&.
del \&.G\-\&.G\-\&.\&.G\-\&.\&.
And similarly here, the second is filtered:
01 23 456 78
ref \&.A\-\&.A\-\&.\&.A\-\&.\&.
ins \&.AT\&.AT\&.\&.AT\&.\&.
.fi
.if n \{\
.RE
.\}
.PP
\fB\-i, \-\-include\fR \fIEXPRESSION\fR
.RS 4
include only sites for which
\fIEXPRESSION\fR
is true\&. For valid expressions see
\fBEXPRESSIONS\fR\&.
.RE
.PP
\fB\-m, \-\-mode\fR \fI+\fR|\fIx\fR
.RS 4
what to do with the existing FILTER annotations: use
\fI+\fR
for appending to FILTER instead of replacing the existing annotations, and
\fIx\fR
to reset filters at sites which pass\&.
.RE
.PP
\fB\-O, \-\-output\-type\fR \fIb\fR|\fIu\fR|\fIz\fR|\fIv\fR
.RS 4
see
\fBCommon Options\fR
.RE
.PP
\fB\-r, \-\-regions\fR \fIfile\fR|\fIchr\fR|\fIchr:pos\fR|\fIchr:from\-to\fR|\fIchr:from\-\fR[,\&...]
.RS 4
see
\fBCommon Options\fR
.RE
.PP
\fB\-s, \-\-soft\-filter\fR \fISTRING\fR|\fI+\fR
.RS 4
annotate FILTER column with
\fISTRING\fR
or, with
\fI+\fR, a unique filter name generated by the program ("Filter%d")\&.
.RE
.PP
\fB\-t, \-\-targets\fR \fIfile\fR|\fIchr\fR|\fIchr:pos\fR|\fIchr:from\-to\fR|\fIchr:from\-\fR[,\&...]
.RS 4
see
\fBCommon Options\fR
.RE
.SS "bcftools gtcheck [\fIOPTIONS\fR] [\-g \fIgenotypes\&.vcf\&.gz\fR] \fIquery\&.vcf\&.gz\fR"
.sp
Checks sample identity or, without \fB\-g\fR, multi\-sample cross\-check is performed\&.
.PP
\fB\-a, \-\-all\-sites\fR
.RS 4
output for all sites
.RE
.PP
\fB\-g, \-\-genotypes\fR \fIgenotypes\&.vcf\&.gz\fR
.RS 4
reference genotypes to compare against
.RE
.PP
\fB\-G, \-\-GTs\-only\fR \fIINT\fR
.RS 4
ignore PLs, use GTs, setting
\fIINT\fR
for the unseen genotypes
.RE
.PP
\fB\-H, \-\-homs\-only\fR
.RS 4
consider only genotypes which are homozygous in both
\fIgenotypes\fR
and
\fIquery\fR
VCF\&. This may be useful with low coverage data\&.
.RE
.PP
\fB\-p, \-\-plot\fR \fIPREFIX\fR
.RS 4
produce plots
.RE
.PP
\fB\-r, \-\-regions\fR \fIfile\fR|\fIchr\fR|\fIchr:pos\fR|\fIchr:from\-to\fR|\fIchr:from\-\fR[,\&...]
.RS 4
see
\fBCommon Options\fR
.RE
.PP
\fB\-s, \-\-query\-sample\fR \fISTRING\fR
.RS 4
query sample in
\fIquery\&.vcf\&.gz\fR\&. By default, the first sample is checked\&.
.RE
.PP
\fB\-S, \-\-target\-sample\fR \fISTRING\fR
.RS 4
target sample in the
\fB\-g\fR
file, used only for plotting, not for analysis
.RE
.PP
\fB\-t, \-\-targets\fR \fIfile\fR|\fIchr\fR|\fIchr:pos\fR|\fIchr:from\-to\fR|\fIchr:from\-\fR[,\&...]
.RS 4
see
\fBCommon Options\fR
.RE
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBOutput files format:\fR
.RS 4
.PP
CN
.RS 4
This field lists pairwise discordance for all possible sample pairs\&. It is calculated as
.RE
.sp
.if n \{\
.RS 4
.\}
.nf
\esum_s { min_{G} \e{ PL_i + PL_j \e} },
.fi
.if n \{\
.RE
.\}
.PP
.RS 4
where the sum is over all sites
\fIs\fR
and genotype
\fIG\fR
is selected to maximize likelihood for samples
\fIi\fR
and
\fIj\fR\&. When PL field is not present, a constant value
\fI99\fR
is used for the unseen genotypes\&. With
\fB\-G\fR, the value
\fI1\fR
can be used instead, the discordance value then gives exactly the number of differing genotypes\&.
.RE
.RE
.SS "bcftools index [\fIOPTIONS\fR] \fI<in\&.bcf>|<in\&.vcf\&.gz>\fR"
.sp
Creates index for bgzip compressed VCF/BCF files for random access\&. Note that the old tabix (\&.tbi) index can be invoked by setting \-m0\&. Otherwise the new coordinate\-sorted (\&.csi) index is created\&.
.PP
\fB\-f, \-\-force\fR
.RS 4
overwrite index if it already exists
.RE
.PP
\fB\-m, \-\-min\-shift \fR\fB\fIINT\fR\fR
.RS 4
set the minimal interval size to 1<<INT; default: 14
.RE
.SS "bcftools isec [\fIOPTIONS\fR] \fIA\&.vcf\&.gz\fR \fIB\&.vcf\&.gz\fR [\&...]"
.sp
Creates intersections, unions and complements of VCF files\&. Depending on the options, the program can output records from one (or more) files which have (or do not have) corresponding records with the same position in the other files\&.
.PP
\fB\-c, \-\-collapse\fR \fIsnps\fR|\fIindels\fR|\fIboth\fR|\fIall\fR|\fIsome\fR|\fInone\fR
.RS 4
see
\fBCommon Options\fR
.RE
.PP
\fB\-C, \-\-complement\fR
.RS 4
output positions present only in the first file but missing in the others
.RE
.PP
\fB\-f, \-\-apply\-filters\fR \fILIST\fR
.RS 4
see
\fBCommon Options\fR
.RE
.PP
\fB\-n, \-\-nfiles\fR [+\-=]\fIINT\fR
.RS 4
output positions present in this many (=), this many or more (+), or this many or fewer (\-) files
.RE
.PP
\fB\-O, \-\-output\-type\fR \fIb\fR|\fIu\fR|\fIz\fR|\fIv\fR
.RS 4
see
\fBCommon Options\fR
.RE
.PP
\fB\-p, \-\-prefix\fR \fIDIR\fR
.RS 4
if given, subset each of the input files accordingly\&. See also
\fB\-w\fR\&.
.RE
.PP
\fB\-r, \-\-regions\fR \fIfile\fR|\fIchr\fR|\fIchr:pos\fR|\fIchr:from\-to\fR|\fIchr:from\-\fR[,\&...]
.RS 4
see
\fBCommon Options\fR
.RE
.PP
\fB\-t, \-\-targets\fR \fIfile\fR|\fIchr\fR|\fIchr:pos\fR|\fIchr:from\-to\fR|\fIchr:from\-\fR[,\&...]
.RS 4
see
\fBCommon Options\fR
.RE
.PP
\fB\-w, \-\-write\fR \fILIST\fR
.RS 4
list of input files to output given as 1\-based indices\&. With
\fB\-p\fR
and no
\fB\-w\fR, all files are written\&.
.RE
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBExamples:\fR
.RS 4
.sp
Create intersection and complements of two sets saving the output in dir/*
.sp
.if n \{\
.RS 4
.\}
.nf
bcftools isec \-p dir A\&.vcf\&.gz B\&.vcf\&.gz
.fi
.if n \{\
.RE
.\}
.sp
Extract and write records from A shared by both A and B using exact allele match
.sp
.if n \{\
.RS 4
.\}
.nf
bcftools isec \-p dir \-n=2 \-w1 A\&.vcf\&.gz B\&.vcf\&.gz
.fi
.if n \{\
.RE
.\}
.sp
Extract records private to A or B comparing by position only
.sp
.if n \{\
.RS 4
.\}
.nf
bcftools isec \-p dir \-n\-1 \-c all A\&.vcf\&.gz B\&.vcf\&.gz
.fi
.if n \{\
.RE
.\}
.RE
.SS "bcftools merge [\fIOPTIONS\fR] \fIA\&.vcf\&.gz\fR \fIB\&.vcf\&.gz\fR [\&...]"
.sp
Merge multiple VCF or BCF files to create one multi\-sample file\&. For example, when merging file \fIA\&.vcf\&.gz\fR containing samples \fIS1\fR, \fIS2\fR and \fIS3\fR and file \fIB\&.vcf\&.gz\fR containing samples \fIS3\fR and \fIS4\fR, the output file will contain four samples named \fIS1\fR, \fIS2\fR, \fIS3\fR, \fI2:S3\fR and \fIS4\fR\&.
.sp
Note that it is responsibility of the user to ensure that the sample names are unique across all files\&. If they are not, the program will create a unique sample name by prepending index of the file as it appeared on the command line to the conflicting sample name (see \fI2:S3\fR in the above example)\&. Sample names can be also given explicitly using the \fB\-\-print\-header\fR and \fB\-\-use\-header\fR options\&.
.PP
\fB\-\-use\-header\fR \fIFILE\fR
.RS 4
use the VCF header in the provided text
\fIFILE\fR
.RE
.PP
\fB\-\-print\-header\fR
.RS 4
print only merged header and exit
.RE
.PP
\fB\-f, \-\-apply\-filters\fR \fILIST\fR
.RS 4
see
\fBCommon Options\fR
.RE
.PP
\fB\-i, \-\-info\-rules\fR \fI\-\fR|\fITAG:METHOD\fR[,\&...]
.RS 4
Rules for merging INFO fields (scalars or vectors) or
\fI\-\fR
to disable the default rules\&.
\fIMETHOD\fR
is one of
\fIsum\fR,
\fIavg\fR,
\fImin\fR,
\fImax\fR,
\fIjoin\fR\&.
.RE
.PP
\fB\-m, \-\-merge\fR \fIsnps\fR|\fIindels\fR|\fIboth\fR|\fIall\fR|\fInone\fR
.RS 4
Defines merging behaviour, similar to
\fB\-c, \-\-collapse\fR\&. For example, to prevent merging of SNPs and indels into one record, use
\fB\-m\fR
\fIboth\fR\&. To prevent creation of multi\-allelic records altogether, use
\fB\-m\fR
\fInone\fR\&.
.RE
.PP
\fB\-O, \-\-output\-type\fR \fIb\fR|\fIu\fR|\fIz\fR|\fIv\fR
.RS 4
see
\fBCommon Options\fR
.RE
.PP
\fB\-r, \-\-regions\fR \fIfile\fR|\fIchr\fR|\fIchr:pos\fR|\fIchr:from\-to\fR|\fIchr:from\-\fR[,\&...]
.RS 4
see
\fBCommon Options\fR
.RE
.SS "bcftools norm [\fIOPTIONS\fR] \-f \fIref\&.fa\fR \fIfile\&.vcf\&.gz\fR"
.sp
Left\-align and normalize indels\&.
.PP
\fB\-D, \-\-remove\-duplicates\fR
.RS 4
remove duplicate lines of the same type
.RE
.PP
\fB\-f, \-\-fasta\-ref\fR \fIFILE\fR
.RS 4
reference sequence
.RE
.PP
\fB\-O, \-\-output\-type\fR \fIb\fR|\fIu\fR|\fIz\fR|\fIv\fR
.RS 4
see
\fBCommon Options\fR
.RE
.PP
\fB\-r, \-\-regions\fR \fIfile\fR|\fIchr\fR|\fIchr:pos\fR|\fIchr:from\-to\fR|\fIchr:from\-\fR[,\&...]
.RS 4
see
\fBCommon Options\fR
.RE
.PP
\fB\-w, \-\-win\fR \fIINT\fR,\fIINT\fR
.RS 4
alignment window and buffer window [50,1000]
.RE
.SS "bcftools query [\fIOPTIONS\fR] \fIfile\&.vcf\&.gz\fR [\fIfile\&.vcf\&.gz\fR [\&...]]"
.sp
Extracts fields from VCF or BCF files and outputs them in user\-defined format\&.
.PP
\fB\-a, \-\-annots\fR \fILIST\fR
.RS 4
alias for \-f
\fI%CHROM\et%POS\et%MASK\et%REF\et%ALT\et%TYPE\et\fR
and tab\-separated
\fILIST\fR
of tags
.RE
.PP
\fB\-c, \-\-collapse\fR \fIsnps\fR|\fIindels\fR|\fIboth\fR|\fIall\fR|\fIsome\fR|\fInone\fR
.RS 4
see
\fBCommon Options\fR
.RE
.PP
\fB\-f, \-\-format\fR \fIFORMAT\fR
.RS 4
learn by example, see below
.RE
.PP
\fB\-H, \-\-print\-header\fR
.RS 4
print header
.RE
.PP
\fB\-l, \-\-list\-samples\fR
.RS 4
list sample names and exit
.RE
.PP
\fB\-r, \-\-regions\fR \fIfile\fR|\fIchr\fR|\fIchr:pos\fR|\fIchr:from\-to\fR|\fIchr:from\-\fR[,\&...]
.RS 4
see
\fBCommon Options\fR
.RE
.PP
\fB\-s, \-\-samples\fR \fILIST\fR|\fI:FILE\fR
.RS 4
see
\fBCommon Options\fR
.RE
.PP
\fB\-t, \-\-targets\fR \fIfile\fR|\fIchr\fR|\fIchr:pos\fR|\fIchr:from\-to\fR|\fIchr:from\-\fR[,\&...]
.RS 4
see
\fBCommon Options\fR
.RE
.PP
\fB\-v, \-\-vcf\-list\fR \fIFILE\fR
.RS 4
process multiple VCFs listed in the file