VariantContext throws exception on getAltAlleleWithHighestAlleleCount() #519

Closed
jamesnemesh opened this Issue Apr 19, 2016 · 1 comment

Comments

Projects
None yet
3 participants

When calling getAltAlleleWithHighestAlleleCount() on a variant that has no variation, class throws exception:

java.util.NoSuchElementException: No value present
at java.util.Optional.get(Optional.java:135)
at htsjdk.variant.variantcontext.VariantContext.getAltAlleleWithHighestAlleleCount(VariantContext.java:1704)

This used to emit a null, which I'd grab and then work around appropriately. I've attached a 1 line VCF (testVCF.vcf) file as an example for replication.

As a further related question - is there a way to recover the alternate allele for this record if I've filtered the record to only look at sample a sample that doesn't have the alternate allele via subContextFromSamples()? The list of the samples I care about for analysis changes the list of alternate alleles for the context, but I actually want all of the original alleles for reporting purposes. See testVCF2.vcf. Is my only recourse to get those alleles before filtering by samples?

testVCFs.zip

yfarjoun added the secon label Jul 2, 2016

@kasont kasont added a commit to kasont/htsjdk that referenced this issue Jul 7, 2016

@kasont kasont As per request broadinstitute/picard#519 the output is null. 3709f86

kasont referenced this issue in samtools/htsjdk Jul 7, 2016

Closed

As per request https://github.com/broadinstitute/picard/issues/519 th… #656

0 of 5 tasks complete

@kasont kasont added a commit to kasont/htsjdk that referenced this issue Jul 8, 2016

@kasont kasont As per request broadinstitute/picard#519 the output is null. 652b20b

@kasont kasont added a commit to kasont/htsjdk that referenced this issue Jul 8, 2016

@kasont kasont RE:As per request broadinstitute/picard#519 the output is null. 6029db0

@kasont kasont added a commit to kasont/htsjdk that referenced this issue Jul 8, 2016

@kasont kasont RE:As per request broadinstitute/picard#519 the output is null. 43eae90
Contributor

kasont commented Jul 11, 2016

Could you add a test for this to come out null and one to not? @jamesnemesh

yfarjoun referenced this issue in samtools/htsjdk Oct 27, 2016

Merged

Kt varient context change #733

4 of 5 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment