Skip to content

Commit

Permalink
Revert "Support dynamic variables read from a tab-delimited annotatio…
Browse files Browse the repository at this point in the history
…n file"

This needs more work, didn't realize that the effect of the -c option is to
update the target VCF as well, so can't be used simply for matching. For
that, probably a new prefix will need to be introduced, but that's already
confusing as it is, for example ~ has double meaning.

This reverts commit e9bff3f. Switch to
branch bt-2151-annotate-ext to see this code.
  • Loading branch information
pd3 committed Apr 12, 2024
1 parent e9bff3f commit bb2d7a8
Show file tree
Hide file tree
Showing 10 changed files with 184 additions and 582 deletions.
12 changes: 0 additions & 12 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,6 @@

Changes affecting specific commands:

* bcftools annotate

- Support dynamic variables read from a tab-delimited annotation file (#2151)
For example, in the two cases below the field 'STR' from the -a file is required to match
the INFO/TAG in VCF. In the first example the alleles REF,ALT must match, in the second
example they are ignored. The option -k is required to output also records that were not
annotated:

bcftools annotate -a ann.tsv.gz -c CHROM,POS,REF,ALT,SCORE,STR -i'TAG={STR}' -k in.vcf
bcftools annotate -a ann.tsv.gz -c CHROM,POS,-,-,SCORE,STR -i'TAG={STR}' -k in.vcf


* bcftools consensus

- Add new --regions-overlap option which allows to take into account overlapping deletions
Expand Down
12 changes: 0 additions & 12 deletions doc/bcftools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ Add or remove annotations.
To replace only existing values without modifying missing annotations, use "-TAG".
To match the record also by ID or INFO/END, in addition to REF and ALT, use "~ID" or "~INFO/END".
If position needs to be replaced, mark the column with the new position as "~POS".
Note that this works only for ID and POS, for other fields see the description of *-i* below.
{nbsp} +
{nbsp} +
If the annotation file is not a VCF/BCF, all new annotations must be
Expand Down Expand Up @@ -424,17 +423,6 @@ Add or remove annotations.
*-i, --include* 'EXPRESSION'::
include only sites for which 'EXPRESSION' is true. For valid expressions see
*<<expressions,EXPRESSIONS>>*.
{nbsp} +
{nbsp} +
Additionally, the command *bcftools annotate* supports expressions updated from the annotation
file dynamically for each record:
----
# The field 'STR' from the -a file is required to match INFO/TAG in VCF. In the first example
# the alleles REF,ALT must match, in the second example they are ignored. The option -k is required
# to output also records that were not annotated
bcftools annotate -a annots.tsv.gz -c CHROM,POS,REF,ALT,SCORE,STR -i'TAG={STR}' -k input.vcf
bcftools annotate -a annots.tsv.gz -c CHROM,POS,-,-,SCORE,STR -i'TAG={STR}' -k input.vcf
----

*-k, --keep-sites*::
keep sites which do not pass *-i* and *-e* expressions instead of discarding them
Expand Down
Loading

0 comments on commit bb2d7a8

Please sign in to comment.