packages feed

hPDB-examples 1.0 → 1.1

raw patch · 3 files changed

+15/−28 lines, 3 filesdep ~hPDB

Dependency ranges changed: hPDB

Files

README.md view
@@ -2,6 +2,6 @@ =============== Haskell PDB file format parser - example scripts. -[![Build Status](https://api.travis-ci.org/mgajda/hPDB-examples.png?branch=master)](https://travis-ci.org/mgajda/hPDB-examples)+[![Build Status](https://api.travis-ci.org/BioHaskell/hPDB-examples.png?branch=master)](https://travis-ci.org/BioHaskell/hPDB-examples)  Details on official releases are on [Hackage](http://hackage.haskell.org/package/hPDB-examples).
examples/StericClashCheck.hs view
@@ -2,38 +2,25 @@  module Main where -import qualified System.Environment as Env-import qualified Data.ByteString.Char8 as BS-import qualified Data.Octree as Oct-import Bio.PDB               as PDB-import qualified Bio.PDB.Structure.Elements as Elt+import qualified System.Environment           as Env(getArgs)+import qualified Data.ByteString.Char8        as BS+import qualified Data.Octree                  as Oct+import           Bio.PDB                      as PDB+import qualified Bio.PDB.Structure.Elements   as PDB(vanDerWaalsRadius)+import qualified Bio.PDB.Structure.Neighbours as PDB  -- TODO: way to hand over Atom object along with its Residue, Chain and Model -- TODO: make it so that Show gives a "full_id" string by default, e.g. Model, chain, residue id, atom name. clashCheck s1 s2 = filter (/= []) . Prelude.map clashes $ itfoldr (:) [] s2   where-    clashes (at :: PDB.Atom) = Oct.withinRange ot (radius + maxRadius) (v3v $ PDB.coord at)+    clashes (at :: PDB.Atom) = PDB.findInRadius (PDB.makeOctree s1) (radius + maxRadius) (PDB.coord at)       where-        radius :: Double = realToFrac $ Elt.vanDerWaalsRadius . PDB.element $ at-    ot :: Oct.Octree (Int, Double)-    ot = makeOctree s1--extract :: PDB.Atom -> (Oct.Vector3, (Int, Double))-extract (PDB.Atom { coord    = cvec,-                    atSerial = ser ,-                    element  = elt }) = (v3v cvec,-                                         (ser, realToFrac vdw))-  where-    vdw    = Elt.vanDerWaalsRadius elt--makeOctree structure = Oct.fromList . Prelude.map extract . itfoldr (:) [] $ structure+        radius :: Double = realToFrac $ PDB.vanDerWaalsRadius . PDB.element $ at  -- Bio.PDB.Structure.Elements should export max bound for vdw etc. -- or a list of known element codes. maxRadius = 1.6 -v3v = id- size ot =  length . Oct.toList $ ot  main = do [input1, input2] <- Env.getArgs@@ -41,9 +28,9 @@           Just structure2 <- PDB.parse input2           print $ clashCheck structure1 structure2           print "Depths:"-          print . Oct.depth . makeOctree $ structure1-          print . Oct.depth . makeOctree $ structure2+          print . Oct.depth . PDB.makeOctree $ structure1+          print . Oct.depth . PDB.makeOctree $ structure2           print "Sizes:"-          print . size      . makeOctree $ structure1-          print . size      . makeOctree $ structure2+          print . size      . PDB.makeOctree $ structure1+          print . size      . PDB.makeOctree $ structure2 
hPDB-examples.cabal view
@@ -1,5 +1,5 @@ name:                hPDB-examples-version:             1.0+version:             1.1 synopsis:            Examples for hPDB library stability:           stable homepage:            https://github.com/mgajda/hpdb-examples@@ -28,7 +28,7 @@ Executable PDB2Fasta   main-is:          examples/PDB2Fasta.hs   ghc-options:      -fspec-constr-count=4 -O3 -  build-depends:    base>=4.0, base <4.7, bytestring, ghc-prim, directory, mtl, template-haskell, vector, AC-Vector, containers, deepseq, QuickCheck >= 2.5.0.0, text>=0.11.1.13, hPDB >= 0.9999, iterable >=2.0+  build-depends:    base>=4.0, base <4.7, bytestring, ghc-prim, directory, mtl, template-haskell, vector, AC-Vector, containers, deepseq, QuickCheck >= 2.5.0.0, text>=0.11.1.13, hPDB >= 1.1, iterable >=2.0   other-extensions:       ScopedTypeVariables OverloadedStrings BangPatterns NoMonomorphismRestriction EmptyDataDecls MagicHash  Executable ShiftToCenter