Package htsjdk.variant.vcf
Class VCFContigHeaderLine
- java.lang.Object
-
- htsjdk.variant.vcf.VCFHeaderLine
-
- htsjdk.variant.vcf.VCFSimpleHeaderLine
-
- htsjdk.variant.vcf.VCFContigHeaderLine
-
- All Implemented Interfaces:
VCFIDHeaderLine
,Serializable
,Comparable
public class VCFContigHeaderLine extends VCFSimpleHeaderLine
A special class representing a contig VCF header line. Knows the true contig order and sorts on that Note: this class has a natural ordering that is inconsistent with equals()- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class htsjdk.variant.vcf.VCFSimpleHeaderLine
DESCRIPTION_ATTRIBUTE, ID_ATTRIBUTE
-
Fields inherited from class htsjdk.variant.vcf.VCFHeaderLine
ALLOW_UNBOUND_DESCRIPTIONS, serialVersionUID, UNBOUND_DESCRIPTION
-
-
Constructor Summary
Constructors Constructor Description VCFContigHeaderLine(String line, VCFHeaderVersion version, String key, int contigIndex)
create a VCF contig header lineVCFContigHeaderLine(Map<String,String> mapping, int contigIndex)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Object other)
IT IS CRITICAL THAT THIS BE OVERRIDDEN SO WE SORT THE CONTIGS IN THE CORRECT ORDERboolean
equals(Object o)
Integer
getContigIndex()
SAMSequenceRecord
getSAMSequenceRecord()
Get the SAMSequenceRecord that corresponds to this VCF header line.int
hashCode()
-
Methods inherited from class htsjdk.variant.vcf.VCFSimpleHeaderLine
getGenericFields, getID, initialize, toStringEncoding
-
Methods inherited from class htsjdk.variant.vcf.VCFHeaderLine
getKey, getValue, isHeaderLine, shouldBeAddedToDictionary, toString, toStringEncoding
-
-
-
-
Constructor Detail
-
VCFContigHeaderLine
public VCFContigHeaderLine(String line, VCFHeaderVersion version, String key, int contigIndex)
create a VCF contig header line- Parameters:
line
- the header lineversion
- the vcf header versionkey
- the key for this header line
-
-
Method Detail
-
getContigIndex
public Integer getContigIndex()
-
getSAMSequenceRecord
public SAMSequenceRecord getSAMSequenceRecord()
Get the SAMSequenceRecord that corresponds to this VCF header line. If the VCF header line does not have a length tag, the SAMSequenceRecord returned will be set to have a length of SAMSequenceRecord.UNKNOWN_SEQUENCE_LENGTH. Records with unknown length will match any record with the same name when evaluated by SAMSequenceRecord.isSameSequence.- Returns:
- The SAMSequenceRecord containing the ID, length, assembly, and index of this contig. Returns null if the contig header line does not have a length.
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classVCFSimpleHeaderLine
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classVCFSimpleHeaderLine
-
compareTo
public int compareTo(Object other)
IT IS CRITICAL THAT THIS BE OVERRIDDEN SO WE SORT THE CONTIGS IN THE CORRECT ORDER- Specified by:
compareTo
in interfaceComparable
- Overrides:
compareTo
in classVCFHeaderLine
-
-