seqloc-0.2.1: Handle sequence locations for bioinformatics

Bio.SeqLoc.Position

Contents

Description

Data type for a sequence position.

Zero-based Offsetindices are used throughout, to facilitate direct use of indexing functions on SeqData.

Synopsis

Sequence positions

newtype Offset Source

Unstranded offset in a sequence

Constructors

Offset 

Fields

unOffset :: Int64
 

data Pos Source

Stranded position in a sequence

Constructors

Pos 

Fields

offset :: !Offset

0-based index of the position

strand :: !Strand

Strand of the position

Manipulating positions

slide :: Pos -> Offset -> PosSource

Returns a position resulting from sliding the original position along the sequence by a specified offset. A positive offset will move the position away from the 5' end of the forward stand of the sequence regardless of the strand of the position itself. Thus,

 slide (revCompl pos) off == revCompl (slide pos off)

Extracting sequences

atPos :: SeqLike s => s -> Pos -> Maybe CharSource

Extract Just the item at a specific sequence position, or Nothing if the position lies outside the bounds of the sequence.