Reading VCF file features using custom 'Allele' subclass #1653
-
Hi! I'm writing an application using HTSJDK 3.0.4 to read the contents of a VCF file. Thank you for your time, Makenzi Nzau. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@makenzi-nzau That's a great question. Unfortunately I don't have a great answer. The simple answer is that there's no easy way to make the AbstractFeatureReader provide an iterator that does what you want. I think the simplest thing to do, but it might not be what you want, is to wrap the produced iterator in a new iterator that internally repackages the produced VariantContexts with your Allele implementation. A more involved procedure would be to implement your own subclass of AbstractFeatureReader which does what you want and then explicitly invoke that. Neither is really is likely to be a great option unfortunately. I think WHY you want a new implementation of Allele and what you want to do with it is an important question which informs which way you have to go to achieve it. I've wanted for a long time to make VariantContext/Genotype also interfaces with more facilities to actually swap out implementations to be what you need, but it's never been prioritized. |
Beta Was this translation helpful? Give feedback.
@makenzi-nzau That's a great question. Unfortunately I don't have a great answer. The simple answer is that there's no easy way to make the AbstractFeatureReader provide an iterator that does what you want.
I think the simplest thing to do, but it might not be what you want, is to wrap the produced iterator in a new iterator that internally repackages the produced VariantContexts with your Allele implementation.
A more involved procedure would be to implement your own subclass of AbstractFeatureReader which does what you want and then explicitly invoke that.
Neither is really is likely to be a great option unfortunately. I think WHY you want a new implementation of Allele and what you wan…