Package org.snpeff.vcf
Class VcfHeader
- java.lang.Object
-
- org.snpeff.vcf.VcfHeader
-
public class VcfHeader extends java.lang.ObjectRepresents the header of a vcf file. References: http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41- Author:
- pablocingolani
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCHROM_PREFIXstatic java.lang.StringFORMAT_PREFIXstatic java.lang.StringINFO_PREFIXstatic java.lang.StringPEDIGREE_PREFIX
-
Constructor Summary
Constructors Constructor Description VcfHeader()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(VcfHeader newVcfHeader)Add all missing lines from 'vcfHeader'voidadd(VcfHeaderEntry vcfHeader)Add header linevoidaddFormat(VcfHeaderFormat vcfFormat)Add a 'FORMAT' meta infovoidaddInfo(VcfHeaderInfo vcfInfo)Add a VCF INFO header definitionvoidaddLine(java.lang.String newHeaderLine)Add line to header (can add many lines)java.lang.String[]getLines()intgetNumberOfSamples()Number of samplesjava.util.List<PedigreeEntry>getPedigree()Get pedigree (if any)java.util.List<java.lang.String>getSampleNames()Get sample namesintgetSampleNum(java.lang.String sameplName)Sample number (position in "#CHROM" line)java.util.Collection<VcfHeaderFormat>getVcfHeaderFormat()VcfHeaderFormatgetVcfHeaderFormat(java.lang.String id)java.util.Collection<VcfHeaderInfo>getVcfHeaderInfo()Get all VcfInfo entriesVcfHeaderInfogetVcfHeaderInfo(java.lang.String id)Get Info type for a given IDbooleanhasFormat(VcfHeaderFormat vcfFormat)Do we already have this 'format' entry?booleanhasInfo(VcfHeaderInfo vcfInfo)Do we already have this 'info' header?static booleanisFormatLine(java.lang.String line)static booleanisInfoLine(java.lang.String line)voidparse()Parse header linesprotected java.util.List<java.lang.String>parseSampleNames()protected voidparseSampleNum()voidremove(java.lang.String linePrefix)Remove header line starting with a prefixvoidremoveInfo(java.lang.String infoId)Remove header line matching an INFO fieldjava.lang.StringtoString()Get header information
-
-
-
Field Detail
-
INFO_PREFIX
public static final java.lang.String INFO_PREFIX
- See Also:
- Constant Field Values
-
FORMAT_PREFIX
public static final java.lang.String FORMAT_PREFIX
- See Also:
- Constant Field Values
-
PEDIGREE_PREFIX
public static final java.lang.String PEDIGREE_PREFIX
- See Also:
- Constant Field Values
-
CHROM_PREFIX
public static final java.lang.String CHROM_PREFIX
- See Also:
- Constant Field Values
-
-
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'
-
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(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:
toStringin classjava.lang.Object
-
-