biohazard-2.1: bioinformatics support library

Safe HaskellNone
LanguageHaskell2010

Bio.Bam.Writer

Description

Printers for BAM and SAM. BAM is properly supported, SAM can be piped to standard output.

Synopsis

Documentation

class IsBamRec a where Source #

Instances
IsBamRec BamRaw Source # 
Instance details

Defined in Bio.Bam.Writer

IsBamRec BamRec Source # 
Instance details

Defined in Bio.Bam.Writer

(IsBamRec a, IsBamRec b) => IsBamRec (Either a b) Source # 
Instance details

Defined in Bio.Bam.Writer

encodeBamWith :: (IsBamRec a, MonadIO m) => Int -> BamMeta -> Stream (Of a) m r -> ByteStream m r Source #

Encodes BAM records straight into a dynamic buffer, then BGZF's it. Should be fairly direct and perform well.

writeBamFile :: (IsBamRec a, MonadIO m, MonadMask m) => FilePath -> BamMeta -> Stream (Of a) m r -> m r Source #

Writes BAM encoded stuff to a file. In reality, it cleverly writes to a temporary file and renames it when done.

writeBamHandle :: (IsBamRec a, MonadIO m) => Handle -> BamMeta -> Stream (Of a) m r -> m r Source #

Writes BAM encoded stuff to a Handle.

pipeBamOutput :: (IsBamRec a, MonadIO m) => BamMeta -> Stream (Of a) m r -> m r Source #

Write BAM encoded stuff to stdout. This sends uncompressed(!) BAM to stdout. Useful for piping to other tools. The output is still wrapped in a BGZF stream, because that's what all tools expect; but the individuals blocks are not compressed.

pipeSamOutput :: (IsBamRec a, MonadIO m) => BamMeta -> Stream (Of a) m r -> m r Source #

write in SAM format to stdout

This is useful for piping to other tools (say, AWK scripts) or for debugging. No convenience functions to send SAM to a file or to compress it exist, because these are stupid ideas.