Class VCFHeader

    • Constructor Detail

      • VCFHeader

        public VCFHeader()
        Create an empty VCF header with no header lines and no samples
      • VCFHeader

        public VCFHeader​(Set<VCFHeaderLine> metaData)
        create a VCF header, given a list of meta data and auxiliary tags
        Parameters:
        metaData - the meta data associated with this header
      • VCFHeader

        public VCFHeader​(VCFHeader toCopy)
        Creates a deep copy of the given VCFHeader, duplicating all its metadata and sample names.
      • VCFHeader

        public VCFHeader​(Set<VCFHeaderLine> metaData,
                         Set<String> genotypeSampleNames)
        create a VCF header, given a list of meta data and auxillary tags
        Parameters:
        metaData - the meta data associated with this header
        genotypeSampleNames - the sample names
    • Method Detail

      • addMetaDataLine

        public void addMetaDataLine​(VCFHeaderLine headerLine)
        Adds a new line to the VCFHeader. If there is an existing header line of the same type with the same key, the new line is not added and the existing line is preserved.
        Parameters:
        headerLine - header line to attempt to add
      • getContigLines

        public List<VCFContigHeaderLine> getContigLines()
        Returns:
        all of the VCF header lines of the ##contig form in order, or an empty list if none were present
      • getSequenceDictionary

        public SAMSequenceDictionary getSequenceDictionary()
        Returns the contigs in this VCF file as a SAMSequenceDictionary. Returns null if contigs lines are not present in the header. Throws SAMException if one or more contig lines do not have length information.
      • setSequenceDictionary

        public void setSequenceDictionary​(SAMSequenceDictionary dictionary)
        Completely replaces the contig records in this header with those in the given SAMSequenceDictionary.
      • getFilterLines

        public List<VCFFilterHeaderLine> getFilterLines()
        Returns:
        all of the VCF FILTER lines in their original file order, or an empty list if none were present
      • getIDHeaderLines

        public List<VCFIDHeaderLine> getIDHeaderLines()
        Returns:
        all of the VCF ID-based header lines in their original file order, or an empty list if none were present
      • getHeaderFields

        public Set<VCFHeader.HEADER_FIELDS> getHeaderFields()
        get the header fields in order they're presented in the input file (which is now required to be the order presented in the spec).
        Returns:
        a set of the header fields, in order
      • getMetaDataInInputOrder

        public Set<VCFHeaderLine> getMetaDataInInputOrder()
        get the meta data, associated with this header, in sorted order
        Returns:
        a set of the meta data
      • getMetaDataInSortedOrder

        public Set<VCFHeaderLine> getMetaDataInSortedOrder()
      • getMetaDataLine

        public VCFHeaderLine getMetaDataLine​(String key)
        Get the VCFHeaderLine whose key equals key. Returns null if no such line exists
        Parameters:
        key -
        Returns:
      • getGenotypeSamples

        public List<String> getGenotypeSamples()
        get the genotyping sample names
        Returns:
        a list of the genotype column names, which may be empty if hasGenotypingData() returns false
      • getNGenotypeSamples

        public int getNGenotypeSamples()
      • hasGenotypingData

        public boolean hasGenotypingData()
        do we have genotyping data?
        Returns:
        true if we have genotyping columns, false otherwise
      • samplesWereAlreadySorted

        public boolean samplesWereAlreadySorted()
        were the input samples sorted originally?
        Returns:
        true if the input samples were sorted originally, false otherwise
      • getColumnCount

        public int getColumnCount()
        Returns:
        the column count
      • getInfoHeaderLines

        public Collection<VCFInfoHeaderLine> getInfoHeaderLines()
        Returns the INFO HeaderLines in their original ordering
      • getInfoHeaderLine

        public VCFInfoHeaderLine getInfoHeaderLine​(String id)
        Parameters:
        id - the header key name
        Returns:
        the meta data line, or null if there is none
      • getFormatHeaderLine

        public VCFFormatHeaderLine getFormatHeaderLine​(String id)
        Parameters:
        id - the header key name
        Returns:
        the meta data line, or null if there is none
      • getFilterHeaderLine

        public VCFFilterHeaderLine getFilterHeaderLine​(String id)
        Parameters:
        id - the header key name
        Returns:
        the meta data line, or null if there is none
      • hasInfoLine

        public boolean hasInfoLine​(String id)
      • hasFormatLine

        public boolean hasFormatLine​(String id)
      • hasFilterLine

        public boolean hasFilterLine​(String id)
      • getOtherHeaderLine

        public VCFHeaderLine getOtherHeaderLine​(String key)
        Parameters:
        key - the header key name
        Returns:
        the meta data line, or null if there is none
      • getOtherHeaderLines

        public Collection<VCFHeaderLine> getOtherHeaderLines()
        Returns the other HeaderLines in their original ordering
      • isWriteEngineHeaders

        public boolean isWriteEngineHeaders()
        If true additional engine headers will be written to the VCF, otherwise only the walker headers will be output.
        Returns:
        true if additional engine headers will be written to the VCF
      • setWriteEngineHeaders

        public void setWriteEngineHeaders​(boolean writeEngineHeaders)
        If true additional engine headers will be written to the VCF, otherwise only the walker headers will be output.
        Parameters:
        writeEngineHeaders - true if additional engine headers will be written to the VCF
      • isWriteCommandLine

        public boolean isWriteCommandLine()
        If true, and isWriteEngineHeaders also returns true, the command line will be written to the VCF.
        Returns:
        true if the command line will be written to the VCF
      • setWriteCommandLine

        public void setWriteCommandLine​(boolean writeCommandLine)
        If true, and isWriteEngineHeaders also returns true, the command line will be written to the VCF.
        Parameters:
        writeCommandLine - true if the command line will be written to the VCF