This module provides a data type to represent an alignment produced by the Bowtie short-read alignment tool (see http://bowtie-bio.sourceforge.net/index.shtml).
The simple accessors recapitulate the details of the Bowtie alignment output. The position of the alignment is given by the "0-based offset into the reference sequence where leftmost character of the alignment occurs". Thus, for forward-strand alignments this is the 5' end of the query sequence while for reverse-complement alignments this is the 3' end of the query sequence. Similarly, the query sequence and query quality are shown in reference forward strand orientation, and thus may be reverse complemented.
- data Align = Align {}
- data Mismatch = Mismatch {}
- length :: Align -> Offset
- nmismatch :: Align -> Int
- querySequ :: Align -> SeqData
- queryQual :: Align -> QualData
- refCLoc :: Align -> ContigLoc
- refCSeqLoc :: Align -> ContigSeqLoc
- refSeqLoc :: Align -> SeqLoc
- refSeqPos :: Align -> SeqPos
- mismatchSeqPos :: Align -> Mismatch -> SeqPos
- parse :: ByteString -> Either String Align
- sameRead :: Align -> Align -> Bool
Data type and basic accessors
Align | |
|
Representation of a single mismatch in a bowtie alignment
Sequence positions of alignments
refCLoc :: Align -> ContigLocSource
As refCSeqLoc
but without the reference sequence name.
refCSeqLoc :: Align -> ContigSeqLocSource
Returns the sequence location covered by the query in the alignment. This will be a sequence location on the reference sequence and may run on the forward or the reverse complement strand.
refSeqLoc :: Align -> SeqLocSource
Returns the sequence location covered by the query, as
refCSeqLoc
, as a SeqLoc
location.
refSeqPos :: Align -> SeqPosSource
Returns the sequence position of the start of the query sequence
alignment. This will include the strand of the alignment and will
not be the same as the position computed from leftoffset
when the
alignment is on the reverse complement strand.
mismatchSeqPos :: Align -> Mismatch -> SeqPosSource
Sequence position of a mismatch on the reference sequence.
Parsing Bowtie output
Other utilities
sameRead :: Align -> Align -> BoolSource
Returns true when two alignments were derived from the same sequencing read. As Bowtie writes alignments of query sequences in their order in the query file, all alignments of a given read are grouped together and the lists of all alignments for each read can be gathered with
groupBy sameRead