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 line
`VCFContigHeaderLine(Map<String,String> mapping, int contigIndex)`

## Method Summary

Modifier and Type
Method
Description
`int`
`compareTo(Object other)`
IT IS CRITICAL THAT THIS BE OVERRIDDEN SO WE SORT THE CONTIGS IN THE CORRECT ORDER
`boolean`
`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`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### VCFContigHeaderLine

public VCFContigHeaderLine(String line, VCFHeaderVersion version, String key, int contigIndex)
create a VCF contig header line

Parameters:
  `line` - the header line
  `version` - the vcf header version
  `key` - the key for this header line

### VCFContigHeaderLine

public VCFContigHeaderLine(Map<String,String> mapping, int contigIndex)

## Method Details

### 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 class `VCFSimpleHeaderLine`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `VCFSimpleHeaderLine`

### 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 interface `Comparable`
Overrides:
  `compareTo` in class `VCFHeaderLine`