Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Due to the complexity of interacting with the graph database, the mapper for entities has been separated into its own service. This module contains functions for converting various types of data from the database into the corresponding Haskell types.
Synopsis
- toRawReactionDetails :: ReactionDetails -> IO RawReactionDetailsMask
- toMechanismDetails :: RawMechanismDetails -> IO MechanismDetails
- toReactionDetails :: (RawReactionDetails, Maybe MechanismNode) -> IO (ReactionDetails, Maybe MechanismID)
- toReaction :: ReactionNode -> IO Reaction
- toPath :: Path -> IO PathMask
Documentation
toRawReactionDetails :: ReactionDetails -> IO RawReactionDetailsMask #
Converts a ReactionDetails
structure into a RawReactionDetailsMask
.
Extracts the relevant node and relationship masks from the reaction details,
mapping the interactants (reagents, products, and catalysts) and reaction
conditions into raw representations that are suitable for database storage.
Parameters:
ReactionDetails
- the details of the reaction, including interactants and conditions.
Returns:
RawReactionDetailsMask
representing the raw version of reaction details for database operations.
toMechanismDetails :: RawMechanismDetails -> IO MechanismDetails #
Converts raw mechanism details to a structured MechanismDetails
format.
Maps the raw data to more meaningful structures that represent mechanisms,
stages, and interactants.
Parameters:
RawMechanismDetails
containing the raw data of the mechanism, interactants, included entities, stages, and follow-up information.
Returns:
MechanismDetails
representing the mechanism with its context and associated stages and interactants.
toReactionDetails :: (RawReactionDetails, Maybe MechanismNode) -> IO (ReactionDetails, Maybe MechanismID) #
Converts raw reaction details retrieved from the database into a structured
format of ReactionDetails
.
This function processes the reaction, reagents, products, inbound and outbound
relationships, catalysts, and acceleration factors, and also processes an optional
mechanism if one is associated with the reaction.
Parameters:
(RawReactionDetails, Maybe MechanismNode)
- The raw reaction details and optional mechanism node.
Returns:
- A tuple of
ReactionDetails
and an optionalMechanismID
, representing the reaction's details and an associated mechanism ID, if applicable.
toReaction :: ReactionNode -> IO Reaction #
Converts a raw ReactionNode
into a Reaction
structure.
Parameters:
ReactionNode
- the raw reaction node retrieved from the database.
Returns:
Reaction
representing the processed reaction node, with only the reaction data.