How devolearn/devograph works
Project Type and Purpose
• This is a research-oriented, full-stack computational project with several experimental pipelines. Its aim is to construct and analyze graphs (and even hypergraphs) that model cell development using temporal/directed GNNs.
• The README highlights different contributions that include constructing temporal graphs using KNN, re-implementing directed GNN models, image processing for cell tracking (Stage 1), and applying Topological Data Analysis (TDA, Stages 2 and 3). The project also branches out into hypergraph analyses (HyperDevoGraph) and diverse visualization outputs.
Analyzing the File Tree
• Several top-level directories (like Growing-GNN, HyperDevoGraph, devograph, stage_1, stage_2, stage_3) indicate that the project is organized into different experimental modules/pipelines.
• The “devograph” module is noteworthy, because it includes:
– /datasets: for constructing temporal graphs (e.g., via KNN and mother-daughter relationships as described in the README).
– /models: with implementations of a directed GNN (ct.py) and other models (gcn.py).
– /pipelines and /utils: that assemble and support the core methods.
• The “stage_” directories indicate different phases of processing:
– Stage 1 focuses on image processing and segmentation (cell tracking, mask segmentation, etc.).
– Stage 2 emphasizes applications of TDA using KMapper.
– Stage 3 contains further TDA efforts (lower star filtration, persistent homology).
• Other directories (Growing-GNN and HyperDevoGraph) also contain notebooks, scripts, and data related to alternative graph construction methods and hypergraph experiments.
a. Main Components:
• Data Collection & Preprocessing:
– Raw Data Storage: “data” directory (including MATLAB files, CSVs, videos, images, Excel files).
– Image Processing & Segmentation: Stage 1 (Cell Tracking Challenge and R-CNN Mask Segmentation components).
• Graph Construction and Transformation:
– Growing-GNN: Scripts like “graph.py”, “graph_nca.py” for constructing temporal graphs.
– devograph/datasets: Implements both the KNN-based temporal graph construction and directed graphs (datasets.py and datasets1.py).
• Model Building and Inference:
– GNN Models: Located in devograph/models (directed GNN in ct.py and conventional GCN).
– Pipeline Orchestration: devograph/pipelines which integrate data and model components.
• Postprocessing and Analysis:
– TDA Modules: Stage 2 (K-Mapper, output HTML visualizations) and Stage 3 (persistent homology and filtration notebooks).
– Hypergraph Analysis: HyperDevoGraph including notebooks (analysis_scripts), processed data, and visualizations.
• Visualization & Reporting:
– Visual outputs embedded in directories such as HyperDevoGraph/visualizations, and various notebooks in stage directories.
– Miscellaneous documentation and PDF (project design outlines, e.g., GSoC 2022 PDF).
• External Integration:
– APIs, dependency and environment management (requirements.txt, environment.yml in TDA folder) that support deployment and reproducibility.
b. Relationships and Interactions:
• A clear data flow that begins with raw data ingestion (images, CSV, MATLAB files) then proceeds through preprocessing modules (Stage 1) and graph construction (Growing-GNN, devograph/datasets).
• Graph construction modules to the GNN models (both the directed and GCN paths).
• Separate branches for analysis where the outputs of the models feed into TDA pipelines (Stage 2 and Stage 3) and hypergraph processing (HyperDevoGraph).
c. Architectural Patterns and Technologies:
• Abstraction of core logic in graph construction and GNN models – this modularity allows for swapping and testing different approaches.
• Use of notebook-based pipelines (e.g., .ipynb files) for prototyping and analysis.
• Language and framework indicators: Python scripts, use of environment/configuration files (requirements.txt, environment.yml), and the use of third-party frameworks for image processing and graph analysis (although not all are explicitly named, they can be inferred from file names and dependency lists).
• For a full-stack application, separate the backend processing (data ingestion, graph construction, GNN training) from the analysis/visualization layer.
Final Recommendations
• Keep the level of detail high by mapping out as many components as possible based on the file structure, but group similar experimental pipelines where appropriate.
• That any external libraries or frameworks (implied by the requirements files) are noted if they are central to data processing or model training.