Class BCF2FieldWriterManager


  • public class BCF2FieldWriterManager
    extends Object
    See #BCFWriter for documentation on this classes role in encoding BCF2 files
    Since:
    06/12
    • Constructor Detail

      • BCF2FieldWriterManager

        public BCF2FieldWriterManager()
    • Method Detail

      • setup

        public void setup​(VCFHeader header,
                          BCF2Encoder encoder,
                          Map<String,​Integer> stringDictionary)
        Setup the FieldWriters appropriate to each INFO and FORMAT in the VCF header Must be called before any of the getter methods will work
        Parameters:
        header - a VCFHeader containing description for every INFO and FORMAT field we'll attempt to write out to BCF
        encoder - the encoder we are going to use to write out the BCF2 data
        stringDictionary - a map from VCFHeader strings to their offsets for encoding
      • getSiteFieldWriter

        public BCF2FieldWriter.SiteWriter getSiteFieldWriter​(String field)
        Get a site writer specialized to encode values for site info field
        Parameters:
        field - key found in the VCF header INFO records
        Returns:
        non-null writer if one can be found, or null if none exists for field
      • getGenotypeFieldWriter

        public BCF2FieldWriter.GenotypesWriter getGenotypeFieldWriter​(String field)
        Get a genotypes writer specialized to encode values for genotypes field
        Parameters:
        field - key found in the VCF header FORMAT records
        Returns:
        non-null writer if one can be found, or null if none exists for field
      • getWriter

        public <T> T getWriter​(String key,
                               Map<String,​T> map)