bio-0.5.2: A bioinformatics library

Safe Haskell | Safe-Infered

Bio.Location.SeqLocMap

Contents

- Location lookup maps for named sequences
- Modifying location lookup maps
- Searching for target locations

Description

Efficient lookup of query positions in a collection of target sequence locations where positions and locations are associated with specific sequence names. This is an extension of `LocMap` to use locations and positions on named sequences as in `SeqLocation`.

Synopsis

- type SeqLocMap a = OnSeqs (LocMap a)
- empty :: SeqLocMap a
- fromList :: [(SeqLoc, a)] -> SeqLocMap a
- insert :: SeqLoc -> a -> SeqLocMap a -> SeqLocMap a
- lookupWithin :: SeqPos -> SeqLocMap a -> [(SeqLoc, a)]
- lookupOverlaps :: SeqLoc -> SeqLocMap a -> [(SeqLoc, a)]

# Location lookup maps for named sequences

type SeqLocMap a = OnSeqs (LocMap a)

A data structure for efficiently finding target sequence locations (`Loc`) that overlap query positions or locations. Each target location can be associated with an arbitrary additional value in the lookup map.

empty :: SeqLocMap a

Empty lookup map.

fromList :: [(SeqLoc, a)] -> SeqLocMap a

Creates a `SeqLocMap` from a list of target locations and their associated objects

# Modifying location lookup maps

insert :: SeqLoc -> a -> SeqLocMap a -> SeqLocMap a

Inserts a new target location and associated object into the location lookup map.

# Searching for target locations

lookupWithin :: SeqPos -> SeqLocMap a -> [(SeqLoc, a)]

Find the (possibly empty) list of target locations and associated objects that contain a sequence position, in the sense of `isWithin`.

lookupOverlaps :: SeqLoc -> SeqLocMap a -> [(SeqLoc, a)]

Find the (possibly empty) list of target locations and associated objects that overlap a sequence location, in the sense of `overlaps`.