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. See the bcftools manpage for more information. 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. For example:įile of sample names to include or exclude if prefixed with "^". 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 Note that in general tags such as INFO/AC, INFO/AN, etc are not updated to correspond to the subset samples. 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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |