How barrydigby/pycircdb works
Main components
• Core Application (pycircdb Package): This is the heart of the system. It includes the main executable (__main__.py) and the central module (pycircdb.py). It orchestrates operations.
• Utilities Module: Found under “pycircdb/utils”, these submodules handle tasks such as:
– Configuration management (config.py and config_defaults.yaml).
– Data ingestion (ingest.py and the “ingest2” subfolder where ingestion for circRNAs, miRNAs, and mRNAs are further defined).
– Data filtering (filter_circrnas.py, filter_genes.py, filter_mirnas.py).
– Annotation (annotate.py) and reporting (report.py).
– Helpers and parameter validation (helpers.py, parameter_check.py).
– Building complex networks (build_network.py) and logging (log.py and simple_log.py).
– Test utilities (test_helpers.py)
• Test & Sample Data Layer: Represented by the “test_data” folder with various sample and test input files (e.g., CSV, TXT, FASTA files). This is crucial for development, testing, and validation.
• Setup and Deployment: The presence of “setup.py” and configuration files (.gitignore, update_gitignore.sh) indicates standard packaging and deployment practices.
Relationships and Interactions
• The Core Application calls upon various Utilities for parsing input files, validating parameters, and building intermediary data representations.
• The ingestion modules read in large datasets referenced in the README (e.g., circ2disease, circatlas, circbank, etc.)—each of which could be conceptualized as separate “external” data sources.
• The configuration module loads defaults and user-specified parameters that drive the ingestion and filtering process.
• Output from these modules flows into reporting and network-building routines which may then be rendered and visualized (using d3example.py or notebooks).
• Testing and schema viewing (view_schema.py) provide feedback loops during development.
Architectural Patterns and Design Principles
• Modular Design: The project is organized into a core package and distinct utility modules, demonstrating separation of concerns.
• Pipeline/Workflow Pattern: Data flows through ingestion, filtering, annotation, reporting, and visualization.
• Config-Driven Behavior: The use of a YAML configuration file hints at an architecture where behavior can be modified by changing external files.
• Reusability and Extensibility: Multiple “ingest” modules and the existence of helper scripts suggest that new data sources or processing modules can be added as independent components.
Relevant Technologies and Frameworks
• Python as the primary programming language.
• YAML for configuration.
• Jupyter Notebooks for interactive analysis.
• Dask (as hinted by dask_shit.ipynb and checkpoint names) to parallelize or handle large data workflows.
• Possibly D3.js (via d3example.py) for producing web-based visualizations of network data.
• Packaging tools (setup.py) for distribution and installation.
Essential Elements
• “Configuration Manager” (config.py and config_defaults.yaml).
• “Data Ingestion & Parsing” components (ingest.py, ingest2 submodules).
• “Filtering/Validation” components (filter_circrnas.py, filter_genes.py, filter_mirnas.py, parameter_check.py).
• “Annotation & Reporting” (annotate.py, report.py).
• “Network Construction” (build_network.py).
• “Logging & Helpers” (log.py, simple_log.py, helpers.py).
• “Visualization/Interactive Analysis” (d3example.py, notebooks, view_schema.py).
• “Test Data & External Databases” layer (test_data, external reference files as described).
• From External Data Sources -> Data Ingestion.
• From Configuration Manager into every processing module (ensuring configuration is applied).
• From Ingestion and Filtering -> Annotation & Reporting.
• From Reporting -> Visualization.