bio-0.5.2: A bioinformatics library

Safe Haskell | Safe-Infered

Bio.Sequence.TwoBit

Description

This module implements the 2bit format for sequences.

Based on: http://genome.ucsc.edu/FAQ/FAQformat#format7 Note! the description is not accurate, it is missing a reserved word in each sequence record.

There are also other, completely different ideas of the 2bit format, e.g. http://jcomeau.freeshell.org/www/genome/2bitformat.html

Synopsis

- decode2Bit :: ByteString -> [Sequence Nuc]
- read2Bit :: FilePath -> IO [Sequence Nuc]
- hRead2Bit :: Handle -> IO [Sequence Nuc]
- encode2Bit :: [Sequence a] -> ByteString
- write2Bit :: FilePath -> [Sequence a] -> IO ()
- hWrite2Bit :: Handle -> [Sequence a] -> IO ()

# Documentation

decode2Bit :: ByteString -> [Sequence Nuc]

Parse a (lazy) ByteString as sequences in the 2bit format.

read2Bit :: FilePath -> IO [Sequence Nuc]

Read sequences from a file in 2bit format and | unmarshall/deserialize into Sequence format.

hRead2Bit :: Handle -> IO [Sequence Nuc]

Read sequences from a file handle in the 2bit format and | unmarshall/deserialze into Sequence format.

encode2Bit :: [Sequence a] -> ByteString

Marshall from neutral representation to the 2Bit ByteString rep

write2Bit :: FilePath -> [Sequence a] -> IO ()

Marshall/serialize [Sequence] into 2Bit format and write to a file.

hWrite2Bit :: Handle -> [Sequence a] -> IO ()

Marshall/serialize [Sequence] into 2Bit format and write to a file using handle.