Bcftools filter for presence of info tag
![bcftools filter for presence of info tag bcftools filter for presence of info tag](https://usermanual.wiki/Document/SQLWorkbenchManual.1388874451-User-Guide-Page-1.png)
So if you had the following samples file samples.tsv sample1 sample1 # Keep all FORMAT tags but drop all INFO tagsīcftools +split input.bcf -Ob -o dir -k FMT bcftools call: - Revamp of call -G, previously sample grouping by population was not truly independent and could still be influenced by the presence of other sample groups. # Keep all INFO tags but only GT and PL in FORMATīcftools +split input.bcf -Ob -o dir -k INFO,FMT/GT,PL # Exclude sites with missing or hom-ref genotypesīcftools +split input.bcf -Ob -o dir -i'GT="alt"' T, -targets-file FILE similar to -R but streams rather than index-jumps t, -targets REGION similar to -r but streams rather than index-jumps S, -samples-file FILE list of samples to keep with second (optional) column for basename of the new file R, -regions-file FILE restrict to regions listed in a file r, -regions REGION restrict to comma-separated list of regions O, -output-type b|u|z|v b: compressed BCF, u: uncompressed BCF, z: compressed VCF, v: uncompressed VCF o, -output DIR write output to the directory DIR k, -keep-tags LIST list of tags to keep. i, -include EXPR include only sites for which the expression is true (applied on the outputs) e, -exclude EXPR exclude sites for which the expression is true (applied on the outputs) $ bcftools +splitĪbout: Split VCF by sample, creating single-sample VCFs. In addition to the answer from there is a bcftools plugin called split that can do this, but gives you the added ability to output single-sample VCFs by specifying a filename for each sample. Note that in general tags such as INFO/AC, INFO/AN, etc are not updated to correspond to the subset samples. Comma-separated list of samples to include or exclude if prefixed with ''. You can subset individuals by using the -s or -S option:-s, -samples LIST. See the bcftools manpage for more information. Bcftools has sample/individual filtering as an option for most of the commands. ped file (here is shown a minimum working example, the first column is ignored and the last indicates sex: 1=male, 2=female): ignored daughterA fatherA motherA 2Įxample usage: bcftools view -s sample1,sample2 file.vcf > filtered.vcfīcftools view -S sample_file.txt file.vcf > filtered.vcf With bcftools call -C trio, PED file is expected. If the second column is not present, the sex "F" is assumed. The command bcftools call accepts an optional second column indicating ploidy (0, 1 or 2) or sex (as defined by -ploidy, for example "F" or "M"), and can parse also PED files. See also the note above for the -s, -samples option.
![bcftools filter for presence of info tag bcftools filter for presence of info tag](https://ars.els-cdn.com/content/image/1-s2.0-S2666979X2200012X-fx1.jpg)
For example:įile of sample names to include or exclude if prefixed with "^".
![bcftools filter for presence of info tag bcftools filter for presence of info tag](https://www.frontiersin.org/files/Articles/648229/fgene-12-648229-HTML/image_m/fgene-12-648229-g003.jpg)
To use updated tags for the subset in another command one can pipe from view into that command. Tags will be updated (unless the -I, -no-update option is used see bcftools view documentation). bcftools view is the exception where some You can subset individuals by using the -s or -S option:Ĭomma-separated list of samples to include or exclude if prefixed with "^". Bcftools has sample/individual filtering as an option for most of the commands.