Class MemoryMappedVcfLineParser

java.lang.Object
org.pharmgkb.parser.vcf.MemoryMappedVcfLineParser
All Implemented Interfaces:
VcfLineParser

public class MemoryMappedVcfLineParser extends Object implements VcfLineParser
A simple VcfLineParser that loads an entire VCF file into memory to permit constant-time lookup for VCF records, either:
  • By any ID listed in the ID field, or
  • By chromosome and position

This implementation is memory-intensive and should only be used for short VCF files where repeated arbitrary (random) access to VCF records is required.

By default, an IllegalArgumentException is thrown each time a duplicate ID or locus is found. To change this behavior, see MemoryMappedVcfLineParser.Builder.setDuplicateLocusHandler(org.pharmgkb.parser.vcf.MemoryMappedVcfLineParser.DuplicateHandler) and MemoryMappedVcfLineParser.Builder.setDuplicateLocusHandler(org.pharmgkb.parser.vcf.MemoryMappedVcfLineParser.DuplicateHandler).