Safe Haskell | None |
---|---|
Language | Haskell2010 |
Handling of BGZF files. Right now, we have an Enumeratee each for input and output. The input iteratee can optionally supply virtual file offsets, so that seeking is possible.
- data Block = Block {}
- decompressBgzfBlocks' :: MonadIO m => Int -> Enumeratee Bytes Block m a
- decompressBgzfBlocks :: MonadIO m => Enumeratee Bytes Block m a
- decompressBgzf :: MonadIO m => Enumeratee Bytes Bytes m a
- decompressPlain :: MonadIO m => Enumeratee Bytes Block m a
- maxBlockSize :: Int
- bgzfEofMarker :: Bytes
- liftBlock :: Monad m => Iteratee Bytes m a -> Iteratee Block m a
- getOffset :: Iteratee Block m FileOffset
- data BgzfChunk
- isBgzf :: Monad m => Iteratee Bytes m Bool
- isGzip :: Monad m => Iteratee Bytes m Bool
- parMapChunksIO :: (MonadIO m, Nullable s) => Int -> (s -> IO t) -> Enumeratee s t m a
- compressBgzf :: MonadIO m => Enumeratee BgzfChunk Bytes m a
- compressBgzfLv :: MonadIO m => Int -> Enumeratee BgzfChunk Bytes m a
- compressBgzf' :: MonadIO m => CompressParams -> Enumeratee BgzfChunk Bytes m a
- data CompressParams = CompressParams {}
- compressChunk :: Int -> Ptr Word8 -> CUInt -> IO Bytes
Documentation
One BGZF block: virtual offset and contents. Could also be a block of an uncompressed file, if we want to support indexing of uncompressed BAM or some silliness like that.
Block | |
|
decompressBgzfBlocks' :: MonadIO m => Int -> Enumeratee Bytes Block m a Source #
Decompress a BGZF stream into a stream of Block
s, np
fold parallel.
decompressBgzfBlocks :: MonadIO m => Enumeratee Bytes Block m a Source #
decompressBgzf :: MonadIO m => Enumeratee Bytes Bytes m a Source #
Decompress a BGZF stream into a stream of Bytes
s.
decompressPlain :: MonadIO m => Enumeratee Bytes Block m a Source #
Decompresses a plain file. What's actually happening is that the
offset in the input stream is tracked and added to the Bytes
s
giving Block
s. This results in the same interface as decompressing
actual Bgzf.
maxBlockSize :: Int Source #
Maximum block size for Bgzf: 64k with some room for headers and uncompressible stuff
bgzfEofMarker :: Bytes Source #
The EOF marker for BGZF files. This is just an empty string compressed as BGZF. Appended to BAM files to indicate their end.
liftBlock :: Monad m => Iteratee Bytes m a -> Iteratee Block m a Source #
Runs an Iteratee
for Bytes
s when decompressing BGZF. Adds
internal bookkeeping.
getOffset :: Iteratee Block m FileOffset Source #
Get the current virtual offset. The virtual address in a BGZF stream contains the offset of the current block in the upper 48 bits and the current offset into that block in the lower 16 bits. This scheme is compatible with the way BAM files are indexed.
isBgzf :: Monad m => Iteratee Bytes m Bool Source #
Tests whether a stream is in BGZF format. Does not consume any input.
isGzip :: Monad m => Iteratee Bytes m Bool Source #
Tests whether a stream is in GZip format. Also returns True
on a
Bgzf stream, which is technically a special case of GZip.
parMapChunksIO :: (MonadIO m, Nullable s) => Int -> (s -> IO t) -> Enumeratee s t m a Source #
Parallel map of an IO action over the elements of a stream
This Enumeratee
applies an IO
action to every chunk of the input
stream. These IO
actions are run asynchronously in a limited
parallel way. Don't forget to evaluate
compressBgzf :: MonadIO m => Enumeratee BgzfChunk Bytes m a Source #
Like compressBgzf'
, with sensible defaults.
compressBgzfLv :: MonadIO m => Int -> Enumeratee BgzfChunk Bytes m a Source #
compressBgzf' :: MonadIO m => CompressParams -> Enumeratee BgzfChunk Bytes m a Source #
Compresses a stream of Bytes
s into a stream of BGZF blocks,
in parallel
data CompressParams Source #