packages feed

BiobaseFR3D 0.2.2.0 → 0.2.3.0

raw patch · 2 files changed

+11/−7 lines, 2 filesdep +tupledep ~BiobaseXNAPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependencies added: tuple

Dependency ranges changed: BiobaseXNA

API changes (from Hackage documentation)

+ Biobase.FR3D: checkFR3D :: FR3D -> Either (FR3D, [Basepair]) FR3D
+ Biobase.FR3D: checkLinFR3D :: LinFR3D -> Either (LinFR3D, [TriPair]) LinFR3D
+ Biobase.FR3D: instance Eq Basepair
+ Biobase.FR3D: instance Ord Basepair
+ Biobase.FR3D: type TriPair = (ExtPairIdx, ExtPair, Basepair)
+ Biobase.FR3D.Import: fromDir :: FilePath -> IO [FR3D]
+ Biobase.FR3D.Import: fromDirNear :: FilePath -> IO [FR3D]
- Biobase.FR3D: LinFR3D :: ByteString -> ByteString -> [(ExtPairIdx, ExtPair)] -> LinFR3D
+ Biobase.FR3D: LinFR3D :: ByteString -> ByteString -> [TriPair] -> LinFR3D
- Biobase.FR3D: pairs :: LinFR3D -> [(ExtPairIdx, ExtPair)]
+ Biobase.FR3D: pairs :: LinFR3D -> [TriPair]

Files

Biobase/FR3D.hs view
@@ -13,6 +13,7 @@  import Data.ByteString.Char8 as BS import Data.List as L+import Data.Tuple.Select (sel1)  import Biobase.Primary import Biobase.Secondary@@ -41,16 +42,18 @@   , pdbnumber2 :: Int   , chain2 :: ByteString   , seqpos2 :: Int-  } deriving (Show)+  } deriving (Show,Eq,Ord)  -- | Linearized FR3D format.  data LinFR3D = LinFR3D   { pdbID :: ByteString   , sequence :: ByteString-  , pairs :: [(ExtPairIdx,ExtPair)] -- we keep the ExtPair information as provided by the non-linearized FR3D data+  , pairs :: [TriPair]   } deriving (Show) +type TriPair = (ExtPairIdx,ExtPair,Basepair) -- we keep the ExtPair information as provided by the non-linearized FR3D data+ -- | The default format is a bit unwieldy; Linearization assumes that all -- sequences are in 5'->3' order; then produces one sequence with "&" -- separating the sequences and pairs reduced to (Int,Int,cWW).@@ -63,7 +66,7 @@   } where       trans = snd $ L.mapAccumL ( \acc (x,y) -> (acc + 1 + BS.length y, (x,acc))                                 ) 0 chains-      f Basepair{..} =  (pi,p) where+      f bp@Basepair{..} =  (pi,p,bp) where         pi = ( ( maybe (-1) (\v -> v+seqpos1) $ L.lookup chain1 trans                , maybe (-1) (\v -> v+seqpos2) $ L.lookup chain2 trans                )@@ -79,7 +82,7 @@     f Basepair{..} = (chain1,seqpos1) < (chain2,seqpos2)  instance RemoveDuplicatePairs LinFR3D where-  removeDuplicatePairs x@LinFR3D{..} = x{pairs = L.filter (f.fst) pairs} where+  removeDuplicatePairs x@LinFR3D{..} = x{pairs = L.filter (f.sel1) pairs} where     f ((x,y),_) = x<y  @@ -112,7 +115,7 @@   | otherwise = Left (linfr3d,xs)   where     xs = [ x-         | x@(pi,p) <- pairs+         | x@(pi,p,_) <- pairs          ,  baseL pi < 0          || baseR pi < 0          || baseL pi >= BS.length sequence
BiobaseFR3D.cabal view
@@ -1,5 +1,5 @@ name:           BiobaseFR3D-version:        0.2.2.0+version:        0.2.3.0 author:         Christian Hoener zu Siederdissen maintainer:     choener@tbi.univie.ac.at homepage:       http://www.tbi.univie.ac.at/~choener/@@ -43,7 +43,8 @@     containers,     filemanip,     iteratee,-    BiobaseXNA >= 0.5.5+    tuple,+    BiobaseXNA == 0.6.2.0    exposed-modules:     Biobase.FR3D