How dpeerlab/seacells works
Main Components
• Core Python Library – Represent the heart of SEACells. This includes the principal modules within the SEACells package such as:
• core.py and build_graph.py: Handling the main aggregation and graph-building logic.
• cpu.py and gpu.py (including cpu_dense.py): These modules illustrate the implementation of alternative computation methods (parallel execution on CPU and GPU).
• accessibility.py, preprocess.py, tfactivity.py, genescores.py, evaluate.py: Dedicated modules for various data analyses (e.g., computing gene scores, TF activity, evaluation procedures).
• domainadapt.py: Implements cross-modality integration, especially between scRNA and scATAC data.
• Additional utility modules: utils.py and version.py (for common utility functions and versioning).
• Data and Input Components – Show how sample data and ancillary inputs are used:
• The Data folder (with sample_data.h5ad) indicates where test and demo datasets are stored.
• Notebooks folder: Contains multiple Jupyter notebooks (e.g., ArchR-related workflows, ATAC analysis, COVID integration) that demonstrate usage, preprocessing, computation, and integration procedures.
• SEACells/Rscripts: A subdirectory housing R scripts (e.g., chromVAR.R, tanay.R) which indicate integrations with R-based tools.
• Installation and Environment – Although not a "runtime" component, illustrate these aspects to explain deployment:
• Files like setup.py, requirements.txt, and environment.yaml represent the build and installation configuration.
• Pre-commit hooks and configuration files (e.g., .editorconfig, .gitignore, .pre-commit-config.yaml) show development tooling but can be grouped as auxiliary setup modules.
Relationships and Data Flow
• Input Data Flow: Show the data input (from the "data" directory and externally provided files) moving into preprocessing routines (preprocess.py and the ArchR notebooks).
• Processing and Core Computation: Demonstrate the flow from preprocessing to core aggregation (via core.py, build_graph.py), and then branching out:
• Two computation pathways: one through CPU-based methods (cpu.py, cpu_dense.py) and one utilizing GPU acceleration (gpu.py).
• Downstream analysis modules (accessibility.py, genescores.py, tfactivity.py) receive processed data to perform specific bioinformatics analyses.
• Domain adaptation (domainadapt.py) links or integrates outputs from different data modalities.
• Visualization and Reporting: Notebooks and plotting scripts (plot.py) serve as the front end for data visualization and result interpretation.
• R Integration: Represent the R scripts as a parallel processing or complementary analysis pathway integrating with the main Python workflow, suggesting bi-directional data exchange or alternative execution environments.
Architectural Patterns and Design Principles
• Modularity: Each module (computation, analysis, processing) is self-contained, with clear separation of concerns.
• Extensibility: The presence of both CPU and GPU modules indicates that the system can be extended to harness different hardware architectures.
• Interoperability: Support for both Python and R (via Rscripts) emphasizes the tool’s ability to integrate with a broader bioinformatics ecosystem.
• Dependency Management: Use of pip, conda, and configuration files (setup.py, environment.yaml) should be noted to reflect how external libraries are managed.