Exports VerboseHit results back into text. As a likely scenario is a pipeline where hits are to be filtered out, this provides enumeratee's that handle additional annotations as required by the file format for CMs, scaffolds, and strand information. If you just need a way to show the data, use printVerboseHit.
- showVerboseHit :: VerboseHit -> ByteString
- showCM :: ByteString -> ByteString
- showScaffold :: ByteString -> ByteString
- showStrand :: Char -> ByteString
- data HitStream a
- = StreamVerboseHit { }
- | StreamCM { }
- | StreamScaffold { }
- | StreamStrand {
- streamStrand :: Char
- | StreamInsertion {
- streamInsertion :: a
- eeHitToStream :: Monad m => Enumeratee VerboseHit [HitStream z] m a
- eeFlattenStream :: Monad m => Enumeratee [HitStream z] (HitStream z) m a
- eeStreamToByteString :: (Monad m, Show z) => StreamToByteString m z
- eeStreamToByteString' :: Monad m => StreamToByteString m ()
- type StreamToByteString m z = forall a. Enumeratee (HitStream z) ByteString m a
Documentation
showVerboseHit :: VerboseHit -> ByteStringSource
Takes a list of VerboseHit
s and produces a list of bytestrings. Unlining
those bytestrings produces a file that is in essence an Infernal
verbose-hit output file and should be parse-able by ours and other
importers.
TODO block length (for the alignment of query/sequenc) ?!
TODO is there a more elegant treatment of the eof condition than asking at every verbose hit that is created?
Convert a VerboseHit
to a string, ready for printing as in the input
file.
showCM :: ByteString -> ByteStringSource
CM information, ready for printing.
showScaffold :: ByteString -> ByteStringSource
Scaffold information
showStrand :: Char -> ByteStringSource
Strand information
Turning a list of VerboseHit
s back into lines of characters is, in
principle, not too hard. But just before we actually stream out, we might
want to inject arbitrary data into the stream. This is done via
StreamInsertion
. The other constructors merely wrap certain data.
One way to, say, tag verbose hits is like this (note the output type of
eeHitToStream
):
tag [s@(StreamVerboseHit _)] = [StreamInsertion (), s] tag xs = xs
eeHitToStream :: Monad m => Enumeratee VerboseHit [HitStream z] m aSource
This enumeratee turns VerboseHit
s into a HitStream
. Each VerboseHit
can emit one or more elements, depending on if the CM, scaffold, or strand
changes.
TODO try to rewrite use Control.Monad.State
eeFlattenStream :: Monad m => Enumeratee [HitStream z] (HitStream z) m aSource
Flattens a stream from a list of lists to a single list. After this point, you probably want to insert elements into the stream, then flatten again.
eeStreamToByteString :: (Monad m, Show z) => StreamToByteString m zSource
eeStreamToByteString' :: Monad m => StreamToByteString m ()Source
type StreamToByteString m z = forall a. Enumeratee (HitStream z) ByteString m aSource