Package htsjdk.beta.codecs.reads

# Class ReadsCodecUtils

java.lang.Object
htsjdk.beta.codecs.reads.ReadsCodecUtils

@InternalAPI public final class ReadsCodecUtils extends Object
InternalAPI Utilities for use by reads encoder/decoder implementations.

## Constructor Summary

Constructors
Constructor
Description
`ReadsCodecUtils()`

## Method Summary

Modifier and Type
Method
Description
`static void`
`assertBundleContainsIndex(Bundle inputBundle)`
InternalAPI The stated contract for decoders is that the index must be included in the bundle in order to use index queries, but some codecs use readers that *always* tries to resolve the index, which would violate that and allow some cases to work that shouldn't, so enforce the contract manually so that someday when we use a different implementation, no backward compatibility issue will be introduced.
`static void`
`bamDecoderOptionsToSamReaderFactory(SamReaderFactory samReaderFactory, BAMDecoderOptions bamDecoderOptions)`
`static boolean`
`bundleContainsIndex(Bundle inputBundle)`
InternalAPI Return true if the input `Bundle` contains a reads index resource
`static SamInputResource`
`bundleToSamInputResource(Bundle inputBundle, ReadsDecoderOptions readsDecoderOptions)`
InternalAPI Convert an input `Bundle` containing reads to a `SamInputResource`.
`static SamReader`
`getSamReader(Bundle inputBundle, ReadsDecoderOptions readsDecoderOptions, SamReaderFactory samReaderFactory)`
Propagate all reads decoder options and all bam decoder options to either a SamReaderFactory or a SamInputResource, and return the resulting SamReader
`static void`
`readsDecoderOptionsToSamReaderFactory(ReadsDecoderOptions readsDecoderOptions, SamReaderFactory samReaderFactory)`
InternalAPII Propagate options from a `ReadsDecoderOptions` to a SamReaderFactory.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ReadsCodecUtils

public ReadsCodecUtils()

## Method Details

### bundleToSamInputResource

@InternalAPI public static SamInputResource bundleToSamInputResource(Bundle inputBundle, ReadsDecoderOptions readsDecoderOptions)
InternalAPI Convert an input `Bundle` containing reads to a `SamInputResource`.

Parameters:
  `inputBundle` - input `Bundle` to convert (must contain a reads resource)
  `readsDecoderOptions` - `ReadsDecoderOptions` to use
Returns:
  a `SamInputResource`

### readsDecoderOptionsToSamReaderFactory

@InternalAPI public static void readsDecoderOptionsToSamReaderFactory(ReadsDecoderOptions readsDecoderOptions, SamReaderFactory samReaderFactory)
InternalAPII Propagate options from a `ReadsDecoderOptions` to a SamReaderFactory.

Parameters:
  `readsDecoderOptions` - `ReadsDecoderOptions` to use
  `samReaderFactory` - `SamReaderFactory`

### bundleContainsIndex

@InternalAPI public static boolean bundleContainsIndex(Bundle inputBundle)
InternalAPI Return true if the input `Bundle` contains a reads index resource

Parameters:
  `inputBundle` - input `Bundle` to inspect
Returns:
  true if input `Bundle` contains a reads index resource

### assertBundleContainsIndex

@InternalAPI public static void assertBundleContainsIndex(Bundle inputBundle)
InternalAPI The stated contract for decoders is that the index must be included in the bundle in order to use index queries, but some codecs use readers that *always* tries to resolve the index, which would violate that and allow some cases to work that shouldn't, so enforce the contract manually so that someday when we use a different implementation, no backward compatibility issue will be introduced.

Parameters:
  `inputBundle` - input `Bundle` to inspect

### getSamReader

@InternalAPI public static SamReader getSamReader(Bundle inputBundle, ReadsDecoderOptions readsDecoderOptions, SamReaderFactory samReaderFactory)
Propagate all reads decoder options and all bam decoder options to either a SamReaderFactory or a SamInputResource, and return the resulting SamReader

### bamDecoderOptionsToSamReaderFactory

@InternalAPI public static void bamDecoderOptionsToSamReaderFactory(SamReaderFactory samReaderFactory, BAMDecoderOptions bamDecoderOptions)