Class VcfHeader

java.lang.Object
org.snpeff.vcf.VcfHeader
All Implemented Interfaces:
Serializable

public class VcfHeader extends Object implements Serializable
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
See Also:
  • Field Details

  • Constructor Details

    • VcfHeader

      public VcfHeader()
  • Method Details

    • isFormatLine

      public static boolean isFormatLine(String line)
    • isInfoLine

      public static boolean isInfoLine(String line)
    • add

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

      public void add(VcfHeaderEntry vcfHeader)
      Add header line
    • 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(String newHeaderLine)
      Add line to header (can add many lines)
    • getLines

      public String[] getLines()
    • getNumberOfSamples

      public int getNumberOfSamples()
      Number of samples
    • getPedigree

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

      public List<String> getSampleNames()
      Get sample names
    • getSampleNum

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

      public Collection<VcfHeaderFormat> getVcfHeaderFormat()
    • getVcfHeaderFormat

      public VcfHeaderFormat getVcfHeaderFormat(String id)
    • getVcfHeaderInfo

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

      public VcfHeaderInfo getVcfHeaderInfo(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 List<String> parseSampleNames()
    • parseSampleNum

      protected void parseSampleNum()
    • remove

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

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

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