Class VcfHeader


  • public class VcfHeader
    extends java.lang.Object
    Represents the header of a vcf file. References: http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41
    Author:
    pablocingolani
    • Constructor Detail

      • VcfHeader

        public VcfHeader()
    • Method Detail

      • isFormatLine

        public static boolean isFormatLine​(java.lang.String line)
      • isInfoLine

        public static boolean isInfoLine​(java.lang.String line)
      • add

        public void add​(VcfHeader newVcfHeader)
        Add all missing lines from 'vcfHeader'
      • addFormat

        public void addFormat​(VcfHeaderFormat vcfFormat)
        Add a 'FORMAT' meta info
      • addInfo

        public void addInfo​(VcfHeaderInfo vcfInfo)
        Add a VCF INFO header definition
      • addLine

        public void addLine​(java.lang.String newHeaderLine)
        Add line to header (can add many lines)
      • getLines

        public java.lang.String[] getLines()
      • getNumberOfSamples

        public int getNumberOfSamples()
        Number of samples
      • getPedigree

        public java.util.List<PedigreeEntry> getPedigree()
        Get pedigree (if any)
      • getSampleNames

        public java.util.List<java.lang.String> getSampleNames()
        Get sample names
      • getSampleNum

        public int getSampleNum​(java.lang.String sameplName)
        Sample number (position in "#CHROM" line)
        Returns:
        -1 if not found
      • getVcfHeaderFormat

        public java.util.Collection<VcfHeaderFormat> getVcfHeaderFormat()
      • getVcfHeaderFormat

        public VcfHeaderFormat getVcfHeaderFormat​(java.lang.String id)
      • getVcfHeaderInfo

        public java.util.Collection<VcfHeaderInfo> getVcfHeaderInfo()
        Get all VcfInfo entries
      • getVcfHeaderInfo

        public VcfHeaderInfo getVcfHeaderInfo​(java.lang.String id)
        Get Info type for a given ID
      • hasFormat

        public boolean hasFormat​(VcfHeaderFormat vcfFormat)
        Do we already have this 'format' entry?
      • hasInfo

        public boolean hasInfo​(VcfHeaderInfo vcfInfo)
        Do we already have this 'info' header?
      • parse

        public void parse()
        Parse header lines
      • parseSampleNames

        protected java.util.List<java.lang.String> parseSampleNames()
      • parseSampleNum

        protected void parseSampleNum()
      • remove

        public void remove​(java.lang.String linePrefix)
        Remove header line starting with a prefix
      • removeInfo

        public void removeInfo​(java.lang.String infoId)
        Remove header line matching an INFO field
      • toString

        public java.lang.String toString()
        Get header information
        Overrides:
        toString in class java.lang.Object