How lukfor/pgs-calc works
Project Type and Purpose
This is a command-line tool for applying polygenic scores (PGS) on imputed genotypes, primarily interacting with genetic data and the PGS Catalog.
Main Components
A. Core Components:
• Input Processing System
• Score Processing Engine
• File Management System
• Report Generation System
• Command Interface Layer
B. External Integrations:
• PGS Catalog API
• dbSNP Database
• File System (VCF, Score files)
Command Layer (Top Level)
• Subcomponents for each major command:
• Apply Score
• Download Score
• Resolve Score
• Create Report
• LiftOver Score
Processing Core (Middle Layer)
• Subcomponents:
• Variant Processing
• Score Calculation
• Quality Control
• Build Management
I/O Layer (Bottom Layer)
• Input Handlers:
• VCF File Reader
• Score File Reader
• Sample File Reader
• Output Handlers:
• Score Writer
• Report Generator
• Variant Writer
External Services (Side Connections)
• PGS Catalog Integration
• dbSNP Database
• Chain File System
Use the following visual elements:
• Rectangular containers for major components
• Rounded rectangles for subcomponents
• Blue: Command Layer
• Green: Processing Core
• Yellow: I/O Layer
• Gray: External Services
Important Relationships to Show:
Data Flow
• Input files → File Readers → Processing Core → Output Writers
• Command Interface → Processing Core
• External Services → Processing Core
Component Dependencies
• How the command layer orchestrates the processing core
• How the I/O layer supports both input and output operations
• Demonstrate external service integration points
Key Architectural Patterns to Highlight:
Command Pattern
• How each command class in the commands package interfaces with the core system
Factory Pattern
• RiskScoreFormatFactory for handling different file formats
Task-based Processing
• Task system for major operations (ApplyScore, CreateReport, etc.)
Level of Detail:
• Keep main components visible at a glance
• Use nested containers to show subcomponents
• Class names from the codebase
• Major data flows and dependencies
The flexibility in handling different file formats and builds
• Component types
• Any abbreviations used
This will create a comprehensive yet clear visualization of the PGS Calculator's architecture while maintaining the appropriate level of detail for a principal software engineer to understand the system's structure and interactions.