Class 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:
  • 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