This module provides tools to working with biomolecular structure.
fetchStructuralData : (Result Error StructuralData -> msg) -> String -> Platform.Cmd.Cmd msg
Fetches structural data from the PDBe.
Uses the PDBe REST API to request the PDB format string for the protein of interest, using the 4 character PDB code to identify the structure.
Msg = RequestedStructuralData (Result Error StructuralData)
fetchStructuralData RequestedStructuralData "4pn9"
parsePdbString : String -> String -> Result Error StructuralData
Attempts to convert a string containing PDB format data into
StructuralData
.
Describes how a fetching StructuralData
failed. The main errors arise
either when requesting the data or when parsing the response.
To avoid a myriad of problems that often arise when working this structural data,
structure is represented by a flat list of Atoms
. These lists of Atoms
can then be
processed into groups relating to connectivity. Functions to do this are described in
the next section.
{ serialNumber : Basics.Int
, name : String
, altLocation : Maybe String
, residueName : String
, chainId : Maybe String
, residueNumber : Basics.Int
, insertionCode : Maybe String
, position : { x : Basics.Float
, y : Basics.Float
, z : Basics.Float }
, occupancy : Maybe Basics.Float
, temperatureFactor : Maybe Basics.Float
, element : String
, charge : Maybe String
, stateNumber : Basics.Int
}
{ atoms : List Atom
, stateNumber : Basics.Int
, chainId : Maybe String
, residueName : String
, residueNumber : Basics.Int
}
{ atoms : List Atom
, stateNumber : Basics.Int
, chainId : Maybe String
}
{ atoms : List Atom
, stateNumber : Basics.Int
}
{ atoms : List Atom
, name : String
}
List of Atoms representing the whole structure file.
chains : List Atom -> List Chain
Converts a list of atoms ordered by chain number into a list of chains.
residues : List Atom -> List Residue
Converts a list of atoms ordered by residue number into a list of residues.
sequence : List Residue -> String
Creates a sequence string from a list of residues.
Uses single letter codes for amino acids if possible, otherwise it will use the three-letter code separated by dashes.
isProtein : Residue -> Basics.Bool
See miniBill/elm-codec for more information about using codecs
structuralDataCodec : Codec StructuralData