Closed heseber closed 2 years ago
Hi @heseber , Can you also share the single sample VCF lines please?
Thanks Rajat
Hi @rajatshuvro,
As it turns out, Nirvana cannot annotate VCF files with any multiallelic lines correctly. If there is more than one alternative allele for a position, such as A,T
, then the AF
field is not a single number with the allele frequency, but a list of numbers separated by commas, one number for each alternative allele. Usually samples have only one allele per position, so after merging multiple VCF files into a singe multi-sample VCF file, each AF
field for a multiallellic position is a comma-separated list with only one non-empty variant frequency for each sample, whereas all other elements of the comma separated AF
list are simple single dots, such as 0.6,.
, where the first allele has an AF of 0.6, and the second is not present in this sample. It is possible to tell bcftools merge
to not create any multiallelic lines but multiple single-allelic lines instead by adding the option -m none
. This if fact works with Nirvana, because now there are no multiallelic lines and, therefore, each AF
field is a simple number and not a list. So using bcftools merge -m none
is a workaround for this issue as long as none of the single-sample input VCF files has multiallelic lines.
Nirvana does not correctly annotate VCF files with multiallelic lines. Any such VCF file needs to be converted by transforming multiallelic lines into multiple single-allelic lines. Workaround is to use bcftools merge -m none
which works as long as none of the input single-sample VCF files has multiallelic lines.
I attach a zip file with example files: issue80_example.zip. Included are:
For each of these files, the output of Nirvana v3.18.1 is included, and the subdirectory samples_merged_no_multiallelic_split
contains singe-sample json files obtained by splitting the multi-sample json file for the no-multiallelic VCF.
Just one additional note: when annotating single-sample VCF files that have multiallelic lines, they need to be converted (normalized) by transforming multiallelic lines to multiple single-allelic lines. This can be done with bcftools norm -m- -Oz -o output.vcf.gz input.vcf.gz
Hello @heseber , thanks for the detailed bug report. Here is the ticket for the issue: https://nirvana-annotator.atlassian.net/browse/NIR-1040.
Best Rajat
Has been fixed in the current develop branch. Will be formally available in the next release.
This issue occurs if:
Example:
When annotating single-sample VCF files for these two samples, I get
and
However, if I annotate a multi-sample VCF file, variantFrequencies and alleleDepths are lost: