File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -3118,6 +3118,12 @@ Extracts fields from VCF or BCF files and outputs them in user-defined format.
31183118 # (-i) use "[]". This is for historic reasons and backward-compatibility.
31193119 bcftools query -f '%AC{1}\n' -i 'AC[1]>10' file.vcf.gz
31203120
3121+ # Print all samples at sites where at least one sample has DP=1 or DP=2. In the second case
3122+ # print only samples with DP=1 or DP=2, the difference is in the logical operator used, || vs |.
3123+ bcftools query -f '[%SAMPLE %GT %DP\n]' -i 'FMT/DP=1 || FMT/DP=2' file.vcf
3124+ bcftools query -f '[%SAMPLE %GT %DP\n]' -i 'FMT/DP=1 | FMT/DP=2' file.vcf
3125+
3126+
31213127[[reheader]]
31223128=== bcftools reheader ['OPTIONS'] 'file.vcf.gz'
31233129Modify header of VCF/BCF files, change sample names.
Original file line number Diff line number Diff line change @@ -256,6 +256,7 @@ static void usage(void)
256256 fprintf (stderr , "\n" );
257257 fprintf (stderr , "Examples:\n" );
258258 fprintf (stderr , "\tbcftools query -f '%%CHROM\\t%%POS\\t%%REF\\t%%ALT[\\t%%SAMPLE=%%GT]\\n' file.vcf.gz\n" );
259+ fprintf (stderr , "\t# For more examples see http://samtools.github.io/bcftools/bcftools.html#query\n" );
259260 fprintf (stderr , "\n" );
260261 exit (1 );
261262}
You can’t perform that action at this time.
0 commit comments