BiobaseXNA 0.5.3.0 → 0.5.4.0
raw patch · 2 files changed
+65/−1 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Biobase.Secondary: baseL :: BaseSelect a b => a -> b
+ Biobase.Secondary: baseR :: BaseSelect a b => a -> b
+ Biobase.Secondary: baseT :: BaseSelect a b => a -> ExtPairAnnotation
+ Biobase.Secondary: class BaseSelect a b | a -> b
+ Biobase.Secondary: instance [overlap ok] BaseSelect ((a, a), ExtPairAnnotation) a
+ Biobase.Secondary: instance [overlap ok] BaseSelect (a, a) a
Files
- Biobase/Secondary.hs +60/−0
- BiobaseXNA.cabal +5/−1
Biobase/Secondary.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-}@@ -36,6 +37,7 @@ , Just x' <- L.lookup (toUpper x) charEdgeList , Just y' <- L.lookup (toUpper y) charEdgeList = (c',x',y')+ | map toLower s == "bif" = (unknownCT,unknownEdge,unknownEdge) | otherwise = error $ "can't convert string: " ++ s -- | Each nucleotide in a pair may be paired using one of three edges:@@ -83,7 +85,9 @@ charCTList = [ ('c',cis) , ('t',trans)+ , ('?',unknownCT) -- TODO antiCT, paraCT+ -- TODO '?' type (??? could denote bifurcation) ] ctCharList = map swap charCTList@@ -178,6 +182,28 @@ +-- * little helpers++cWW = (cis,wc,wc)+cWS = (cis,wc,sugar)+cWH = (cis,wc,hoogsteen)+cSW = (cis,sugar,wc)+cSS = (cis,sugar,sugar)+cSH = (cis,sugar,hoogsteen)+cHW = (cis,hoogsteen,wc)+cHS = (cis,hoogsteen,sugar)+cHH = (cis,hoogsteen,hoogsteen)+tWW = (trans,wc,wc)+tWS = (trans,wc,sugar)+tWH = (trans,wc,hoogsteen)+tSW = (trans,sugar,wc)+tSS = (trans,sugar,sugar)+tSH = (trans,sugar,hoogsteen)+tHW = (trans,hoogsteen,wc)+tHS = (trans,hoogsteen,sugar)+tHH = (trans,hoogsteen,hoogsteen)++ -- * special show instances -- | This one requires ghc head@@ -187,3 +213,37 @@ --instance Show (CTisomerism,Edge,Edge) where -- show (ct,eI,eJ) = concat [show ct, show eI, show eJ] +++-- * tuple-like selection++-- | Selection of nucleotides and/or type classes independent of which type we+-- are looking at.++class BaseSelect a b | a -> b where+ -- | select first index or nucleotide+ baseL :: a -> b+ -- | select second index or nucleotide+ baseR :: a -> b+ -- | select basepair type if existing or return default cWW+ baseT :: a -> ExtPairAnnotation++-- | extended pairtype annotation given++instance BaseSelect ((a,a),ExtPairAnnotation) a where+ baseL ((a,_),_) = a+ baseR ((_,b),_) = b+ baseT (_,t) = t+ {-# INLINE baseL #-}+ {-# INLINE baseR #-}+ {-# INLINE baseT #-}++-- | simple cis/wc-wc basepairs++instance BaseSelect (a,a) a where+ baseL (a,_) = a+ baseR (_,a) = a+ baseT _ = cWW+ {-# INLINE baseL #-}+ {-# INLINE baseR #-}+ {-# INLINE baseT #-}
BiobaseXNA.cabal view
@@ -1,5 +1,5 @@ name: BiobaseXNA-version: 0.5.3.0+version: 0.5.4.0 author: Christian Hoener zu Siederdissen maintainer: choener@tbi.univie.ac.at homepage: http://www.tbi.univie.ac.at/~choener/@@ -17,6 +17,10 @@ efficient encodings for short sequences, as required by RNA folding tools. Extended RNA secondary structures can be represented as well.+ .+ Changes since 0.5.3.0+ .+ * tuple-like (selN) selection of basepairing elements (baseL,baseR,baseT) . Changes since 0.5.1.0 .