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

Variant and Genotype converters will need VCF header #18

Closed
heuermh opened this issue Dec 24, 2016 · 2 comments · Fixed by #71
Closed

Variant and Genotype converters will need VCF header #18

heuermh opened this issue Dec 24, 2016 · 2 comments · Fixed by #71
Milestone

Comments

@heuermh
Copy link
Member

heuermh commented Dec 24, 2016

No description provided.

@akmorrow13
Copy link
Contributor

akmorrow13 commented Apr 15, 2019

This would look something like this:

val codec = new VCFCodec()

val vcfReader: AbstractFeatureReader[HtsjdkVariantContext, LineIterator] = AbstractFeatureReader.getFeatureReader(filename, codec)


val header: VCFHeader = vcfReader.getHeader().asInstanceOf[VCFHeader]

val converter = new VariantContextConverter(
      getHeaderLines(header),
      ValidationStringency.LENIENT, false)


  // defined in ADAM in VariantContextConverter line 266
def getHeaderLines(header: VCFHeader): Seq[VCFHeaderLine] = {
    (header.getFilterLines ++
      header.getFormatHeaderLines ++
      header.getInfoHeaderLines ++
      header.getOtherHeaderLines).toSeq
  }

@heuermh
Copy link
Member Author

heuermh commented Apr 15, 2019

Yeah, but note the standard headers that ADAM uses are not exactly the same as the standard headers in htsjdk, because they don't actually follow the VCF specification.

https://github.com/bigdatagenomics/adam/blob/master/adam-core/src/main/scala/org/bdgenomics/adam/converters/VariantContextConverter.scala#L191

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

Successfully merging a pull request may close this issue.

2 participants