mmtf 0.1.0.0 → 0.1.0.1
raw patch · 4 files changed
+110/−79 lines, 4 filesPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
API changes (from Hackage documentation)
+ Bio.MMTF: AlphaHelix :: SecondaryStructure
+ Bio.MMTF: Assembly :: ![Transform] -> !Text -> Assembly
+ Bio.MMTF: AtomData :: !(Maybe [Int32]) -> !(Maybe [Char]) -> !(Maybe [Float]) -> ![Float] -> ![Float] -> ![Float] -> !(Maybe [Float]) -> AtomData
+ Bio.MMTF: Bend :: SecondaryStructure
+ Bio.MMTF: Bridge :: SecondaryStructure
+ Bio.MMTF: ChainData :: ![Int32] -> ![Text] -> !(Maybe [Text]) -> ChainData
+ Bio.MMTF: Coil :: SecondaryStructure
+ Bio.MMTF: Entity :: ![Int32] -> !Text -> !Text -> !Text -> Entity
+ Bio.MMTF: Extended :: SecondaryStructure
+ Bio.MMTF: FormatData :: !Text -> !Text -> FormatData
+ Bio.MMTF: GroupData :: ![GroupType] -> ![Int32] -> ![Int32] -> !(Maybe [SecondaryStructure]) -> !(Maybe [Char]) -> !(Maybe [Int32]) -> GroupData
+ Bio.MMTF: GroupType :: ![Int32] -> ![Text] -> ![Text] -> ![Int32] -> ![Int32] -> !Text -> !Char -> !Text -> GroupType
+ Bio.MMTF: MMTF :: !FormatData -> !StructureData -> !ModelData -> !ChainData -> !GroupData -> !AtomData -> MMTF
+ Bio.MMTF: ModelData :: ![Int32] -> ModelData
+ Bio.MMTF: PiHelix :: SecondaryStructure
+ Bio.MMTF: StructureData :: !(Maybe Text) -> !(Maybe Text) -> !(Maybe Text) -> !(Maybe Text) -> !Int32 -> !Int32 -> !Int32 -> !Int32 -> !Int32 -> !(Maybe Text) -> !(Maybe UnitCell) -> !(Maybe [[Float]]) -> !(Maybe [Assembly]) -> !(Maybe [Entity]) -> !(Maybe Float) -> !(Maybe Float) -> !(Maybe Float) -> !(Maybe [Text]) -> !(Maybe [Int32]) -> !(Maybe [Int8]) -> StructureData
+ Bio.MMTF: ThreeTenHelix :: SecondaryStructure
+ Bio.MMTF: Transform :: ![Int32] -> ![Float] -> Transform
+ Bio.MMTF: Turn :: SecondaryStructure
+ Bio.MMTF: Undefined :: SecondaryStructure
+ Bio.MMTF: UnitCell :: !Float -> !Float -> !Float -> !Float -> !Float -> !Float -> UnitCell
+ Bio.MMTF: [altLocList] :: AtomData -> !(Maybe [Char])
+ Bio.MMTF: [assemblyName] :: Assembly -> !Text
+ Bio.MMTF: [atomIdList] :: AtomData -> !(Maybe [Int32])
+ Bio.MMTF: [atom] :: MMTF -> !AtomData
+ Bio.MMTF: [bFactorList] :: AtomData -> !(Maybe [Float])
+ Bio.MMTF: [bioAssemblyList] :: StructureData -> !(Maybe [Assembly])
+ Bio.MMTF: [bondAtomList] :: StructureData -> !(Maybe [Int32])
+ Bio.MMTF: [bondOrderList] :: StructureData -> !(Maybe [Int8])
+ Bio.MMTF: [chainIdList] :: ChainData -> ![Text]
+ Bio.MMTF: [chainIndexList] :: Transform -> ![Int32]
+ Bio.MMTF: [chainNameList] :: ChainData -> !(Maybe [Text])
+ Bio.MMTF: [chain] :: MMTF -> !ChainData
+ Bio.MMTF: [chainsPerModel] :: ModelData -> ![Int32]
+ Bio.MMTF: [depositionDate] :: StructureData -> !(Maybe Text)
+ Bio.MMTF: [entityChainIndexList] :: Entity -> ![Int32]
+ Bio.MMTF: [entityDescription] :: Entity -> !Text
+ Bio.MMTF: [entityList] :: StructureData -> !(Maybe [Entity])
+ Bio.MMTF: [entitySequence] :: Entity -> !Text
+ Bio.MMTF: [entityType] :: Entity -> !Text
+ Bio.MMTF: [experimentalMethods] :: StructureData -> !(Maybe [Text])
+ Bio.MMTF: [format] :: MMTF -> !FormatData
+ Bio.MMTF: [groupIdList] :: GroupData -> ![Int32]
+ Bio.MMTF: [groupList] :: GroupData -> ![GroupType]
+ Bio.MMTF: [groupTypeList] :: GroupData -> ![Int32]
+ Bio.MMTF: [group] :: MMTF -> !GroupData
+ Bio.MMTF: [groupsPerChain] :: ChainData -> ![Int32]
+ Bio.MMTF: [gtAtomNameList] :: GroupType -> ![Text]
+ Bio.MMTF: [gtBondAtomList] :: GroupType -> ![Int32]
+ Bio.MMTF: [gtBondOrderList] :: GroupType -> ![Int32]
+ Bio.MMTF: [gtChemCompType] :: GroupType -> !Text
+ Bio.MMTF: [gtElementList] :: GroupType -> ![Text]
+ Bio.MMTF: [gtFormalChargeList] :: GroupType -> ![Int32]
+ Bio.MMTF: [gtGroupName] :: GroupType -> !Text
+ Bio.MMTF: [gtSingleLetterCode] :: GroupType -> !Char
+ Bio.MMTF: [insCodeList] :: GroupData -> !(Maybe [Char])
+ Bio.MMTF: [matrix] :: Transform -> ![Float]
+ Bio.MMTF: [mmtfProducer] :: FormatData -> !Text
+ Bio.MMTF: [mmtfVersion] :: FormatData -> !Text
+ Bio.MMTF: [model] :: MMTF -> !ModelData
+ Bio.MMTF: [ncsOperatorList] :: StructureData -> !(Maybe [[Float]])
+ Bio.MMTF: [numAtoms] :: StructureData -> !Int32
+ Bio.MMTF: [numBonds] :: StructureData -> !Int32
+ Bio.MMTF: [numChains] :: StructureData -> !Int32
+ Bio.MMTF: [numGroups] :: StructureData -> !Int32
+ Bio.MMTF: [numModels] :: StructureData -> !Int32
+ Bio.MMTF: [occupancyList] :: AtomData -> !(Maybe [Float])
+ Bio.MMTF: [rFree] :: StructureData -> !(Maybe Float)
+ Bio.MMTF: [rWork] :: StructureData -> !(Maybe Float)
+ Bio.MMTF: [releaseDate] :: StructureData -> !(Maybe Text)
+ Bio.MMTF: [resolution] :: StructureData -> !(Maybe Float)
+ Bio.MMTF: [secStructList] :: GroupData -> !(Maybe [SecondaryStructure])
+ Bio.MMTF: [sequenceIndexList] :: GroupData -> !(Maybe [Int32])
+ Bio.MMTF: [spaceGroup] :: StructureData -> !(Maybe Text)
+ Bio.MMTF: [structureId] :: StructureData -> !(Maybe Text)
+ Bio.MMTF: [structure] :: MMTF -> !StructureData
+ Bio.MMTF: [title] :: StructureData -> !(Maybe Text)
+ Bio.MMTF: [transformList] :: Assembly -> ![Transform]
+ Bio.MMTF: [ucA] :: UnitCell -> !Float
+ Bio.MMTF: [ucAlpha] :: UnitCell -> !Float
+ Bio.MMTF: [ucB] :: UnitCell -> !Float
+ Bio.MMTF: [ucBeta] :: UnitCell -> !Float
+ Bio.MMTF: [ucC] :: UnitCell -> !Float
+ Bio.MMTF: [ucGamma] :: UnitCell -> !Float
+ Bio.MMTF: [unitCell] :: StructureData -> !(Maybe UnitCell)
+ Bio.MMTF: [xCoordList] :: AtomData -> ![Float]
+ Bio.MMTF: [yCoordList] :: AtomData -> ![Float]
+ Bio.MMTF: [zCoordList] :: AtomData -> ![Float]
+ Bio.MMTF: data Assembly
+ Bio.MMTF: data AtomData
+ Bio.MMTF: data ChainData
+ Bio.MMTF: data Entity
+ Bio.MMTF: data FormatData
+ Bio.MMTF: data GroupData
+ Bio.MMTF: data GroupType
+ Bio.MMTF: data MMTF
+ Bio.MMTF: data ModelData
+ Bio.MMTF: data SecondaryStructure
+ Bio.MMTF: data StructureData
+ Bio.MMTF: data Transform
+ Bio.MMTF: data UnitCell
Files
- README.md +17/−0
- mmtf.cabal +1/−1
- src/Bio/MMTF.hs +2/−2
- src/Bio/MMTF/Type.hs +90/−76
README.md view
@@ -0,0 +1,17 @@+MMTF Haskell Library+====================++[](https://travis-ci.org/zmactep/mmtf)+[](https://hackage.haskell.org/package/mmtf)+[](https://hackage.haskell.org/package/mmtf)++Haskell implementation of MMTF biological structure format.++Documentation+-------------++To build Haddock documentation run:+```+$ stack haddock+```+
mmtf.cabal view
@@ -1,5 +1,5 @@ name: mmtf-version: 0.1.0.0+version: 0.1.0.1 synopsis: Macromolecular Transmission Format implementation description: Haskell implementation of MMTF biological structure format. homepage: https://github.com/zmactep/mmtf#readme
src/Bio/MMTF.hs view
@@ -1,10 +1,10 @@ module Bio.MMTF- ( module T+ ( module Bio.MMTF.Type , decode ) where import Bio.MMTF.MessagePack ()-import Bio.MMTF.Type as T+import Bio.MMTF.Type import Data.ByteString.Lazy (ByteString) import Data.MessagePack (unpack)
src/Bio/MMTF/Type.hs view
@@ -3,115 +3,129 @@ import Data.Int (Int32, Int8) import Data.Text (Text) -data UnitCell = UnitCell { ucA :: !Float- , ucB :: !Float- , ucC :: !Float- , ucAlpha :: !Float- , ucBeta :: !Float- , ucGamma :: !Float+-- |Unit cell data+data UnitCell = UnitCell { ucA :: !Float -- ^length of side 'a'+ , ucB :: !Float -- ^length of side 'b'+ , ucC :: !Float -- ^length of side 'c'+ , ucAlpha :: !Float -- ^alpha angle in degrees+ , ucBeta :: !Float -- ^beta angle in degrees+ , ucGamma :: !Float -- ^gamma angle in degrees } deriving (Show, Eq) -data Transform = Transform { chainIndexList :: ![Int32]- , matrix :: ![Float]+-- |Transform data+data Transform = Transform { chainIndexList :: ![Int32] -- ^indices into the 'chainIdList' and 'chainNameList' fields+ , matrix :: ![Float] -- ^4x4 transformation matrix } deriving (Show, Eq) -data Assembly = Assembly { transformList :: ![Transform]- , assemblyName :: !Text+-- |Assembly data+data Assembly = Assembly { transformList :: ![Transform] -- ^List of transform objects+ , assemblyName :: !Text -- ^Name of the biological assembly } deriving (Show, Eq) -data Entity = Entity { entityChainIndexList :: ![Int32]- , entityDescription :: !Text- , entityType :: !Text- , entitySequence :: !Text+-- |Entity data+data Entity = Entity { entityChainIndexList :: ![Int32] -- ^indices into the 'chainIdList' and 'chainNameList' fields+ , entityDescription :: !Text -- ^Description of the entity+ , entityType :: !Text -- ^Name of the entity type+ , entitySequence :: !Text -- ^Sequence of the full construct in one-letter-code } deriving (Show, Eq) -data GroupType = GroupType { gtFormalChargeList :: ![Int32]- , gtAtomNameList :: ![Text]- , gtElementList :: ![Text]- , gtBondAtomList :: ![Int32]- , gtBondOrderList :: ![Int32]- , gtGroupName :: !Text- , gtSingleLetterCode :: !Char- , gtChemCompType :: !Text+-- |Group type data+data GroupType = GroupType { gtFormalChargeList :: ![Int32] -- ^List of formal charges+ , gtAtomNameList :: ![Text] -- ^List of atom names+ , gtElementList :: ![Text] -- ^List of elements+ , gtBondAtomList :: ![Int32] -- ^List of bonded atom indices+ , gtBondOrderList :: ![Int32] -- ^List of bond orders+ , gtGroupName :: !Text -- ^The name of the group+ , gtSingleLetterCode :: !Char -- ^The single letter code+ , gtChemCompType :: !Text -- ^The chemical component type } deriving (Show, Eq) -data SecondaryStructure = PiHelix -- 0- | Bend -- 1- | AlphaHelix -- 2- | Extended -- 3- | ThreeTenHelix -- 4- | Bridge -- 5- | Turn -- 6- | Coil -- 7- | Undefined -- -1+-- |Protein secondary structure+data SecondaryStructure = PiHelix -- ^pi helix+ | Bend -- ^bend+ | AlphaHelix -- ^alpha helix+ | Extended -- ^extended+ | ThreeTenHelix -- ^3-10 helix+ | Bridge -- ^brigde+ | Turn -- ^turn+ | Coil -- ^coil+ | Undefined -- ^unknown structure deriving (Show, Eq) -data FormatData = FormatData { mmtfVersion :: !Text- , mmtfProducer :: !Text+-- |MMTF format data+data FormatData = FormatData { mmtfVersion :: !Text -- ^The version number of the specification the file adheres to+ , mmtfProducer :: !Text -- ^The name and version of the software used to produce the file } deriving (Show, Eq) -data StructureData = StructureData { title :: !(Maybe Text)- , structureId :: !(Maybe Text)- , depositionDate :: !(Maybe Text)- , releaseDate :: !(Maybe Text)- , numBonds :: !Int32- , numAtoms :: !Int32- , numGroups :: !Int32- , numChains :: !Int32- , numModels :: !Int32- , spaceGroup :: !(Maybe Text)- , unitCell :: !(Maybe UnitCell)- , ncsOperatorList :: !(Maybe [[Float]])- , bioAssemblyList :: !(Maybe [Assembly])- , entityList :: !(Maybe [Entity])- , resolution :: !(Maybe Float)- , rFree :: !(Maybe Float)- , rWork :: !(Maybe Float)- , experimentalMethods :: !(Maybe [Text])- , bondAtomList :: !(Maybe [Int32]) -- binary (type 4)- , bondOrderList :: !(Maybe [Int8]) -- binary (type 2)+-- |Structure data+data StructureData = StructureData { title :: !(Maybe Text) -- ^A short description of the structural data included in the file+ , structureId :: !(Maybe Text) -- ^An ID for the structure, for example the PDB ID if applicable+ , depositionDate :: !(Maybe Text) -- ^A date that relates to the deposition of the structure in a database+ , releaseDate :: !(Maybe Text) -- ^A date that relates to the release of the structure in a database+ , numBonds :: !Int32 -- ^The overall number of bonds+ , numAtoms :: !Int32 -- ^The overall number of atoms in the structure+ , numGroups :: !Int32 -- ^The overall number of groups in the structure+ , numChains :: !Int32 -- ^The overall number of chains in the structure+ , numModels :: !Int32 -- ^The overall number of models in the structure+ , spaceGroup :: !(Maybe Text) -- ^The Hermann-Mauguin space-group symbol+ , unitCell :: !(Maybe UnitCell) -- ^Array of six values defining the unit cell+ , ncsOperatorList :: !(Maybe [[Float]]) -- ^List of lists representing 4x4 transformation matrices that are stored linearly in row major order (transformation matrices describe noncrystallographic symmetry operations needed to create all molecules in the unit cell)+ , bioAssemblyList :: !(Maybe [Assembly]) -- ^List of instructions on how to transform coordinates for an array of chains to create (biological) assemblies+ , entityList :: !(Maybe [Entity]) -- ^List of unique molecular entities within the structure+ , resolution :: !(Maybe Float) -- ^The experimental resolution in Angstrom+ , rFree :: !(Maybe Float) -- ^The R-free value+ , rWork :: !(Maybe Float) -- ^The R-work value+ , experimentalMethods :: !(Maybe [Text]) -- ^List of experimental methods employed for structure determination+ , bondAtomList :: !(Maybe [Int32]) -- ^Pairs of values represent indices of covalently bonded atoms [binary (type 4)]+ , bondOrderList :: !(Maybe [Int8]) -- ^List of bond orders for bonds in 'bondAtomList' [binary (type 2)] } deriving (Show, Eq) -data ModelData = ModelData { chainsPerModel :: ![Int32] }+-- |Models data+data ModelData = ModelData { chainsPerModel :: ![Int32] -- ^List of the number of chains in each model+ } deriving (Show, Eq) -data ChainData = ChainData { groupsPerChain :: ![Int32]- , chainIdList :: ![Text] -- binary (type 5, length 4)- , chainNameList :: !(Maybe [Text]) -- binary (type 5, length 4)+-- |Chains data+data ChainData = ChainData { groupsPerChain :: ![Int32] -- ^List of the number of groups (aka residues) in each chain+ , chainIdList :: ![Text] -- ^List of chain IDs [binary (type 5)]+ , chainNameList :: !(Maybe [Text]) -- ^List of chain names [binary (type 5)] } deriving (Show, Eq) -data GroupData = GroupData { groupList :: ![GroupType]- , groupTypeList :: ![Int32] -- binary (type 4)- , groupIdList :: ![Int32] -- binary (type 8)- , secStructList :: !(Maybe [SecondaryStructure]) -- binary (type 2)- , insCodeList :: !(Maybe [Char]) -- binary (type 6)- , sequenceIndexList :: !(Maybe [Int32]) -- binary (type 8)+-- |Groups data+data GroupData = GroupData { groupList :: ![GroupType] -- ^List of groupType objects+ , groupTypeList :: ![Int32] -- ^List of pointers to 'groupType' entries in 'groupList' by their keys[binary (type 4)]+ , groupIdList :: ![Int32] -- ^List of group (residue) numbers [binary (type 8)]+ , secStructList :: !(Maybe [SecondaryStructure]) -- ^List of secondary structure assignments [binary (type 2)]+ , insCodeList :: !(Maybe [Char]) -- ^List of insertion codes, one for each group (residue) [binary (type 6)]+ , sequenceIndexList :: !(Maybe [Int32]) -- ^List of indices that point into the sequence property of an entity object in the 'entityList' field that is associated with the chain the group belongs to [binary (type 8)] } deriving (Show, Eq) -data AtomData = AtomData { atomIdList :: !(Maybe [Int32]) -- binary (type 8)- , altLocList :: !(Maybe [Char]) -- binary (type 6)- , bFactorList :: !(Maybe [Float]) -- binary (type 10)- , xCoordList :: ![Float] -- binary (type 10)- , yCoordList :: ![Float] -- binary (type 10)- , zCoordList :: ![Float] -- binary (type 10)- , occupancyList :: !(Maybe [Float]) -- binary (type 9)+-- |Atoms data+data AtomData = AtomData { atomIdList :: !(Maybe [Int32]) -- ^List of atom serial numbers [binary (type 8)]+ , altLocList :: !(Maybe [Char]) -- ^List of alternate location labels, one for each atom [binary (type 6)]+ , bFactorList :: !(Maybe [Float]) -- ^List of atom B-factors in in A^2, one for each atom [binary (type 10)]+ , xCoordList :: ![Float] -- ^List of x atom coordinates in A, one for each atom [binary (type 10)]+ , yCoordList :: ![Float] -- ^List of y atom coordinates in A, one for each atom [binary (type 10)]+ , zCoordList :: ![Float] -- ^List of z atom coordinates in A, one for each atom [binary (type 10)]+ , occupancyList :: !(Maybe [Float]) -- ^List of atom occupancies, one for each atom [binary (type 9)] } deriving (Show, Eq) -data MMTF = MMTF { format :: !FormatData- , structure :: !StructureData- , model :: !ModelData- , chain :: !ChainData- , group :: !GroupData- , atom :: !AtomData+-- |MMTF datatype+data MMTF = MMTF { format :: !FormatData -- ^MMTF format data+ , structure :: !StructureData -- ^Biological structure data+ , model :: !ModelData -- ^Models data+ , chain :: !ChainData -- ^Chains data+ , group :: !GroupData -- ^Groups data+ , atom :: !AtomData -- ^Atoms data } deriving (Show, Eq)