![bcftools filter for presence of info tag bcftools filter for presence of info tag](https://media.springernature.com/full/springer-static/image/art%3A10.1038%2Fs41586-020-2947-8/MediaObjects/41586_2020_2947_Fig1_HTML.png)
The output can then be piped into other programs or written out to a specified file name. Using the options -stdout or -c will redirect all output to standard out. vcftools -vcf input_data.vcf -chr 1 -from-bp 1000000 -to-bp 2000000 -recode -out subset Writing out to screenīeginning with VCFtools v0.1.12, the program can also write out to screen instead of having the program write to a specified path. The program will add a suffix to that path based on the chosen output function. To change the path, specify the new path using the option -out followed by the desired path. In this example, VCFtools will create a new VCF file containing only variants within the specified chromosomal region while keeping all INFO fields included in the original file.Īny files written out by VCFtools will be in the current working directory and have the prefix. vcftools -vcf input_data.vcf -chr 1 -from-bp 1000000 -to-bp 2000000 -recode -recode-INFO-all By default INFO fields are not written because many filters will alter the variants in a file, rendering the INFO values incorrect. In addition, use -recode-INFO-all to include all data from the INFO fields in the output. To write out the variants that pass through filters use the -recode option. This function is helpful for creating subsets of VCF files or just removing unwanted variants from VCF files. VCFtools can perform analyses on the variants that pass through the filters or simply write those variants out to a new file. This option can be modified to work with any desired region. vcftools -vcf input_data.vcf -chr 1 -from-bp 1000000 -to-bp 2000000Īfter running this line, the program will return the amount of sites in the file that are included in the chromosomal region chr1:1000000-2000000.
![bcftools filter for presence of info tag bcftools filter for presence of info tag](https://cdn-ak.f.st-hatena.com/images/fotolife/k/kazumaxneo/20170916/20170916151147.jpg)
For example, to filter the sites within a file based upon their location in genome, use the options -chr, -from-bp, and -to-bp to specify the region. You can use VCFtools to filter out variants or individuals based on the values within the file. To do this, use any of the normal file type input options followed by the dash - character. It will return information about the file such as the number of variants and the number of individuals in the file.īeginning with vcftools v0.1.12, the program can also take input in from standard input ( stdin). For example, for a VCF file called input_data.vcf the following command could be run: To specify an input file you must use the one of the input options ( -vcf, -gzvcf, or -bcf ) depending on the type of file. The executable can be run with only an input VCF file without any other options, and will return basic information regarding the contents of the file. The program will return information regarding the version number. Getting linkage disequilibrium statisticsīy default the executable can be found in the bin/ subdirectory.
#Bcftools filter for presence of info tag manual
Extended documentation for all of the options can be found on the manual page. This page provides usage examples for the executable module.