chemist-preprocessor-0.1.0.0: Chemist Raw Data Preprocessor
Safe HaskellSafe-Inferred
LanguageHaskell2010

Domain.Converter.Converter

Description

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

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:

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 optional MechanismID, 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.

toPath :: Path -> IO PathMask #

Converts a raw database Path into a PathMask.

Parameters:

  • Path - the raw path data retrieved from the database.

Returns:

  • PathMask representing the processed path in a usable format.