-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Handle sequence locations for bioinformatics -- -- Handle sequence locations for bioinformatics @package seqloc @version 0.2 module Bio.SeqLoc.SeqLike class SeqLike s length :: (SeqLike s, Integral n) => s -> n ntAt :: (SeqLike s, Integral n) => s -> n -> Maybe Char subseq :: (SeqLike s, Integral n, Integral m) => n -> m -> s -> Maybe s subseqPad :: (SeqLike s, Integral n, Integral m) => n -> m -> s -> s concat :: SeqLike s => [s] -> s instance SeqLike ByteString instance SeqLike ByteString instance SeqLike [Char] module Bio.SeqLoc.LocRepr class LocRepr l repr :: LocRepr l => l -> ByteString unrepr :: LocRepr l => Parser l reprStr :: LocRepr l => l -> String unreprMaybe :: LocRepr l => ByteString -> Maybe l unreprEither :: LocRepr l => ByteString -> Either String l unreprErr :: LocRepr l => ByteString -> l -- | Utilities for manipulating nucleotide sequences and locations on -- nucleotide sequences that occur on a forward or a reverse-complement -- strand. module Bio.SeqLoc.Strand -- | Sequence strand data Strand Fwd :: Strand RevCompl :: Strand -- | Complement of a nucleotide character, swap AT and GC preserving -- case and leave all other characters unchanged. compl :: Char -> Char -- | A nucleotide sequence or location on a nucleotide sequence that lies -- on a specific strand and has an orientation. class Stranded s revCompl :: Stranded s => s -> s -- | Convert the orientation of a Stranded thing based on a -- specified Strand stranded :: Stranded s => Strand -> s -> s instance Eq Strand instance Ord Strand instance Show Strand instance Read Strand instance Bounded Strand instance Enum Strand instance Stranded ByteString instance Stranded ByteString instance Stranded String instance Stranded Word8 instance Stranded Char instance Stranded Strand instance LocRepr Strand -- | Data type for a sequence position. -- -- Zero-based Offsetindices are used throughout, to facilitate -- direct use of indexing functions on SeqData. module Bio.SeqLoc.Position -- | Unstranded offset in a sequence newtype Offset Offset :: Int64 -> Offset unOffset :: Offset -> Int64 -- | Stranded position in a sequence data Pos Pos :: !Offset -> !Strand -> Pos -- | 0-based index of the position offset :: Pos -> !Offset -- | Strand of the position strand :: Pos -> !Strand -- | 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)
--   
slide :: Pos -> Offset -> Pos -- | Extract Just the item at a specific sequence position, or -- Nothing if the position lies outside the bounds of the -- sequence. atPos :: SeqLike s => s -> Pos -> Maybe Char instance Eq Offset instance Ord Offset instance Show Offset instance Read Offset instance Num Offset instance Real Offset instance Enum Offset instance Integral Offset instance Eq Pos instance Ord Pos instance Show Pos instance Read Pos instance LocRepr Pos instance Stranded Pos instance LocRepr Offset -- | Data type for a sequence location consiting of a contiguous range of -- positions on the sequence. -- -- Throughout, sequence position refers to a Pos which -- includes a strand, as opposed to an offset, which refers to a -- Offset with no strand. module Bio.SeqLoc.Location class Location l strand :: Location l => l -> Strand length :: Location l => l -> Offset bounds :: Location l => l -> (Offset, Offset) startPos :: Location l => l -> Pos endPos :: Location l => l -> Pos seqData :: (Location l, SeqLike s, Stranded s) => s -> l -> Maybe s seqDataPad :: (Location l, SeqLike s, Stranded s) => s -> l -> s posInto :: Location l => Pos -> l -> Maybe Pos posOutof :: Location l => Pos -> l -> Maybe Pos clocInto :: Location l => ContigLoc -> l -> Maybe ContigLoc clocOutof :: Location l => ContigLoc -> l -> Maybe l extend :: Location l => (Offset, Offset) -> l -> l offsetWithin :: Location l => Offset -> l -> Bool posWithin :: Location l => Pos -> l -> Bool contigOverlaps :: Location l => ContigLoc -> l -> Bool toContigs :: Location l => l -> [ContigLoc] overlaps :: (Location l1, Location l2) => l1 -> l2 -> Bool -- | Contiguous sequence location defined by a span of sequence positions, -- lying on a specific strand of the sequence. data ContigLoc -- | The offset of the 5' end of the location, as a 0-based index offset5 :: ContigLoc -> Offset -- | Create a sequence location lying between 0-based starting and ending -- offsets. When start < end, the location be on the forward -- strand, otherwise it will be on the reverse complement strand. fromStartEnd :: Offset -> Offset -> ContigLoc -- | Create a sequence location from the sequence position of the start of -- the location and the length of the position. The strand of the -- location, and the direction it extends from the starting position, are -- determined by the strand of the starting position. fromPosLen :: Pos -> Offset -> ContigLoc -- | Create a sequence location between 0-based starting and ending bounds -- with a specified strand. fromBoundsStrand :: Offset -> Offset -> Strand -> ContigLoc -- | Returns a location resulting from sliding the original location along -- the sequence by a specified offset. A positive offset will move the -- location away from the 5' end of the forward stand of the sequence -- regardless of the strand of the location itself. Thus, -- --
--   slide (revCompl cloc) off == revCompl (slide cloc off)
--   
slide :: Offset -> ContigLoc -> ContigLoc instance Eq ContigLoc instance Ord ContigLoc instance Show ContigLoc instance Location ContigLoc instance LocRepr ContigLoc instance Stranded ContigLoc -- | Data type for a more general sequence location consiting of disjoint -- ranges of positions on a sequence. -- -- Throughout, sequence position refers to a Pos which -- includes a strand, as opposed to an offset, which refers to a -- Offset with no strand. module Bio.SeqLoc.SpliceLocation -- | General (disjoint) sequence region consisting of a concatenated set of -- one or more contiguous regions. data SpliceLoc fromContigs :: [ContigLoc] -> Maybe SpliceLoc locOutof :: Location l => SpliceLoc -> l -> Maybe SpliceLoc locInto :: Location l => SpliceLoc -> l -> Maybe SpliceLoc mergeContigs :: [ContigLoc] -> [ContigLoc] mergeAdjContigs :: ContigLoc -> ContigLoc -> Maybe ContigLoc instance Eq SpliceLoc instance Ord SpliceLoc instance Show SpliceLoc instance Location SpliceLoc instance LocRepr SpliceLoc instance Stranded SpliceLoc -- | Data types for sequence locations and sequence positions associated -- with specific, named sequences. module Bio.SeqLoc.OnSeq newtype SeqName SeqName :: ByteString -> SeqName unSeqName :: SeqName -> ByteString data OnSeq s OnSeq :: !SeqName -> !s -> OnSeq s onSeqName :: OnSeq s -> !SeqName unOnSeq :: OnSeq s -> !s type SeqOffset = OnSeq Offset -- | A position on a named sequence type SeqPos = OnSeq Pos -- | A location consisting of a contiguous span of positions on a named -- sequence. type ContigSeqLoc = OnSeq ContigLoc -- | A general location, consisting of spans of sequence positions on a -- specific, named sequence. type SpliceSeqLoc = OnSeq SpliceLoc andSameSeq :: (a -> b -> Bool) -> OnSeq a -> OnSeq b -> Bool instance Show SeqName instance Read SeqName instance Eq SeqName instance Ord SeqName instance IsString SeqName instance Show s => Show (OnSeq s) instance Read s => Read (OnSeq s) instance Eq s => Eq (OnSeq s) instance Ord s => Ord (OnSeq s) instance LocRepr s => LocRepr (OnSeq s) instance Stranded s => Stranded (OnSeq s) module Bio.SeqLoc.Transcript -- | Splice junctions, which are isomorphic to the introns they span, but -- which support other biologically relevant constructors and accessors. newtype Junction Junction :: ContigLoc -> Junction intron :: Junction -> ContigLoc -- | Create a splice junction from a donor position (the last position in -- the 5' exon) and the acceptor position (the first position in the 3' -- exon). fromDonorAcceptor :: Pos -> Pos -> Junction -- | Donor position, i.e., the last position in the 5' exon around a -- junction. donor :: Junction -> Pos -- | Acceptor position, i.e., the first position in the 3' exon around a -- junction. acceptor :: Junction -> Pos -- | List of splice junctions from a spliced location, in order. junctions :: SpliceLoc -> [Junction] -- | Representation of a genomic transcript, with a gene and a transcript -- identifier, along with the genomic location of the processed -- transcript and an optional coding sequence on that transcript. data Transcript Transcript :: !SeqName -> !SeqName -> !SpliceSeqLoc -> !Maybe ContigLoc -> Transcript -- | Gene or locus name for a collection of transcripts geneId :: Transcript -> !SeqName -- | Specific transcript identifier trxId :: Transcript -> !SeqName -- | Sequence location of processed transcript location :: Transcript -> !SpliceSeqLoc -- | Location of CDS on the transcript cds :: Transcript -> !Maybe ContigLoc -- | Just the location of the 5' UTR on the transcript, or -- Nothing if there is no cds on the transcript or if the -- cds location begins at the first nucleotide of the -- transcript--if a region is returned it will have positive length. utr5 :: Transcript -> Maybe ContigLoc -- | Just the location of the 3' UTR on the transcript, or -- Nothing if there is no cds on the transcript or if the -- cds location ends at the last nucleotide of the transcript--if -- a region is returned it will have positive length. utr3 :: Transcript -> Maybe ContigLoc -- | Genomic location of CDS within the transcript cdsLocation :: Transcript -> Maybe SpliceSeqLoc -- | Just the input contigs sorted in stranded order, when all lie -- on the same strand, or Nothing if they are not all on the same -- strand. sortContigs :: [ContigLoc] -> Maybe [ContigLoc] instance Show Junction instance Show Transcript instance LocRepr Junction