Class HtsCodecRegistry

java.lang.Object
htsjdk.beta.plugin.registry.HtsCodecRegistry

public class HtsCodecRegistry extends Object
A registry for tracking HtsCodec instances.

Registries are populated with HtsCodec objects that are either discovered and registered statically in the HtsDefaultRegistry, or manually registered in a private registry (see createPrivateRegistry()) via the registerCodec(HtsCodec) method. The global static HtsDefaultRegistry is immutable. A private, mutable registry for registering custom codecs can be created with createPrivateRegistry().

  • Constructor Details

    • HtsCodecRegistry

      protected HtsCodecRegistry()
      Create a registry. Protected to prevent use outside of the registry package. To create a private registry from outside the registry package, use createPrivateRegistry().
  • Method Details

    • registerCodec

      public HtsCodec<?,?> registerCodec(HtsCodec<?,?> codec)
      Add a codec to the registry. If a codec that supports the same (format, version) (determined by HtsCodec.getFileFormat() and HtsCodec.getVersion() methods) is already registered, the new registry is updated to contain the new codec, and the previously registered codec is returned.
      Parameters:
      codec - the codec to be added
      Returns:
      a previously registered codec with the same (format, version), or null if no codec was previously registered
    • createPrivateRegistry

      public static HtsCodecRegistry createPrivateRegistry()
      Create a mutable registry for private use. The HtsDefaultRegistry is immutable, but a private registry can be populated with, and used to resolve against, custom codecs. A private registry is initially populated with all codecs that are registered in the HtsDefaultRegistry. Custom codecs can be then be installed into the private registry using registerCodec(HtsCodec).
      Returns:
      a mutable registry instance for private use
    • getHaploidReferenceResolver

      public HaploidReferenceResolver getHaploidReferenceResolver()
      Get the HaploidReferenceResolver for this registry.
      Returns:
      the HaploidReferenceResolver for this registry
    • getReadsResolver

      public ReadsResolver getReadsResolver()
      Get the ReadsResolver for this registry.
      Returns:
      the ReadsResolver for this registry
    • getVariantsResolver

      public VariantsResolver getVariantsResolver()
      Get the VariantsResolver for this registry.
      Returns:
      the VariantsResolver for this registry