bio-0.5.2: A bioinformatics library

Safe Haskell | Safe-Infered

Bio.Location.SeqLocation

Contents

- Positions on named sequences
- Contiguous location spans on named sequences
- Arbitrary location spans on named sequences
- Testing for location intersection on named sequences
- Extracting subsequences
- Displaying locations on named sequences

Description

Data types for sequence locations and sequence positions associated with specific, named sequences.

Synopsis

- type SeqPos = OnSeq Pos
- type ContigSeqLoc = OnSeq ContigLoc
- withinContigSeqLoc :: SeqPos -> ContigSeqLoc -> Bool
- type SeqLoc = OnSeq Loc
- isWithin :: SeqPos -> SeqLoc -> Bool
- overlaps :: SeqLoc -> SeqLoc -> Bool
- seqData :: (Error e, MonadError e m) => (SeqName -> m SeqData) -> SeqLoc -> m SeqData
- displaySeqPos :: SeqPos -> String
- displayContigSeqLoc :: ContigSeqLoc -> String
- display :: SeqLoc -> String

# Positions on named sequences

type SeqPos = OnSeq Pos

A position on a named sequence

# Contiguous location spans on named sequences

type ContigSeqLoc = OnSeq ContigLoc

A location consisting of a contiguous span of positions on a named sequence.

withinContigSeqLoc :: SeqPos -> ContigSeqLoc -> Bool

Test whether a sequence position lies within a sequence location. This requires that the position lie within the location as per `isWithin` and have the same sequence name.

# Arbitrary location spans on named sequences

type SeqLoc = OnSeq Loc

A general location, consisting of spans of sequence positions on a specific, named sequence.

# Testing for location intersection on named sequences

isWithin :: SeqPos -> SeqLoc -> Bool

Test whether a sequence position lies within a sequence location. This requires that the position lie within the location as per `isWithin` and have the same sequence name.

overlaps :: SeqLoc -> SeqLoc -> Bool

Test whether two sequence locations overlap in any position. This requires that the locations overlap as per `overlaps` and have the same sequence name.

# Extracting subsequences

seqData :: (Error e, MonadError e m) => (SeqName -> m SeqData) -> SeqLoc -> m SeqData

Extract the subsequence specified by a sequence location from a sequence database. The sequence name is used to retrieve the full sequence and the subsequence is extracted as by `seqData`

# Displaying locations on named sequences

displaySeqPos :: SeqPos -> String

Display a human-friendly representation of a `SeqPos`

displayContigSeqLoc :: ContigSeqLoc -> String

Display a human-friendly representation of a `ContigSeqLoc`

display :: SeqLoc -> String

Display a human-friendly representation of a `SeqLoc`