-
Notifications
You must be signed in to change notification settings - Fork 308
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
fix SB tag parsing #1203
fix SB tag parsing #1203
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,15 +17,16 @@ | |
*/ | ||
package org.bdgenomics.adam.converters | ||
|
||
import org.apache.avro.Schema | ||
import org.apache.avro.specific.SpecificRecord | ||
import htsjdk.variant.variantcontext.VariantContext | ||
import htsjdk.variant.vcf._ | ||
import org.apache.avro.Schema | ||
import org.apache.avro.specific.SpecificRecord | ||
import org.bdgenomics.formats.avro.{ | ||
DatabaseVariantAnnotation, | ||
Genotype, | ||
VariantCallingAnnotations | ||
} | ||
import scala.collection.JavaConversions._ | ||
|
||
/** | ||
* Singleton object for building AttrKey instances. | ||
|
@@ -123,6 +124,17 @@ private[converters] object VariantAnnotationConverter extends Serializable { | |
case a: String => java.lang.Boolean.valueOf(a) | ||
} | ||
|
||
/** | ||
* Converts a java String of comma delimited integers to a | ||
* java.util.List of Integer | ||
* | ||
* @param attr Attribute to convert. | ||
* @return Attribute as a java.util.List[Integer] | ||
*/ | ||
private def attrAsIntList(attr: Object): Object = attr match { | ||
case a: java.lang.String => seqAsJavaList(a.split(",").map(java.lang.Integer.valueOf _)) | ||
} | ||
|
||
/** | ||
* Keys corresponding to the COSMIC mutation database. | ||
*/ | ||
|
@@ -187,7 +199,7 @@ private[converters] object VariantAnnotationConverter extends Serializable { | |
AttrKey("phaseQuality", attrAsInt _, new VCFFormatHeaderLine(VCFConstants.PHASE_QUALITY_KEY, 1, VCFHeaderLineType.Float, "Read-backed phasing quality")), | ||
AttrKey("phaseSetId", attrAsInt _, new VCFFormatHeaderLine(VCFConstants.PHASE_SET_KEY, 1, VCFHeaderLineType.Integer, "Phase set")), | ||
AttrKey("minReadDepth", attrAsInt _, new VCFFormatHeaderLine("MIN_DP", 1, VCFHeaderLineType.Integer, "Minimum DP observed within the GVCF block")), | ||
AttrKey("strandBiasComponents", attrAsInt _, new VCFFormatHeaderLine("SB", 4, VCFHeaderLineType.Integer, "Per-sample component statistics which comprise the Fisher's Exact Test to detect strand bias.")) | ||
AttrKey("strandBiasComponents", attrAsIntList _, new VCFFormatHeaderLine("SB", 4, VCFHeaderLineType.Integer, "Per-sample component statistics which comprise the Fisher's Exact Test to detect strand bias.")) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you have a doc link for the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. GATK docs define it as always with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great, thanks! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SB components are a 2x2 matrix: forward/rev strand on one axis, ref/alt on the other axis |
||
) | ||
|
||
/** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test that covers this function?