Package org.pharmgkb.parser.vcf
Class VcfParser
java.lang.Object
org.pharmgkb.parser.vcf.VcfParser
- All Implemented Interfaces:
Closeable,AutoCloseable
This class parses a VCF file.
-
Nested Class Summary
Nested Classes -
Method Summary
-
Method Details
-
parseMetadata
Parses metadata only. This method should be if only the metadata is needed; otherwise,parse()is preferred.- Throws:
IOException
-
getMetadata
Gets VCF metadata (if it has already been parsed). -
parse
Parses the entire VCF file (including the metadata).This is the preferred way to read a VCF file.
- Throws:
IOException
-
parseNextLine
Parses just the next data line available, also reading all the metadata if it has not been read. This is a specialized method; in general callingparse()to parse the entire stream is preferred.- Returns:
- Whether another line may be available to read; false only if and only if this is the last line available
- Throws:
IllegalStateException- If the stream was already fully parsedVcfFormatException- If a VCF formatting error is foundIOException
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getLineNumber
public int getLineNumber()
-