You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Automatically generate visual dependency graphs from BioSpec specifications to show analysis workflow structure, data flow, and relationships between project entities.
Motivation
Current state:
Dependencies listed as text in intent.md (e.g., "InferCNV cannot be run without cell annotations")
Relationships described in relationships.md (RQ → Dataset mappings)
No visual representation of workflow structure or bottlenecks
Difficult to identify parallel vs sequential analyses
Hard to communicate project structure to stakeholders
Data flow diagrams showing how datasets feed into analyses
RQ-Dataset-Analysis relationship maps
Interactive or static visualizations embedded in docs
Proposed Visualization Types
1. Analysis Pipeline DAG (Directed Acyclic Graph)
Shows: Sequential and parallel analysis steps
Example visualization:
Raw Data → QC → Normalization → Batch Correction
↓
Clustering ←→ Marker ID
↓ ↓
UMAP/tSNE Cell Type Anno
↓ ↓
└──→ DE Analysis
↓
Pathway Analysis
↓
Visualization
Generated from:
intent.md: Analysis Objectives with dependencies
intent.md: Milestones (high-level phases)
project_overview.md: Computational Activities in Scope
2. Dataset-RQ-Analysis Network
Shows: Which datasets feed which research questions via which analyses
graph TD
A[Raw FASTQ] --> B[Quality Control]
B --> C[Alignment]
C --> D[Quantification]
D --> E[Count Matrix]
E --> F[Normalization]
F --> G{Analysis Branch}
G --> H[Clustering]
G --> I[Differential Expression]
H --> J[Cell Type Annotation]
I --> K[Pathway Analysis]
J --> L[Visualization]
K --> L
style A fill:#e1f5ff
style L fill:#ffe1e1
Node colors based on type (data=green, analysis=blue, output=red)
Edge labels showing data types
Estimated time/resources per node
Status indicators (complete/in-progress/pending)
Example enhanced Mermaid:
graph TD
A[Dataset 1: scRNA-seq<br/>50 samples, 10GB]:::dataset
B[QC<br/>~2 hrs, 16GB RAM]:::analysis
C[Normalization<br/>~1 hr, 8GB RAM]:::analysis
D[Clustering<br/>~3 hrs, 32GB RAM]:::analysis
A -->|H5AD| B
B -->|Filtered H5AD| C
C -->|Normalized| D
classDef dataset fill:#c3e6cb,stroke:#28a745
classDef analysis fill:#cce5ff,stroke:#007bff
Loading
Phase 3: Interactive Features (Advanced)
For web exports:
Click nodes to see details
Filter graph by RQ or dataset
Show/hide analysis branches
Zoom and pan
Highlight critical path
Technology: D3.js or similar
Phase 4: Live Updates
During project execution:
Update graphs as analyses complete
Add status badges to nodes (✅ done, 🔄 running, ⬜ pending)
Show current bottlenecks
Update with actual vs estimated resources
Graph Generation Rules
From intent.md Dependencies
Text format:
## Dependencies- Cell type annotation must be completed before differential expression
- InferCNV requires cell annotations
- Batch correction must precede integration
Parsing logic:
Extract dependency statements
Identify "X before Y" or "Y requires X" patterns
Create directed edges: X → Y
Build DAG ensuring no cycles
Edge cases:
Circular dependencies → Flag error
Missing dependencies → Infer from common workflow patterns
Parallel analyses → Place at same rank
From intent.md Milestones
Text format:
## Milestones- Milestone 1: Data acquisition and QC (Week 1-2)
- Milestone 2: Preprocessing and normalization (Week 3-4)
- Milestone 3: Analysis and interpretation (Week 5-8)
Parsing logic:
Extract milestone sequence
Parse activities within each milestone
Create grouped nodes
Connect milestones sequentially
Extract timelines if present for Gantt chart
From relationships.md Mappings
Text format:
### RQ1-TME: What is the composition of the tumor microenvironment?**Relevant Datasets**:
- Dataset 1 (Melanoma scRNA-seq): Provides cell-type resolution
- Dataset 2 (Visium spatial): Provides spatial context
Parsing logic:
Extract RQ identifier and title
Extract associated datasets
Extract associated analyses (from same section or intent.md)
Overview
Automatically generate visual dependency graphs from BioSpec specifications to show analysis workflow structure, data flow, and relationships between project entities.
Motivation
Current state:
intent.md(e.g., "InferCNV cannot be run without cell annotations")relationships.md(RQ → Dataset mappings)Desired outputs:
Proposed Visualization Types
1. Analysis Pipeline DAG (Directed Acyclic Graph)
Shows: Sequential and parallel analysis steps
Example visualization:
Generated from:
intent.md: Analysis Objectives with dependenciesintent.md: Milestones (high-level phases)project_overview.md: Computational Activities in Scope2. Dataset-RQ-Analysis Network
Shows: Which datasets feed which research questions via which analyses
Example visualization:
Generated from:
relationships.md: RQ vs Datasets mappingintent.md: Research Questionsdatasets.md: Dataset list3. Data Flow Diagram
Shows: How data transforms through pipeline stages
Example visualization:
Generated from:
datasets.md: Data types and processing levelsintent.md: Analysis objectives (processing steps)4. Resource-Analysis Dependency
Shows: Which analyses require which computational resources
Example visualization:
Generated from:
project_resources.md: Hardware specsintent.md: Analysis objectivesMarkdown-Based Visualization Approaches
Approach 1: Mermaid.js (Recommended)
Pros:
Example Mermaid syntax for DAG:
graph TD A[Raw FASTQ] --> B[Quality Control] B --> C[Alignment] C --> D[Quantification] D --> E[Count Matrix] E --> F[Normalization] F --> G{Analysis Branch} G --> H[Clustering] G --> I[Differential Expression] H --> J[Cell Type Annotation] I --> K[Pathway Analysis] J --> L[Visualization] K --> L style A fill:#e1f5ff style L fill:#ffe1e1Example Mermaid for RQ-Dataset mapping:
graph LR D1[Dataset 1: scRNA-seq] --> RQ1[RQ1: TME Composition] D2[Dataset 2: Visium] --> RQ1 D2 --> RQ2[RQ2: Spatial Patterns] D3[Dataset 3: Public Ref] --> RQ1 RQ1 --> A1[Clustering] RQ1 --> A2[DE Analysis] RQ2 --> A3[Spatial Stats] style D1 fill:#c3e6cb style D2 fill:#c3e6cb style D3 fill:#c3e6cb style RQ1 fill:#fff3cd style RQ2 fill:#fff3cdGitHub rendering: ✅ Automatic (wrap in ```mermaid code blocks)
Approach 2: GraphViz DOT Language
Pros:
Cons:
Example DOT syntax:
Rendering options:
dotcommandApproach 3: ASCII/Unicode Text Diagrams
Pros:
Cons:
Example ASCII:
Tools to help:
boxes(CLI tool for ASCII boxes)Approach 4: PlantUML
Pros:
Cons:
Example PlantUML:
Approach 5: D3.js / Observable Notebooks
Pros:
Cons:
Use case: Advanced interactive dashboards for stakeholder presentations
Implementation Strategy
Phase 1: Mermaid-Based Basic Graphs
Deliverable: Auto-generate Mermaid diagrams from specs
Implementation:
intent.mdfor analysis objectives and dependenciesrelationships.mdfor RQ-Dataset mappingsproject/directory as_analysis_dag.mdand_rq_dataset_map.mdCommand:
/biospec.generate_graphsExample output file structure:
Phase 2: Enhanced with Metadata
Add to graphs:
Example enhanced Mermaid:
graph TD A[Dataset 1: scRNA-seq<br/>50 samples, 10GB]:::dataset B[QC<br/>~2 hrs, 16GB RAM]:::analysis C[Normalization<br/>~1 hr, 8GB RAM]:::analysis D[Clustering<br/>~3 hrs, 32GB RAM]:::analysis A -->|H5AD| B B -->|Filtered H5AD| C C -->|Normalized| D classDef dataset fill:#c3e6cb,stroke:#28a745 classDef analysis fill:#cce5ff,stroke:#007bffPhase 3: Interactive Features (Advanced)
For web exports:
Technology: D3.js or similar
Phase 4: Live Updates
During project execution:
Graph Generation Rules
From
intent.mdDependenciesText format:
Parsing logic:
Edge cases:
From
intent.mdMilestonesText format:
Parsing logic:
From
relationships.mdMappingsText format:
Parsing logic:
From
datasets.mdProcessing LevelsText format:
Parsing logic:
Visualization Quality Guidelines
Node Design
Edge Design
Layout Principles
Accessibility
Integration Points
With Project Templates
/biospec.create_projectworkflowWith Validation Tool
With Review Tool
With GitHub Workflow
Technical Implementation
File Structure
Command Interface
Code Structure
Dependency Parsing Patterns
Pattern matching for dependencies:
NLP approach (advanced):
Example Outputs
Complete Analysis Pipeline DAG
graph TD START([Project Start]) D1[Dataset 1: scRNA-seq<br/>50 patients] D2[Dataset 2: Visium<br/>10 patients] START --> D1 START --> D2 D1 --> QC1[QC: scRNA-seq<br/>Filter cells, Remove doublets] D2 --> QC2[QC: Spatial<br/>Tissue detection] QC1 --> NORM1[Normalization<br/>SCTransform] QC2 --> NORM2[Normalization<br/>Spatial method] NORM1 --> CLUST[Clustering<br/>Leiden algorithm] CLUST --> ANNO[Cell Type Annotation<br/>Reference-based] ANNO --> DE[Differential Expression<br/>MAST] ANNO --> INFERCNV[InferCNV<br/>Malignant scoring] NORM2 --> SPATIAL[Spatial Analysis<br/>Moran's I] DE --> PATH[Pathway Analysis<br/>GSEA] INFERCNV --> INT[Integration<br/>scRNA + Spatial] SPATIAL --> INT PATH --> VIZ[Visualization<br/>Figures] INT --> VIZ VIZ --> END([Manuscript]) style START fill:#f9f9f9 style END fill:#f9f9f9 style D1 fill:#c3e6cb style D2 fill:#c3e6cb style QC1 fill:#cce5ff style QC2 fill:#cce5ff style CLUST fill:#fff3cd style VIZ fill:#ffe1e1RQ-Dataset-Analysis Network
graph LR subgraph Datasets D1[Dataset 1<br/>scRNA-seq] D2[Dataset 2<br/>Visium] D3[Dataset 3<br/>Public Ref] end subgraph Research Questions RQ1[RQ1: TME<br/>Composition] RQ2[RQ2: Spatial<br/>Patterns] RQ3[RQ3: Malignant<br/>Features] end subgraph Analyses A1[Clustering] A2[DE] A3[Spatial Stats] A4[InferCNV] A5[Reference<br/>Mapping] end D1 --> RQ1 D1 --> RQ3 D2 --> RQ2 D2 --> RQ1 D3 --> RQ1 RQ1 --> A1 RQ1 --> A2 RQ2 --> A3 RQ3 --> A4 RQ1 --> A5 style D1 fill:#c3e6cb style D2 fill:#c3e6cb style D3 fill:#c3e6cb style RQ1 fill:#fff3cd style RQ2 fill:#fff3cd style RQ3 fill:#fff3cdEdge Cases & Considerations
Complex Branching
Representation: Dashed lines for optional/alternative paths
Iterative Processes
Representation: Feedback loops with dashed arrows, or note as iterative
Parallel Workflows
Representation: Place at same rank/level
Large Complex Projects
Solutions:
Success Metrics
Useful visualization if:
Related Issues
Priority
Medium: Would significantly improve project understanding and communication, but not blocking for core functionality.
Implementation order:
intent.mdrelationships.md