Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Liftover drop-tags finds no matching tags #6

Open
meyerkm opened this issue Mar 26, 2024 · 7 comments
Open

Liftover drop-tags finds no matching tags #6

meyerkm opened this issue Mar 26, 2024 · 7 comments

Comments

@meyerkm
Copy link

meyerkm commented Mar 26, 2024

Run command:
bcftools +liftover -Oz -o testvcf_output.vcf.gz testvcf_input.vcf.gz -- -s source_fasta.fa -f reference.fa -c chainfile.chain.gz --reject testvcf.rejected.vcf.gz

Error #1:

INFO/AF is handled by AF rule
Number of elements in the VCF record AF should be 1 but 2 found
Use --drop-tags INFO/AF to skip this error

Which arrises in the case of needing to swap alleles. All files do have two values for the INFO/AF field , i.e. AF=0.5,0.3
Attempted fix:
bcftools +liftover -Oz -o testvcf_output.vcf.gz testvcf_input.vcf.gz -- -s source_fasta.fa -f reference.fa -c chainfile.chain.gz --reject testvcf.rejected.vcf.gz --drop-tags [INFO/AF]

Error#2:
No matching tag [INFO/AF]

As a check, generally querying that tag in the VCF does work :
bcftools query -f '%INFO/AF' testvcf_input.vcf.gz

Maybe there is some trick to identifying the drop-tags? I have tried various inputs/string combinations for the drop-tags option without any luck.

@freeseek
Copy link
Owner

The correct syntax should be --drop-tags INFO/AF. But it is a bit worrisome that you have two 2 INFO/AF elements where 1 is expected. The INFO/AF field should be a Number=A field, that is, a field with one number for each alternate allele. This is mandated by the VCF specification. How do you interpret and INFO/AF field as AF=0.5,0.3 for a variant with one alternate allele?

@meyerkm
Copy link
Author

meyerkm commented Mar 27, 2024

Thanks for the indication, unfortunately with that syntax I still get the error from above, as if it doesn't recognize that the flag was even set.

Run command :
bcftools +liftover -Oz -o testvcf_output.vcf.gz testvcf_input.vcf.gz -- -s source_fasta.fa -f reference.fa -c chainfile.chain.gz --reject testvcf.rejected.vcf.gz --drop-tags INFO/AF

Error :

INFO/AF is handled by AF rule
WARNING: bcftools version mismatch .. bcftools at 1.18, the plugin "liftover" at 1.19
Number of elements in the VCF record AF should be 1 but 2 found
Use --drop-tags INFO/AF to skip this error

@freeseek
Copy link
Owner

Try again using the development version from here and see if fixes the issue

@jjfarrell
Copy link

jjfarrell commented Mar 27, 2024 via email

@freeseek
Copy link
Owner

Yes, if the site has two alternate alleles then INFO/AF should have two values but the problem for @meyerkm is likely a site with one alternate allele and two values from the provided explanation. A site with two alternate alleles and two INFO/AF values will work just as intended with BCFtools/liftover while BCFtools/norm will also throw an error when trying to split a multi-allelic site where the Number=A INFO field has an incorrect number of values

@meyerkm
Copy link
Author

meyerkm commented Mar 27, 2024

Correct @freeseek , yes I have one alternate allele but two values in the INFO/AF field. I have an AF value from two samples. I was hoping this --drop-tags flag would be able to allow things to carry-on irrespective of this detail. I am going to remove the secondary AF value that isn't the control, thus I won't have to utilize the --drop-tags.

But I can of course test the develop version you posted above, as having the drop-tags functionality work in a catch-all way may otherwise be useful!

@meyerkm
Copy link
Author

meyerkm commented Mar 27, 2024

The develop version you have listed above does work for those SWAP cases with the --drop-tags!

Same run command, as above, but with the development version of liftover:
bcftools +liftover -Oz -o testvcf_output.vcf.gz testvcf_input.vcf.gz -- -s source_fasta.fa -f reference.fa -c chainfile.chain.gz --reject testvcf.rejected.vcf.gz --drop-tags INFO/AF

Output:

INFO/AF is handled by DROP rule
WARNING: bcftools version mismatch .. bcftools at 1.18, the plugin "liftover" at 1.19
Lines   total/swapped/reference added/rejected:	493/3/0/0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants