biohazard-0.6.2: bioinformatics support library

Safe HaskellNone
LanguageHaskell98

Bio.Bam.Writer

Synopsis

Documentation

encodeBamWith :: (MonadIO m, IsBamRec r) => Int -> BamMeta -> Enumeratee [r] ByteString m a Source

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

writeBamFile :: IsBamRec r => FilePath -> BamMeta -> Iteratee [r] IO () Source

writes BAM encoded stuff to a file XXX This should(!) write indexes on the side---a simple block index for MapReduce style slicing, a standard BAM index or a name index would be possible. When writing to a file, this makes even more sense than when writing to a Handle.

writeBamHandle :: (MonadIO m, IsBamRec r) => Handle -> BamMeta -> Iteratee [r] m () Source

writes BAM encoded stuff to a Handle We generate BAM with dynamic blocks, then stream them out to the file.

XXX This could write indexes on the side---a simple block index for MapReduce style slicing, a standard BAM index or a name index would be possible.

pipeBamOutput :: IsBamRec r => BamMeta -> Iteratee [r] IO () Source

write BAM encoded stuff to stdout This send uncompressed BAM to stdout. Useful for piping to other tools.

pipeSamOutput :: MonadIO m => BamMeta -> Iteratee [BamRec] m () Source

Printers for BAM. We employ an Iteratee interface, and we strive to keep BAM records in their encoded form. This is most compact and often faster, since it saves the time for repeated decoding and encoding, if that's not strictly needed.

write in SAM format to stdout This is useful for piping to other tools (say, AWK scripts) or for debugging. No convenience function to send SAM to a file exists, because that's a stupid idea.