seqloc-0.6.1.1: Handle sequence locations for bioinformatics

Safe HaskellNone
LanguageHaskell2010

Bio.SeqLoc.LocMap

Contents

Description

Efficient lookup based on potential location overlap

Collection of objects with locations, potentially on named sequences, that can be queried to recover all objects whose location could potentially overlap a query location.

|

Synopsis

Mapping objects to locations

data LocMap a Source

Mapping objects to sequence locations in the sense of Location.

Instances

Show a => Show (LocMap a) 

emptyLM :: Offset -> LocMap a Source

Create an empty object / location map.

Specify a characteristic size for efficient queries, which depends on the underlying genome. Smaller sizes yield fewer false candidates but greater memory usage and potentially slower queries.

insertLoc :: Location l => l -> a -> LocMap a -> LocMap a Source

Insert a new object / location pair and reutrn the updated map

queryLoc :: Location l => l -> LocMap a -> [a] Source

Retrieve a list of objects that could potentially overlap the query location.

Some objects may not actually overlap the query location. Some objects may appear more than once in the list. However, no object whose location truly overlaps the query will be missing from the list.

Overlap is defined by one or more nucleotides in common between the bounds of the two locations, regardless of the relative strands of the query and the object location.

Mapping objects to locations on named sequneces

data SeqLocMap a Source

Mapping objects to locations on named sequences

Instances

Show a => Show (SeqLocMap a) 

emptySLM :: Offset -> SeqLocMap a Source

Create an empty object / location map

Specify a characteristic size as per emptyLM.

insertSeqLoc :: Location l => OnSeq l -> a -> SeqLocMap a -> SeqLocMap a Source

Insert a new object / location pair and reutrn the updated map

querySeqLoc :: Location l => OnSeq l -> SeqLocMap a -> [a] Source

Retrieve a list of objects that could potentially overlap the query location.

Some objects may not actually overlap the query location. Some objects may appear more than once in the list. However, no object whose location truly overlaps the query will be missing from the list.

Overlap is defined by one or more nucleotides in common between the bounds of the two locations, regardless of the relative strands of the query and the object location, as well as the same name for the underlying reference sequence.

To retrieve objects and test for actual overlap see the Locatable interface and queryLocatable or queryLocCompatible.

Mapping transcripts to their locations

transcriptSeqLocMap :: Offset -> [Transcript] -> SeqLocMap Transcript Source

Construct a mapping from transcripts to their genomic locations.

Generalization of objects with locations

class Locatable o where Source

Object with a genomic location expressed by SpliceSeqLoc.

Methods

locate :: o -> SpliceSeqLoc Source

data WithLocation a Source

Simple representation of a Locatable object as an arbitrary object adjoined with a location.

Constructors

WithLocation 

Instances

locatableSeqLocMap :: Locatable l => Offset -> [l] -> SeqLocMap l Source

Construct a mapping from a general Locatable object to its genomic location

queryLocatable :: (Locatable o, Location l) => Maybe Strand -> OnSeq l -> SeqLocMap o -> [o] Source

Retrieve a list of Locatable objects whose overall, contiguous genomic coordinates intersect at any position the genomic interval spanned by the specified Location. This does not require that the spliced structure of the query is a subset of the spliced structure of the Locatable nor that the query location lie entirely within the hit location (contrast with queryLocCompatible).

When a strand argument is given, restrict matches to those lying on the same strand as the query location, for `Just Plus`, or the opposite strand, for `Just Minus`.

queryLocCompatible :: Locatable o => Maybe Strand -> SpliceSeqLoc -> SeqLocMap o -> [o] Source

Retrieve a list of Locatable objects whose spliced structure contains the query location specifically.

queryLocInto :: Locatable o => Maybe Strand -> SpliceSeqLoc -> SeqLocMap o -> [(o, SpliceLoc)] Source

Retrieve a list of Locatable objects whose splice structure contains the query location, paired with the sub-location of the query within the Locatable.