zacsims/PhysiCell-Rule-Builder
0
PhysiCell Rule Builder
A Streamlit application that helps generate rules for PhysiCell agent-based models by analyzing scientific literature related to cancer biology. The app provides a user-friendly interface to query relationships between cell types, signals, and behaviors in the context of triple negative breast cancer.
Features
- Select from predefined cell types, signals, and behaviors
- Generate rules based on scientific literature
- View detailed justifications with citations
- Browse all available rule combinations
- Cache results for faster retrieval
Usage
- Select a cell type from the dropdown
- Choose a signal associated with the selected cell type
- Select a behavior that might be affected by the signal
- Click "Generate Rule" to analyze the literature and create a PhysiCell rule
- View the generated rule and its justification
Requirements
- Python 3.11+
- Streamlit
- PaperQA 5.0+
- Access to papers organized by cell type
Local Development
To run the application locally:
- Clone this repository
- Install dependencies:
pip install -r requirements.txt - Run the Streamlit app:
streamlit run app.py
Paper Organization
The app expects papers to be organized in a directory structure like:
ohsu-immune-papers/
├── epithelial-tumor/
| ├── paper1.pdf
| ├── paper2.pdf
├── tumor/
| ├── paper1.pdf
| └── paper2.pdf
├── CD4+-Th2-T/
| └── ...
└── ...How It Works
The app uses PaperQA to process scientific papers, extract relevant information, and generate rules in the form:
"In [cell type], [signal] increases/decreases [behavior]."
These rules can then be used to configure PhysiCell agent-based models of cancer microenvironments.
Credits
Based on the PhysiCell framework (http://physicell.org/)
