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

Genotype.getAnyAttribute incorrectly handles converting int[] to List<Integer> #274

Open
dfsurdyk opened this issue Jul 1, 2015 · 4 comments

Comments

@dfsurdyk
Copy link

dfsurdyk commented Jul 1, 2015

Both getAD() and getPL() return an int[], and doing Arrays.asList(int[]) will return a List<int[]> instead of List<Integer>.

https://github.com/samtools/htsjdk/blob/master/src/java/htsjdk/variant/variantcontext/Genotype.java#L544

dfsurdyk pushed a commit to dfsurdyk/htsjdk that referenced this issue Jul 2, 2015
@dfsurdyk dfsurdyk changed the title Geotype.getAnyAttribute incorrectly handles converting int[] to List<Integer> Genotype.getAnyAttribute incorrectly handles converting int[] to List<Integer> Jul 2, 2015
dfsurdyk pushed a commit to dfsurdyk/htsjdk that referenced this issue Jul 2, 2015
* The Genotype.getAnyAttribute() incorrectly handles converting int[] to
  List<Integer>.  Both getAD() and getPL() return an int[], and doing
  Arrays.asList(int[]) will return a List<int[]> instead of List<Integer>.

See: samtools#274
@nh13
Copy link
Member

nh13 commented Jul 2, 2015

Arrays.asList(int[]) will return `List``, so I am closing this issue.

@nh13 nh13 closed this as completed Jul 2, 2015
@nh13
Copy link
Member

nh13 commented Jul 2, 2015

Wow, I am so wrong. Let us take a look at this.

@lbergelson lbergelson reopened this Jul 2, 2015
nh13 pushed a commit that referenced this issue Jul 23, 2015
* The Genotype.getAnyAttribute() incorrectly handles converting int[] to
  List<Integer>.  Both getAD() and getPL() return an int[], and doing
  Arrays.asList(int[]) will return a List<int[]> instead of List<Integer>.

See: #274
@dfsurdyk
Copy link
Author

@lbergelson - I think this can be closed:
#275

@yfarjoun
Copy link
Contributor

yfarjoun commented Apr 1, 2019

My 2ct: I think we shoudl get rid of GetAnyAttribute and implement (as for the info field) getAttributeAsArray{String,Int,Float}

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

4 participants