bio 0.5.1 → 0.5.2
raw patch · 7 files changed
+15/−13 lines, 7 files
Files
- Bio/GFF3/FeatureHier.hs +1/−0
- Bio/GFF3/FeatureHierSequences.hs +1/−0
- Bio/Location/LocMap.hs +1/−1
- Bio/Sequence/HashWord.lhs +8/−8
- Bio/Sequence/TwoBit.hs +2/−2
- Bio/Util/TestBase.hs +1/−1
- bio.cabal +1/−1
Bio/GFF3/FeatureHier.hs view
@@ -1,4 +1,5 @@ {-# OPTIONS_GHC -XFlexibleContexts #-}+{-# LANGUAGE BangPatterns #-} module Bio.GFF3.FeatureHier ( FeatureHier, features, lookupId, lookupIdChildren , fromList, insert, delete
Bio/GFF3/FeatureHierSequences.hs view
@@ -1,4 +1,5 @@ {-# OPTIONS_GHC -XFlexibleContexts #-}+{-# LANGUAGE BangPatterns #-} module Bio.GFF3.FeatureHierSequences ( FeatureHierSequences, features, sequences , fromLists, parse
Bio/Location/LocMap.hs view
@@ -8,7 +8,7 @@ 'Loc.bounds'. Query locations are then tested only against the target locations in the relevant zones. -}-+{-# LANGUAGE BangPatterns #-} module Bio.Location.LocMap ( -- * Constructing location lookup maps LocMap, fromList
Bio/Sequence/HashWord.lhs view
@@ -39,7 +39,7 @@ \begin{code} -- | Contigous constructs an int\/eger from a contigous k-word.-contigous :: Integral k => Int -> HashF k+contigous :: (Integral k, Show k, Eq k) => Int -> HashF k contigous k' = let k = fromIntegral k' klim = let v = 4^(k-1) in if v==0 then error ("HashWord: word size of k="++show k++" too large for this data type.") else v@@ -71,7 +71,7 @@ -- | Like 'contigous', but returns the same hash for a word and its reverse complement. {-# SPECIALIZE rcontig :: Int -> HashF Int #-}-rcontig :: Integral k => Int -> HashF k+rcontig :: (Integral k, Show k, Eq k) => Int -> HashF k rcontig k' = let k = fromIntegral k' klim = let v = 4^(k-1) in if v==0 then error ("HashWord: word size of k="++show k++" too large for this data type.") else v@@ -122,7 +122,7 @@ -- | Like @rcontig@, but ignoring monomers (i.e. arbitrarily long runs of a single nucelotide -- are treated the same a single nucleotide.-rcpacked :: Integral k => Int -> HashF k+rcpacked :: (Integral k, Show k, Eq k) => Int -> HashF k rcpacked k' = let k = fromIntegral k' klim = let v = 4^(k-1) in if v==0 then error ("HashWord: word size of k="++show k++" too large for this data type.") else v@@ -187,14 +187,14 @@ -- conversion between integers (hashes) and strings -- n2k ignores contents beyond k chars-n2k :: Integral k => Int -> SeqData -> k+n2k :: (Integral k, Show k, Eq k) => Int -> SeqData -> k n2k k = n2i' 0 . B.take (fromIntegral k) -n2i' :: (Num a) => a -> SeqData -> a+n2i' :: (Num a, Show a, Eq a) => a -> SeqData -> a n2i' acc gs = if B.null gs then acc else n2i' (4*acc + val (B.head gs)) (B.tail gs) -- inefficient, but not used much in critical code anyway-k2n :: Integral k => Int -> k -> SeqData+k2n :: (Integral k, Show k, Eq k) => Int -> k -> SeqData k2n k = fromStr . k2n' k k2n' k i = if k==1 then [unval i]@@ -206,11 +206,11 @@ shiftLeft = error "Keys.shiftLeft not implemented" -} -val :: (Num t) => Char -> t+val :: (Num t, Show t, Eq t) => Char -> t val g = case toUpper g of {'A' -> 0; 'C' -> 1; 'G' -> 2; 'T' -> 3; _ -> error ("val: illegal character" ++ show g)} -unval :: (Num a) => a -> Char+unval :: (Num a, Show a, Eq a) => a -> Char unval i = case i of {0 -> 'A'; 1 -> 'C'; 2 -> 'G'; 3 -> 'T'; _ -> error ("unval: illegal value "++show i)}
Bio/Sequence/TwoBit.hs view
@@ -242,7 +242,7 @@ -- Map 2Bit nucleotide encodings to their character equivalents- dec1 :: (Num t) => t -> Char+ dec1 :: (Num t, Eq t, Show t) => t -> Char dec1 x = case x of 0 -> 'T'; 1 -> 'C'; @@ -251,7 +251,7 @@ _ -> error ("can't decode value "++show x) - go :: (Num a, Num t) => (a, [a], [a], [t]) -> Maybe (Char, (a, [a], [a], [t]))+ go :: (Num a, Num t, Eq a, Eq t, Show a, Show t) => (a, [a], [a], [t]) -> Maybe (Char, (a, [a], [a], [t])) go (_,_,_,[]) = Nothing go (pos,(l:ls),(n:ns),(d:ds)) | pos == l && pos == n = Just ('n',(pos+1,ls,ns,ds))
Bio/Util/TestBase.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS -fglasgow-exts #-}+{-# Language ExistentialQuantification #-} module Bio.Util.TestBase where
bio.cabal view
@@ -1,5 +1,5 @@ Name: bio-Version: 0.5.1+Version: 0.5.2 License: LGPL License-file: LICENSE Cabal-Version: >= 1.6