bio-0.5.3: A bioinformatics library

Safe HaskellSafe-Inferred

Bio.Location.SeqLocMap

Contents

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

Location lookup maps for named sequences

type SeqLocMap a = OnSeqs (LocMap a)Source

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 aSource

Empty lookup map.

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

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

Modifying location lookup maps

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

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

Searching for target locations

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

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)]Source

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