biofasta-0.0.3: Library for reading fasta sequence files

Safe HaskellNone

Bio.Sequence.Fasta

Contents

Description

This module incorporates functionality for reading and writing sequence data in the Fasta format. Each sequence consists of a header (with a > prefix) and a set of lines containing the sequence data..

Synopsis

Documentation

Reading and writing plain FASTA files

readFasta :: FilePath -> IO [Sequence]Source

Lazily read sequences from a FASTA-formatted file

writeFasta :: FilePath -> [Sequence] -> IO ()Source

Write sequences to a FASTA-formatted file. Line length is 60.

hReadFasta :: Handle -> IO [Sequence]Source

Lazily read sequence from handle

hWriteFasta :: Handle -> [Sequence] -> IO ()Source

Write sequences in FASTA format to a handle.

Counting sequences in a FASTA file

Helper function for reading your own sequences

mkSeqs :: [ByteString] -> [Sequence]Source

Convert a list of FASTA-formatted lines into a list of sequences. Blank lines are ignored. Comment lines start with are allowed between sequences (and ignored). Lines starting with > initiate a new sequence.

Other

seqid

Arguments

:: BioSeq s 
=> s 
-> SeqLabel

Sequence identifier (typically first word of the header)

seqheader

Arguments

:: BioSeq s 
=> s 
-> SeqLabel

Sequence header (may contain whitespace), by convention the first word matches the seqid

seqdata

Arguments

:: BioSeq s 
=> s 
-> SeqData

Sequence data

seqlength

Arguments

:: BioSeq s 
=> s 
-> Offset

Sequence length