Package org.snpeff.vcf

# 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:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`CHROM_PREFIX`
`static final String`
`FORMAT_PREFIX`
`static final String`
`INFO_PREFIX`
`static final String`
`PEDIGREE_PREFIX`

## Constructor Summary

Constructors
Constructor
Description
`VcfHeader()`

## Method Summary

Modifier and Type
Method
Description
`void`
`add(VcfHeader newVcfHeader)`
Add all missing lines from 'vcfHeader'
`void`
`add(VcfHeaderEntry vcfHeader)`
Add header line
`void`
`addFormat(VcfHeaderFormat vcfFormat)`
Add a 'FORMAT' meta info
`void`
`addInfo(VcfHeaderInfo vcfInfo)`
Add a VCF INFO header definition
`void`
`addLine(String newHeaderLine)`
Add line to header (can add many lines)
`String[]`
`getLines()`
`int`
`getNumberOfSamples()`
Number of samples
`List<PedigreeEntry>`
`getPedigree()`
Get pedigree (if any)
`List<String>`
`getSampleNames()`
Get sample names
`int`
`getSampleNum(String sameplName)`
Sample number (position in "#CHROM" line)
`Collection<VcfHeaderFormat>`
`getVcfHeaderFormat()`
`VcfHeaderFormat`
`getVcfHeaderFormat(String id)`
`Collection<VcfHeaderInfo>`
`getVcfHeaderInfo()`
Get all VcfInfo entries
`VcfHeaderInfo`
`getVcfHeaderInfo(String id)`
Get Info type for a given ID
`boolean`
`hasFormat(VcfHeaderFormat vcfFormat)`
Do we already have this 'format' entry?
`boolean`
`hasInfo(VcfHeaderInfo vcfInfo)`
Do we already have this 'info' header?
`static boolean`
`isFormatLine(String line)`
`static boolean`
`isInfoLine(String line)`
`void`
`parse()`
Parse header lines
`protected List<String>`
`parseSampleNames()`
`protected void`
`parseSampleNum()`
`void`
`remove(String linePrefix)`
Remove header line starting with a prefix
`void`
`removeInfo(String infoId)`
Remove header line matching an INFO field
`String`
`toString()`
Get header information

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

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

## Field Details

### INFO_PREFIX

public static final String INFO_PREFIX

See Also:
  - Constant Field Values

### FORMAT_PREFIX

public static final String FORMAT_PREFIX

See Also:
  - Constant Field Values

### PEDIGREE_PREFIX

public static final String PEDIGREE_PREFIX

See Also:
  - Constant Field Values

### CHROM_PREFIX

public static final String CHROM_PREFIX

See Also:
  - Constant Field Values

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