Package htsjdk.variant.vcf
Class VCFCompoundHeaderLine
- java.lang.Object
-
- htsjdk.variant.vcf.VCFHeaderLine
-
- htsjdk.variant.vcf.VCFCompoundHeaderLine
-
- All Implemented Interfaces:
VCFIDHeaderLine
,Serializable
,Comparable
- Direct Known Subclasses:
VCFFormatHeaderLine
,VCFInfoHeaderLine
public abstract class VCFCompoundHeaderLine extends VCFHeaderLine implements VCFIDHeaderLine
a base class for compound header lines, which include info lines and format lines (so far)- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VCFCompoundHeaderLine.SupportedHeaderLineType
-
Field Summary
-
Fields inherited from class htsjdk.variant.vcf.VCFHeaderLine
ALLOW_UNBOUND_DESCRIPTIONS, serialVersionUID, UNBOUND_DESCRIPTION
-
-
Constructor Summary
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
returns true if we're equal to another compound header lineboolean
equalsExcludingDescription(VCFCompoundHeaderLine other)
int
getCount()
int
getCount(VariantContext vc)
Get the number of values expected for this header field, given the properties of VariantContext vc If the count is a fixed count, return that.VCFHeaderLineCount
getCountType()
String
getDescription()
String
getID()
String
getSource()
VCFHeaderLineType
getType()
String
getVersion()
int
hashCode()
boolean
isFixedCount()
boolean
sameLineTypeAndName(VCFCompoundHeaderLine other)
void
setNumberToUnbounded()
void
setSource(String source)
Specify annotation sourcevoid
setVersion(String version)
Specify annotation versionprotected String
toStringEncoding()
make a string representation of this header line-
Methods inherited from class htsjdk.variant.vcf.VCFHeaderLine
compareTo, getKey, getValue, isHeaderLine, shouldBeAddedToDictionary, toString, toStringEncoding
-
-
-
-
Constructor Detail
-
VCFCompoundHeaderLine
protected VCFCompoundHeaderLine(String name, int count, VCFHeaderLineType type, String description, VCFCompoundHeaderLine.SupportedHeaderLineType lineType)
create a VCF format header line- Parameters:
name
- the name for this header linecount
- the count for this header linetype
- the type for this header linedescription
- the description for this header linelineType
- the header line type
-
VCFCompoundHeaderLine
protected VCFCompoundHeaderLine(String name, VCFHeaderLineCount count, VCFHeaderLineType type, String description, VCFCompoundHeaderLine.SupportedHeaderLineType lineType)
create a VCF format header line- Parameters:
name
- the name for this header linecount
- the count type for this header linetype
- the type for this header linedescription
- the description for this header linelineType
- the header line type
-
VCFCompoundHeaderLine
protected VCFCompoundHeaderLine(String name, int count, VCFHeaderLineType type, String description, VCFCompoundHeaderLine.SupportedHeaderLineType lineType, String source, String version)
create a VCF format header line- Parameters:
name
- the name for this header linecount
- the count for this header linetype
- the type for this header linedescription
- the description for this header linelineType
- the header line typesource
- annotation source (case-insensitive, e.g. "dbsnp")version
- exact version (e.g. "138")
-
VCFCompoundHeaderLine
protected VCFCompoundHeaderLine(String name, VCFHeaderLineCount count, VCFHeaderLineType type, String description, VCFCompoundHeaderLine.SupportedHeaderLineType lineType, String source, String version)
create a VCF format header line- Parameters:
name
- the name for this header linecount
- the count type for this header linetype
- the type for this header linedescription
- the description for this header linelineType
- the header line typesource
- annotation source (case-insensitive, e.g. "dbsnp")version
- exact version (e.g. "138")
-
VCFCompoundHeaderLine
protected VCFCompoundHeaderLine(String line, VCFHeaderVersion version, VCFCompoundHeaderLine.SupportedHeaderLineType lineType)
create a VCF format header line- Parameters:
line
- the header lineversion
- the VCF header versionlineType
- the header line type
-
-
Method Detail
-
getID
public String getID()
- Specified by:
getID
in interfaceVCFIDHeaderLine
-
getDescription
public String getDescription()
-
getType
public VCFHeaderLineType getType()
-
getCountType
public VCFHeaderLineCount getCountType()
-
isFixedCount
public boolean isFixedCount()
-
getCount
public int getCount()
-
getSource
public String getSource()
-
getVersion
public String getVersion()
-
getCount
public int getCount(VariantContext vc)
Get the number of values expected for this header field, given the properties of VariantContext vc If the count is a fixed count, return that. For example, a field with size of 1 in the header returns 1 If the count is of type A, return vc.getNAlleles - 1 If the count is of type R, return vc.getNAlleles If the count is of type G, return the expected number of genotypes given the number of alleles in VC and the max ploidy among all samples. Note that if the max ploidy of the VC is 0 (there's no GT information at all, then implicitly assume diploid samples when computing G values. If the count is UNBOUNDED return -1- Parameters:
vc
-- Returns:
-
setNumberToUnbounded
public void setNumberToUnbounded()
-
toStringEncoding
protected String toStringEncoding()
make a string representation of this header line- Overrides:
toStringEncoding
in classVCFHeaderLine
- Returns:
- a string representation
-
equals
public boolean equals(Object o)
returns true if we're equal to another compound header line- Overrides:
equals
in classVCFHeaderLine
- Parameters:
o
- a compound header line- Returns:
- true if equal
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classVCFHeaderLine
-
equalsExcludingDescription
public boolean equalsExcludingDescription(VCFCompoundHeaderLine other)
-
sameLineTypeAndName
public boolean sameLineTypeAndName(VCFCompoundHeaderLine other)
-
setSource
public void setSource(String source)
Specify annotation sourceThis value is optional starting with VCFv4.2.
- Parameters:
source
- annotation source (case-insensitive, e.g. "dbsnp")
-
setVersion
public void setVersion(String version)
Specify annotation versionThis value is optional starting with VCFv4.2.
- Parameters:
version
- exact version (e.g. "138")
-
-