Skip to content

Commit 78ed055

Browse files
committed
Update documentation
1 parent bbab29d commit 78ed055

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

doc/bcftools.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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'
31233129
Modify header of VCF/BCF files, change sample names.

vcfquery.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)