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

[ADAM-1372] Increase visibility for DefaultHeaderLines.allHeaderLines #1375

Merged
merged 1 commit into from Jan 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -27,9 +27,9 @@ import htsjdk.variant.vcf.{
}

/**
* All header lines for VCF INFO and GT format fields that are supported in ADAM.
* Default set of VCF header lines for INFO and GT format fields supported in ADAM.
*/
private[adam] object SupportedHeaderLines {
object DefaultHeaderLines {

lazy val ancestralAllele = new VCFInfoHeaderLine("AA",
1,
Expand Down Expand Up @@ -89,7 +89,7 @@ private[adam] object SupportedHeaderLines {
"Functional annotations: 'Allele | Annotation | Annotation_Impact | Gene_Name | Gene_ID | Feature_Type | Feature_ID | Transcript_BioType | Rank | HGVS.c | HGVS.p | cDNA.pos / cDNA.length | CDS.pos / CDS.length | AA.pos / AA.length | Distance | ERRORS / WARNINGS / INFO'")

/**
* All info keys in VCF format.
* Default set of VCF header lines for INFO fields supported in ADAM.
*/
lazy val infoHeaderLines = Seq(
ancestralAllele,
Expand Down Expand Up @@ -167,7 +167,7 @@ private[adam] object SupportedHeaderLines {
"Total number of reads with mapping quality=0")

/**
* All format lines in VCF format.
* Default set of VCF header lines for GT format fields supported in ADAM.
*/
lazy val formatHeaderLines = Seq(
genotype,
Expand All @@ -186,7 +186,7 @@ private[adam] object SupportedHeaderLines {
)

/**
* All supported header lines in VCF format.
* Default set of VCF header lines for INFO and GT format fields supported in ADAM.
*/
lazy val allHeaderLines = infoHeaderLines ++ formatHeaderLines
}
Expand Up @@ -1394,7 +1394,7 @@ private[adam] class VariantContextConverter(
val key = il.getID

// filter out the lines that we already support
if (SupportedHeaderLines.infoHeaderLines
if (DefaultHeaderLines.infoHeaderLines
.find(_.getID == key)
.isEmpty) {

Expand Down Expand Up @@ -1467,7 +1467,7 @@ private[adam] class VariantContextConverter(
val key = fl.getID

// filter out the lines that we already support
if (SupportedHeaderLines.formatHeaderLines
if (DefaultHeaderLines.formatHeaderLines
.find(_.getID == key)
.isEmpty) {

Expand Down Expand Up @@ -1818,7 +1818,7 @@ private[adam] class VariantContextConverter(
val key = il.getID

// filter out the lines that we already support
if (SupportedHeaderLines.infoHeaderLines
if (DefaultHeaderLines.infoHeaderLines
.find(_.getID == key)
.isDefined) {

Expand Down Expand Up @@ -1891,7 +1891,7 @@ private[adam] class VariantContextConverter(
val key = fl.getID

// filter out the lines that we already support
if (SupportedHeaderLines.formatHeaderLines
if (DefaultHeaderLines.formatHeaderLines
.find(_.getID == key)
.isDefined) {

Expand Down
Expand Up @@ -239,7 +239,7 @@ class ADAMContext(@transient val sc: SparkContext) extends Serializable with Log
deduped.flatMap(line => line match {
case fl: VCFFormatHeaderLine => {
val key = fl.getID
SupportedHeaderLines.formatHeaderLines
DefaultHeaderLines.formatHeaderLines
.find(_.getID == key)
.fold(Some(fl).asInstanceOf[Option[VCFCompoundHeaderLine]])(defaultLine => {
auditLine(fl, defaultLine, (newId, oldLine) => {
Expand All @@ -252,7 +252,7 @@ class ADAMContext(@transient val sc: SparkContext) extends Serializable with Log
}
case il: VCFInfoHeaderLine => {
val key = il.getID
SupportedHeaderLines.infoHeaderLines
DefaultHeaderLines.infoHeaderLines
.find(_.getID == key)
.fold(Some(il).asInstanceOf[Option[VCFCompoundHeaderLine]])(defaultLine => {
auditLine(il, defaultLine, (newId, oldLine) => {
Expand All @@ -266,7 +266,7 @@ class ADAMContext(@transient val sc: SparkContext) extends Serializable with Log
case l => {
Some(l)
}
}) ++ SupportedHeaderLines.allHeaderLines
}) ++ DefaultHeaderLines.allHeaderLines
}

private def headerLines(header: VCFHeader): Seq[VCFHeaderLine] = {
Expand Down
Expand Up @@ -20,7 +20,6 @@ package org.bdgenomics.adam.rdd.variant
import htsjdk.variant.vcf.{ VCFHeaderLine, VCFHeader }
import org.apache.hadoop.fs.{ FileSystem, Path }
import org.apache.hadoop.mapreduce.{ RecordWriter, TaskAttemptContext }
import org.bdgenomics.adam.converters.SupportedHeaderLines
import org.bdgenomics.adam.models.SequenceDictionary
import org.seqdoop.hadoop_bam.{
KeyIgnoringVCFOutputFormat,
Expand Down
Expand Up @@ -20,7 +20,7 @@ package org.bdgenomics.adam.rdd.variant
import htsjdk.samtools.ValidationStringency
import htsjdk.variant.vcf.VCFHeaderLine
import org.apache.spark.rdd.RDD
import org.bdgenomics.adam.converters.SupportedHeaderLines
import org.bdgenomics.adam.converters.DefaultHeaderLines
import org.bdgenomics.adam.models.{
ReferencePosition,
ReferenceRegion,
Expand Down Expand Up @@ -73,7 +73,7 @@ private[adam] class GenotypeArraySerializer extends IntervalArraySerializer[Refe
case class GenotypeRDD(rdd: RDD[Genotype],
sequences: SequenceDictionary,
@transient samples: Seq[Sample],
@transient headerLines: Seq[VCFHeaderLine] = SupportedHeaderLines.allHeaderLines) extends MultisampleAvroGenomicRDD[Genotype, GenotypeRDD] {
@transient headerLines: Seq[VCFHeaderLine] = DefaultHeaderLines.allHeaderLines) extends MultisampleAvroGenomicRDD[Genotype, GenotypeRDD] {

protected def buildTree(rdd: RDD[(ReferenceRegion, Genotype)])(
implicit tTag: ClassTag[Genotype]): IntervalArray[ReferenceRegion, Genotype] = {
Expand Down
Expand Up @@ -24,7 +24,7 @@ import org.apache.hadoop.io.LongWritable
import org.apache.hadoop.fs.Path
import org.apache.spark.rdd.RDD
import org.bdgenomics.adam.converters.{
SupportedHeaderLines,
DefaultHeaderLines,
VariantContextConverter
}
import org.bdgenomics.adam.models.{
Expand Down Expand Up @@ -86,7 +86,7 @@ private[adam] class VariantContextArraySerializer extends IntervalArraySerialize
case class VariantContextRDD(rdd: RDD[VariantContext],
sequences: SequenceDictionary,
@transient samples: Seq[Sample],
@transient headerLines: Seq[VCFHeaderLine] = SupportedHeaderLines.allHeaderLines) extends MultisampleGenomicRDD[VariantContext, VariantContextRDD]
@transient headerLines: Seq[VCFHeaderLine] = DefaultHeaderLines.allHeaderLines) extends MultisampleGenomicRDD[VariantContext, VariantContextRDD]
with Logging {

protected def buildTree(rdd: RDD[(ReferenceRegion, VariantContext)])(
Expand Down
Expand Up @@ -21,7 +21,7 @@ import htsjdk.samtools.ValidationStringency
import htsjdk.variant.vcf.{ VCFHeader, VCFHeaderLine }
import org.apache.hadoop.fs.Path
import org.apache.spark.rdd.RDD
import org.bdgenomics.adam.converters.SupportedHeaderLines
import org.bdgenomics.adam.converters.DefaultHeaderLines
import org.bdgenomics.adam.models.{
ReferenceRegion,
ReferenceRegionSerializer,
Expand Down Expand Up @@ -78,7 +78,7 @@ private[adam] class VariantArraySerializer extends IntervalArraySerializer[Refer
*/
case class VariantRDD(rdd: RDD[Variant],
sequences: SequenceDictionary,
@transient headerLines: Seq[VCFHeaderLine] = SupportedHeaderLines.allHeaderLines) extends AvroGenomicRDD[Variant, VariantRDD] {
@transient headerLines: Seq[VCFHeaderLine] = DefaultHeaderLines.allHeaderLines) extends AvroGenomicRDD[Variant, VariantRDD] {

protected def buildTree(rdd: RDD[(ReferenceRegion, Variant)])(
implicit tTag: ClassTag[Variant]): IntervalArray[ReferenceRegion, Variant] = {
Expand Down