Adding new generate_recipes command to generate recipes from a template recipe .json and design matrix .csv - #156
Open
BenEmeryCMD wants to merge 5 commits into
Open
Adding new generate_recipes command to generate recipes from a template recipe .json and design matrix .csv#156BenEmeryCMD wants to merge 5 commits into
BenEmeryCMD wants to merge 5 commits into
Conversation
… save them directly as JSON files. Edited other functions to update recipe generator output to match expected CAR upload format.
Owner
|
@BenEmeryCMD this is awesome, and thanks for requesting your very first pull request for CAR! Can you please:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR improves the Recipe Generator workflow by enabling direct export of generated recipes as JSON files and updating the generated recipe schema to be compatible with CAR recipe upload requirements.
Previously, recipes generated via the Recipe Generator were only returned to the shell as Python dictionaries, requiring manual copy/paste before they could be saved or imported into CAR. This PR adds an export pathway and aligns the generated output with the format expected by CAR.
Changes
Recipe JSON export
.jsonfiles.output_dirsupport to recipe generation methods.Command-line recipe generation
This allows recipe generation to be performed from the command line without manually running Python code in a shell.
CAR schema compatibility
Updated generated recipe output to better match the schema expected by CAR:
reaction_classfield.reaction_classautomatically from the base recipe definition.sessions→action_sessions.recipewrapper and flattened recipe contents into the top-level output structure.equivalents→amount.Example
Previous output
{ "name": "BE_Urea_1", "template": "260423_BE_Urea_screen_1", "base": "Urea formation.standard", "recipe": { "estimated_yield": 100, "sessions": [...] } }New output
{ "reaction_class": "Urea formation", "name": "BE_Urea_1", "template": "260423_BE_Urea_screen_1", "base": "Urea formation.standard", "estimated_yield": 100, "reaction_smarts": [...], "action_sessions": [...] }Motivation
This change removes the need for manual copy/paste of generated recipes and allows recipes produced by the Recipe Generator to be imported directly into CAR with minimal or no post-processing.
Testing
Tested using existing validated recipe templates and design matrices.
Verified that:
reaction_class.action_sessionsrather thansessions.amountrather thanequivalents.P.S.
Removed "." from enamine real tools script to fix import issues.