hPDB- Protein Databank file format library

Safe HaskellNone




parse :: FilePath -> IO (Maybe Structure) Source

Parse a .pdb file and return Structure.

write :: PDBWritable a => a -> FilePath -> IO () Source

Write structure to a .pdb file.

class PDBWritable a Source

Class generating events for PDB structure fragments.

Minimal complete definition


data Structure Source

Structure holds all data parsed from a single PDB entry




models :: List Model

data Model Source

PDB entry may contain multiple models, with slight differences in coordinates etc.




modelId :: !Int
chains :: List Chain

data Chain Source

Single linear polymer chain of protein, or nucleic acids




chainId :: !Char
residues :: List Residue

data Residue Source

Residue groups all atoms assigned to the same aminoacid or nucleic acid base within a polymer chain.




resName :: !String
resSeq :: !Int
atoms :: List Atom
insCode :: !Char

data Atom Source

Single atom position | NOTE: disordered atoms are now reported as multiplicates



class Iterable a b where

Class for iterating all nested components b of type a.

Minimal complete definition

itmapM, itfoldM, itfoldr, itfoldl, itfoldl', itlength


itmapM :: Monad m => (b -> m b) -> a -> m a

itmap :: (b -> b) -> a -> a

itfoldM :: Monad m => (c -> b -> m c) -> c -> a -> m c

itfoldr :: (b -> c -> c) -> c -> a -> c

itfoldl :: (c -> b -> c) -> c -> a -> c

itfoldl' :: (c -> b -> c) -> c -> a -> c

itlength :: Proxy * b -> a -> Int

numAtoms :: Iterable a Atom => a -> Int Source

Number of all atoms within the structure.

numResidues :: Iterable a Residue => a -> Int Source

Number of all residues within the structure.

numChains :: Iterable a Chain => a -> Int Source

Number of all chains within the structure.

numModels :: Iterable a Model => a -> Int Source

Number of all models within the structure.

firstModel :: Iterable a Model => a -> Maybe Model Source

Takes a first model.

resname2fastacode :: String -> Char Source

Dictionary mapping three-letter PDB residue code to a single-letter FASTA code.

fastacode2resname :: Char -> String Source

Dictionary mapping single-letter FASTA standard aminoacid code to a PDB residue name

(*|) :: Double -> Vector3 -> Vector3 Source

Scalar product. (asterisk - "*" - indicates side on which one can put a scalar.)

(|*) :: Vector3 -> Double -> Vector3 Source

Scalar product. (asterisk - "*" - indicates side on which one can put a scalar.)

vnorm :: Vector3 -> Double Source

2-norm of a vector (also called a magnitude or length.)

type Element = ByteString Source

Type alias for Element names.

assignElement :: Atom -> Element Source

Given a PDB Atom extract or guess its Element name.

atomicNumber :: Element -> Int Source

Atomic number of a given element

atomicMass :: Element -> Double Source

Atomic mass of a given element in g/mol

covalentRadius :: (Eq a1, Fractional a, Show a1, IsString a1) => a1 -> a Source

Covalent radius of an element with a given name.

vanDerWaalsRadius :: Element -> Double Source

Van der Waals radius of the given element