bio-0.5.2: A bioinformatics library

Safe Haskell | Safe-Infered

Bio.Sequence.FastQ

Contents

- Reading FastQ
- Writing FastQ
- use Sanger-style quality information
- use Illumina (>v1.3)-style quality information

Description

Support the FastQ format that combines sequence and quality. See:

- http://www.bioperl.org/wiki/FASTQ_sequence_format

Of course, this is yet another vaguely defined pseudo-standard with conflicting definitions. Of course Solexa had to go and invent not one, but two different, and indistinguishably so, ways to do it:

- http://www.bcgsc.ca/pipermail/ssrformat/2007-March/000137.html
- http://maq.sourceforge.net/fastq.shtml
- http://en.wikipedia.org/wiki/FASTQ_format

Sanger-style FastQ-format is supported with the (h)read/writeSangerQ functions, and the new IlluminaSolexa-style with (h)readwriteIllumina.

As far as I know, FastQ is only used for nucleotide sequences, never amino acid.

Synopsis

- readFastQ :: FilePath -> IO [Sequence Nuc]
- hReadFastQ :: Handle -> IO [Sequence Nuc]
- parse :: [ByteString] -> Maybe (Either String (Sequence Nuc), [ByteString])
- writeFastQ :: FilePath -> [Sequence Nuc] -> IO ()
- hWriteFastQ :: Handle -> [Sequence Nuc] -> IO ()
- unparse :: Sequence Nuc -> ByteString
- readSangerQ :: FilePath -> IO [Sequence Nuc]
- hReadSangerQ :: Handle -> IO [Sequence Nuc]
- writeSangerQ :: FilePath -> [Sequence Nuc] -> IO ()
- hWriteSangerQ :: Handle -> [Sequence Nuc] -> IO ()
- readIllumina :: FilePath -> IO [Sequence Nuc]
- hReadIllumina :: Handle -> IO [Sequence Nuc]
- writeIllumina :: FilePath -> [Sequence Nuc] -> IO ()
- hWriteIllumina :: Handle -> [Sequence Nuc] -> IO ()

# Reading FastQ

readFastQ :: FilePath -> IO [Sequence Nuc]

Deprecated: FastQ assumes Sanger-style quality info use {read,write}SangerQ or -Illumina instead

hReadFastQ :: Handle -> IO [Sequence Nuc]

Deprecated: FastQ assumes Sanger-style quality info use {read,write}SangerQ or -Illumina instead

parse :: [ByteString] -> Maybe (Either String (Sequence Nuc), [ByteString])

Parse one FastQ entry, suitable for using in `unfoldr` over `lines` from a file

# Writing FastQ

writeFastQ :: FilePath -> [Sequence Nuc] -> IO ()

Deprecated: FastQ assumes Sanger-style quality info use {read,write}SangerQ or -Illumina instead

hWriteFastQ :: Handle -> [Sequence Nuc] -> IO ()

Deprecated: FastQ assumes Sanger-style quality info use {read,write}SangerQ or -Illumina instead

unparse :: Sequence Nuc -> ByteString

# use Sanger-style quality information

readSangerQ :: FilePath -> IO [Sequence Nuc]

hReadSangerQ :: Handle -> IO [Sequence Nuc]

writeSangerQ :: FilePath -> [Sequence Nuc] -> IO ()

hWriteSangerQ :: Handle -> [Sequence Nuc] -> IO ()

# use Illumina (>v1.3)-style quality information

readIllumina :: FilePath -> IO [Sequence Nuc]

hReadIllumina :: Handle -> IO [Sequence Nuc]

writeIllumina :: FilePath -> [Sequence Nuc] -> IO ()

hWriteIllumina :: Handle -> [Sequence Nuc] -> IO ()