How zaiwen/mr-mas works
MR-MAS turns an exposure–outcome research question into a reviewed Mendelian Randomization manuscript. Its documented stages cover planning, GWAS retrieval and preparation, local MR execution, interpretation, writing, and paper review; the workflow controller coordinates those stages. The source excerpts confirm key controller, engine, literature, and inference relationships, while several stage links rely on the README. Shared memory and human checkpoints are documented capabilities, but their implementation is not identifiable in the supplied excerpts, so they are represented at the documented subsystem level.
Main entry points: MR-MAS-main.py Workflow Controller · mr_code_engine.py MR Execution · manuscript_engine.py Manuscript Generation · agents.py Specialist Agents
Components 21
Workflow Coordination
- Workflow Controller
MR-MAS-main.py - Specialist Agents
agents.py - Validation And Repair
MR-MAS-main.py - Shared Memory
MR-MAS-main.py
MR Analysis
- Trait Matching
tools.py - GWAS Retrieval
tools.py - Instrument Preparation
MR-MAS-main.py - Prepared GWAS Data
research_results/processed_data - MR Execution
mr_code_engine.py - MR Knowledge Base
root_library - Analysis Artifacts
research_results/results
Interpretation And Writing
- Results Interpretation
agents.py - Literature Retrieval
PubmedSearch.py - Manuscript Generation
manuscript_engine.py - Paper Review
agents.py
Other components
- Researcher
- LLM Services
- GWAS Catalog
- PubMed And PMC
- Local R Runtime
- LaTeX Compiler
Connections 23
- Researcher → Workflow Controller: submits objective
README.md - Workflow Controller → Specialist Agents: coordinates agents
MR-MAS-main.py - Workflow Controller → Trait Matching: normalizes traits
README.md - Workflow Controller → GWAS Retrieval: retrieves studies
README.md - GWAS Retrieval → GWAS Catalog: queries
README.md - Workflow Controller → Instrument Preparation: prepares datasets
README.md - Instrument Preparation → Prepared GWAS Data: stores prepared data
README.md - Workflow Controller → MR Execution: starts analysis
MR-MAS-main.py - MR Execution → Prepared GWAS Data: reads inputs
mr_code_engine.py - MR Execution → Local R Runtime: executes scripts
README.md - MR Execution → MR Knowledge Base: uses method specifications
README.md - MR Execution → Analysis Artifacts: writes outputs
README.md - Workflow Controller → Results Interpretation: coordinates interpretation
README.md - Specialist Agents → LLM Services: requests inference
- Workflow Controller → Manuscript Generation: starts drafting
MR-MAS-main.py - Manuscript Generation → Literature Retrieval: retrieves references
manuscript_engine.py - Literature Retrieval → PubMed And PMC: searches and fetches
PubmedSearch.py - Manuscript Generation → LLM Services: generates text
- Manuscript Generation → LaTeX Compiler: compiles draft
README.md - Workflow Controller → Paper Review: coordinates review
README.md - Workflow Controller → Validation And Repair: validates stages
README.md - Validation And Repair → MR Execution: triggers repair
README.md - Workflow Controller → Shared Memory: retains artifacts
README.md