Package org.bdgenomics.formats.avro
Class VariantCallingAnnotations
- java.lang.Object
-
- org.apache.avro.specific.SpecificRecordBase
-
- org.bdgenomics.formats.avro.VariantCallingAnnotations
-
- All Implemented Interfaces:
Externalizable
,Serializable
,Comparable<org.apache.avro.specific.SpecificRecord>
,org.apache.avro.generic.GenericContainer
,org.apache.avro.generic.GenericRecord
,org.apache.avro.generic.IndexedRecord
,org.apache.avro.specific.SpecificRecord
public class VariantCallingAnnotations extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord
This record represents all stats that, inside a VCF, are stored outside of the sample but are computed based on the samples. For instance, MAPQ0 is an aggregate stat computed from all samples and stored inside the INFO line.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VariantCallingAnnotations.Builder
RecordBuilder for VariantCallingAnnotations instances.
-
Field Summary
Fields Modifier and Type Field Description static org.apache.avro.Schema
SCHEMA$
-
Constructor Summary
Constructors Constructor Description VariantCallingAnnotations()
Default constructor.VariantCallingAnnotations(Boolean filtersApplied, Boolean filtersPassed, List<String> filtersFailed, Boolean downsampled, Float baseQRankSum, Float fisherStrandBiasPValue, Float rmsMapQ, Integer mapq0Reads, Float mqRankSum, Float readPositionRankSum, List<Float> genotypePriors, List<Float> genotypePosteriors, Float vqslod, String culprit, Map<String,String> attributes)
All-args constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static org.apache.avro.message.BinaryMessageDecoder<VariantCallingAnnotations>
createDecoder(org.apache.avro.message.SchemaStore resolver)
Create a new BinaryMessageDecoder instance for this class that uses the specifiedSchemaStore
.void
customDecode(org.apache.avro.io.ResolvingDecoder in)
void
customEncode(org.apache.avro.io.Encoder out)
static VariantCallingAnnotations
fromByteBuffer(ByteBuffer b)
Deserializes a VariantCallingAnnotations from a ByteBuffer.Object
get(int field$)
Map<String,String>
getAttributes()
Gets the value of the 'attributes' field.Float
getBaseQRankSum()
Gets the value of the 'baseQRankSum' field.static org.apache.avro.Schema
getClassSchema()
String
getCulprit()
Gets the value of the 'culprit' field.static org.apache.avro.message.BinaryMessageDecoder<VariantCallingAnnotations>
getDecoder()
Return the BinaryMessageDecoder instance used by this class.Boolean
getDownsampled()
Gets the value of the 'downsampled' field.static org.apache.avro.message.BinaryMessageEncoder<VariantCallingAnnotations>
getEncoder()
Return the BinaryMessageEncoder instance used by this class.Boolean
getFiltersApplied()
Gets the value of the 'filtersApplied' field.List<String>
getFiltersFailed()
Gets the value of the 'filtersFailed' field.Boolean
getFiltersPassed()
Gets the value of the 'filtersPassed' field.Float
getFisherStrandBiasPValue()
Gets the value of the 'fisherStrandBiasPValue' field.List<Float>
getGenotypePosteriors()
Gets the value of the 'genotypePosteriors' field.List<Float>
getGenotypePriors()
Gets the value of the 'genotypePriors' field.Integer
getMapq0Reads()
Gets the value of the 'mapq0Reads' field.Float
getMqRankSum()
Gets the value of the 'mqRankSum' field.Float
getReadPositionRankSum()
Gets the value of the 'readPositionRankSum' field.Float
getRmsMapQ()
Gets the value of the 'rmsMapQ' field.org.apache.avro.Schema
getSchema()
org.apache.avro.specific.SpecificData
getSpecificData()
Float
getVqslod()
Gets the value of the 'vqslod' field.protected boolean
hasCustomCoders()
static VariantCallingAnnotations.Builder
newBuilder()
Creates a new VariantCallingAnnotations RecordBuilder.static VariantCallingAnnotations.Builder
newBuilder(VariantCallingAnnotations other)
Creates a new VariantCallingAnnotations RecordBuilder by copying an existing VariantCallingAnnotations instance.static VariantCallingAnnotations.Builder
newBuilder(VariantCallingAnnotations.Builder other)
Creates a new VariantCallingAnnotations RecordBuilder by copying an existing Builder.void
put(int field$, Object value$)
void
readExternal(ObjectInput in)
void
setAttributes(Map<String,String> value)
Sets the value of the 'attributes' field.void
setBaseQRankSum(Float value)
Sets the value of the 'baseQRankSum' field.void
setCulprit(String value)
Sets the value of the 'culprit' field.void
setDownsampled(Boolean value)
Sets the value of the 'downsampled' field.void
setFiltersApplied(Boolean value)
Sets the value of the 'filtersApplied' field.void
setFiltersFailed(List<String> value)
Sets the value of the 'filtersFailed' field.void
setFiltersPassed(Boolean value)
Sets the value of the 'filtersPassed' field.void
setFisherStrandBiasPValue(Float value)
Sets the value of the 'fisherStrandBiasPValue' field.void
setGenotypePosteriors(List<Float> value)
Sets the value of the 'genotypePosteriors' field.void
setGenotypePriors(List<Float> value)
Sets the value of the 'genotypePriors' field.void
setMapq0Reads(Integer value)
Sets the value of the 'mapq0Reads' field.void
setMqRankSum(Float value)
Sets the value of the 'mqRankSum' field.void
setReadPositionRankSum(Float value)
Sets the value of the 'readPositionRankSum' field.void
setRmsMapQ(Float value)
Sets the value of the 'rmsMapQ' field.void
setVqslod(Float value)
Sets the value of the 'vqslod' field.ByteBuffer
toByteBuffer()
Serializes this VariantCallingAnnotations to a ByteBuffer.void
writeExternal(ObjectOutput out)
-
Methods inherited from class org.apache.avro.specific.SpecificRecordBase
compareTo, equals, get, getConversion, getConversion, hashCode, put, toString
-
-
-
-
Constructor Detail
-
VariantCallingAnnotations
public VariantCallingAnnotations()
Default constructor. Note that this does not initialize fields to their default values from the schema. If that is desired then one should usenewBuilder()
.
-
VariantCallingAnnotations
public VariantCallingAnnotations(Boolean filtersApplied, Boolean filtersPassed, List<String> filtersFailed, Boolean downsampled, Float baseQRankSum, Float fisherStrandBiasPValue, Float rmsMapQ, Integer mapq0Reads, Float mqRankSum, Float readPositionRankSum, List<Float> genotypePriors, List<Float> genotypePosteriors, Float vqslod, String culprit, Map<String,String> attributes)
All-args constructor.- Parameters:
filtersApplied
- True if filters were applied for this genotype call. FORMAT field "FT" any value other than the missing value.filtersPassed
- True if all filters for this genotype call passed. FORMAT field "FT" value PASS.filtersFailed
- Zero or more filters that failed for this genotype call from FORMAT field "FT".downsampled
- True if the reads covering this site were randomly downsampled to reduce coverage.baseQRankSum
- The Wilcoxon rank-sum test statistic of the base quality scores. The base quality scores are separated by whether or not the base supports the reference or the alternate allele.fisherStrandBiasPValue
- The Fisher's exact test score for the strand bias of the reference and alternate alleles. Stored as a phred scaled probability. Thus, if: a = The number of positive strand reads covering the reference allele b = The number of positive strand reads covering the alternate allele c = The number of negative strand reads covering the reference allele d = The number of negative strand reads covering the alternate allele This value takes the score: -10 log((a + b)! * (c + d)! * (a + c)! * (b + d)! / (a! b! c! d! n!) Where n = a + b + c + d.rmsMapQ
- The root mean square of the mapping qualities of reads covering this site.mapq0Reads
- The number of reads at this site with mapping quality equal to 0.mqRankSum
- The Wilcoxon rank-sum test statistic of the mapping quality scores. The mapping quality scores are separated by whether or not the read supported the reference or the alternate allele.readPositionRankSum
- The Wilcoxon rank-sum test statistic of the position of the base in the read at this site. The positions are separated by whether or not the base supports the reference or the alternate allele.genotypePriors
- The log scale prior probabilities of the various genotype states at this site. The number of elements in this array should be equal to the ploidy at this site, plus 1.genotypePosteriors
- The log scaled posterior probabilities of the various genotype states at this site, in this sample. The number of elements in this array should be equal to the ploidy at this site, plus 1.vqslod
- The log-odds ratio of being a true vs. false variant under a trained statistical model. This model can be a multivariate Gaussian mixture, support vector machine, etc.culprit
- If known, the feature that contributed the most to this variant being classified as a false variant.attributes
- Additional feature info that doesn't fit into the standard fields above. They are all encoded as (string, string) key-value pairs.
-
-
Method Detail
-
getClassSchema
public static org.apache.avro.Schema getClassSchema()
-
getEncoder
public static org.apache.avro.message.BinaryMessageEncoder<VariantCallingAnnotations> getEncoder()
Return the BinaryMessageEncoder instance used by this class.- Returns:
- the message encoder used by this class
-
getDecoder
public static org.apache.avro.message.BinaryMessageDecoder<VariantCallingAnnotations> getDecoder()
Return the BinaryMessageDecoder instance used by this class.- Returns:
- the message decoder used by this class
-
createDecoder
public static org.apache.avro.message.BinaryMessageDecoder<VariantCallingAnnotations> createDecoder(org.apache.avro.message.SchemaStore resolver)
Create a new BinaryMessageDecoder instance for this class that uses the specifiedSchemaStore
.- Parameters:
resolver
- aSchemaStore
used to find schemas by fingerprint- Returns:
- a BinaryMessageDecoder instance for this class backed by the given SchemaStore
-
toByteBuffer
public ByteBuffer toByteBuffer() throws IOException
Serializes this VariantCallingAnnotations to a ByteBuffer.- Returns:
- a buffer holding the serialized data for this instance
- Throws:
IOException
- if this instance could not be serialized
-
fromByteBuffer
public static VariantCallingAnnotations fromByteBuffer(ByteBuffer b) throws IOException
Deserializes a VariantCallingAnnotations from a ByteBuffer.- Parameters:
b
- a byte buffer holding serialized data for an instance of this class- Returns:
- a VariantCallingAnnotations instance decoded from the given buffer
- Throws:
IOException
- if the given bytes could not be deserialized into an instance of this class
-
getSpecificData
public org.apache.avro.specific.SpecificData getSpecificData()
- Overrides:
getSpecificData
in classorg.apache.avro.specific.SpecificRecordBase
-
getSchema
public org.apache.avro.Schema getSchema()
- Specified by:
getSchema
in interfaceorg.apache.avro.generic.GenericContainer
- Specified by:
getSchema
in classorg.apache.avro.specific.SpecificRecordBase
-
get
public Object get(int field$)
- Specified by:
get
in interfaceorg.apache.avro.generic.IndexedRecord
- Specified by:
get
in classorg.apache.avro.specific.SpecificRecordBase
-
put
public void put(int field$, Object value$)
- Specified by:
put
in interfaceorg.apache.avro.generic.IndexedRecord
- Specified by:
put
in classorg.apache.avro.specific.SpecificRecordBase
-
getFiltersApplied
public Boolean getFiltersApplied()
Gets the value of the 'filtersApplied' field.- Returns:
- True if filters were applied for this genotype call. FORMAT field "FT" any value other than the missing value.
-
setFiltersApplied
public void setFiltersApplied(Boolean value)
Sets the value of the 'filtersApplied' field. True if filters were applied for this genotype call. FORMAT field "FT" any value other than the missing value.- Parameters:
value
- the value to set.
-
getFiltersPassed
public Boolean getFiltersPassed()
Gets the value of the 'filtersPassed' field.- Returns:
- True if all filters for this genotype call passed. FORMAT field "FT" value PASS.
-
setFiltersPassed
public void setFiltersPassed(Boolean value)
Sets the value of the 'filtersPassed' field. True if all filters for this genotype call passed. FORMAT field "FT" value PASS.- Parameters:
value
- the value to set.
-
getFiltersFailed
public List<String> getFiltersFailed()
Gets the value of the 'filtersFailed' field.- Returns:
- Zero or more filters that failed for this genotype call from FORMAT field "FT".
-
setFiltersFailed
public void setFiltersFailed(List<String> value)
Sets the value of the 'filtersFailed' field. Zero or more filters that failed for this genotype call from FORMAT field "FT".- Parameters:
value
- the value to set.
-
getDownsampled
public Boolean getDownsampled()
Gets the value of the 'downsampled' field.- Returns:
- True if the reads covering this site were randomly downsampled to reduce coverage.
-
setDownsampled
public void setDownsampled(Boolean value)
Sets the value of the 'downsampled' field. True if the reads covering this site were randomly downsampled to reduce coverage.- Parameters:
value
- the value to set.
-
getBaseQRankSum
public Float getBaseQRankSum()
Gets the value of the 'baseQRankSum' field.- Returns:
- The Wilcoxon rank-sum test statistic of the base quality scores. The base quality scores are separated by whether or not the base supports the reference or the alternate allele.
-
setBaseQRankSum
public void setBaseQRankSum(Float value)
Sets the value of the 'baseQRankSum' field. The Wilcoxon rank-sum test statistic of the base quality scores. The base quality scores are separated by whether or not the base supports the reference or the alternate allele.- Parameters:
value
- the value to set.
-
getFisherStrandBiasPValue
public Float getFisherStrandBiasPValue()
Gets the value of the 'fisherStrandBiasPValue' field.- Returns:
- The Fisher's exact test score for the strand bias of the reference and alternate alleles. Stored as a phred scaled probability. Thus, if: a = The number of positive strand reads covering the reference allele b = The number of positive strand reads covering the alternate allele c = The number of negative strand reads covering the reference allele d = The number of negative strand reads covering the alternate allele This value takes the score: -10 log((a + b)! * (c + d)! * (a + c)! * (b + d)! / (a! b! c! d! n!) Where n = a + b + c + d.
-
setFisherStrandBiasPValue
public void setFisherStrandBiasPValue(Float value)
Sets the value of the 'fisherStrandBiasPValue' field. The Fisher's exact test score for the strand bias of the reference and alternate alleles. Stored as a phred scaled probability. Thus, if: a = The number of positive strand reads covering the reference allele b = The number of positive strand reads covering the alternate allele c = The number of negative strand reads covering the reference allele d = The number of negative strand reads covering the alternate allele This value takes the score: -10 log((a + b)! * (c + d)! * (a + c)! * (b + d)! / (a! b! c! d! n!) Where n = a + b + c + d.- Parameters:
value
- the value to set.
-
getRmsMapQ
public Float getRmsMapQ()
Gets the value of the 'rmsMapQ' field.- Returns:
- The root mean square of the mapping qualities of reads covering this site.
-
setRmsMapQ
public void setRmsMapQ(Float value)
Sets the value of the 'rmsMapQ' field. The root mean square of the mapping qualities of reads covering this site.- Parameters:
value
- the value to set.
-
getMapq0Reads
public Integer getMapq0Reads()
Gets the value of the 'mapq0Reads' field.- Returns:
- The number of reads at this site with mapping quality equal to 0.
-
setMapq0Reads
public void setMapq0Reads(Integer value)
Sets the value of the 'mapq0Reads' field. The number of reads at this site with mapping quality equal to 0.- Parameters:
value
- the value to set.
-
getMqRankSum
public Float getMqRankSum()
Gets the value of the 'mqRankSum' field.- Returns:
- The Wilcoxon rank-sum test statistic of the mapping quality scores. The mapping quality scores are separated by whether or not the read supported the reference or the alternate allele.
-
setMqRankSum
public void setMqRankSum(Float value)
Sets the value of the 'mqRankSum' field. The Wilcoxon rank-sum test statistic of the mapping quality scores. The mapping quality scores are separated by whether or not the read supported the reference or the alternate allele.- Parameters:
value
- the value to set.
-
getReadPositionRankSum
public Float getReadPositionRankSum()
Gets the value of the 'readPositionRankSum' field.- Returns:
- The Wilcoxon rank-sum test statistic of the position of the base in the read at this site. The positions are separated by whether or not the base supports the reference or the alternate allele.
-
setReadPositionRankSum
public void setReadPositionRankSum(Float value)
Sets the value of the 'readPositionRankSum' field. The Wilcoxon rank-sum test statistic of the position of the base in the read at this site. The positions are separated by whether or not the base supports the reference or the alternate allele.- Parameters:
value
- the value to set.
-
getGenotypePriors
public List<Float> getGenotypePriors()
Gets the value of the 'genotypePriors' field.- Returns:
- The log scale prior probabilities of the various genotype states at this site. The number of elements in this array should be equal to the ploidy at this site, plus 1.
-
setGenotypePriors
public void setGenotypePriors(List<Float> value)
Sets the value of the 'genotypePriors' field. The log scale prior probabilities of the various genotype states at this site. The number of elements in this array should be equal to the ploidy at this site, plus 1.- Parameters:
value
- the value to set.
-
getGenotypePosteriors
public List<Float> getGenotypePosteriors()
Gets the value of the 'genotypePosteriors' field.- Returns:
- The log scaled posterior probabilities of the various genotype states at this site, in this sample. The number of elements in this array should be equal to the ploidy at this site, plus 1.
-
setGenotypePosteriors
public void setGenotypePosteriors(List<Float> value)
Sets the value of the 'genotypePosteriors' field. The log scaled posterior probabilities of the various genotype states at this site, in this sample. The number of elements in this array should be equal to the ploidy at this site, plus 1.- Parameters:
value
- the value to set.
-
getVqslod
public Float getVqslod()
Gets the value of the 'vqslod' field.- Returns:
- The log-odds ratio of being a true vs. false variant under a trained statistical model. This model can be a multivariate Gaussian mixture, support vector machine, etc.
-
setVqslod
public void setVqslod(Float value)
Sets the value of the 'vqslod' field. The log-odds ratio of being a true vs. false variant under a trained statistical model. This model can be a multivariate Gaussian mixture, support vector machine, etc.- Parameters:
value
- the value to set.
-
getCulprit
public String getCulprit()
Gets the value of the 'culprit' field.- Returns:
- If known, the feature that contributed the most to this variant being classified as a false variant.
-
setCulprit
public void setCulprit(String value)
Sets the value of the 'culprit' field. If known, the feature that contributed the most to this variant being classified as a false variant.- Parameters:
value
- the value to set.
-
getAttributes
public Map<String,String> getAttributes()
Gets the value of the 'attributes' field.- Returns:
- Additional feature info that doesn't fit into the standard fields above. They are all encoded as (string, string) key-value pairs.
-
setAttributes
public void setAttributes(Map<String,String> value)
Sets the value of the 'attributes' field. Additional feature info that doesn't fit into the standard fields above. They are all encoded as (string, string) key-value pairs.- Parameters:
value
- the value to set.
-
newBuilder
public static VariantCallingAnnotations.Builder newBuilder()
Creates a new VariantCallingAnnotations RecordBuilder.- Returns:
- A new VariantCallingAnnotations RecordBuilder
-
newBuilder
public static VariantCallingAnnotations.Builder newBuilder(VariantCallingAnnotations.Builder other)
Creates a new VariantCallingAnnotations RecordBuilder by copying an existing Builder.- Parameters:
other
- The existing builder to copy.- Returns:
- A new VariantCallingAnnotations RecordBuilder
-
newBuilder
public static VariantCallingAnnotations.Builder newBuilder(VariantCallingAnnotations other)
Creates a new VariantCallingAnnotations RecordBuilder by copying an existing VariantCallingAnnotations instance.- Parameters:
other
- The existing instance to copy.- Returns:
- A new VariantCallingAnnotations RecordBuilder
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Overrides:
writeExternal
in classorg.apache.avro.specific.SpecificRecordBase
- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException
- Specified by:
readExternal
in interfaceExternalizable
- Overrides:
readExternal
in classorg.apache.avro.specific.SpecificRecordBase
- Throws:
IOException
-
hasCustomCoders
protected boolean hasCustomCoders()
- Overrides:
hasCustomCoders
in classorg.apache.avro.specific.SpecificRecordBase
-
customEncode
public void customEncode(org.apache.avro.io.Encoder out) throws IOException
- Overrides:
customEncode
in classorg.apache.avro.specific.SpecificRecordBase
- Throws:
IOException
-
customDecode
public void customDecode(org.apache.avro.io.ResolvingDecoder in) throws IOException
- Overrides:
customDecode
in classorg.apache.avro.specific.SpecificRecordBase
- Throws:
IOException
-
-