How mseidelfed/cosnet_i works
Project Type and Purpose
• COSNeti is a scientific data-analysis pipeline implemented in Python. It integrates omics data into spatial interactomes derived from cryo-EM or crystallographic structures (mmCIF files) of multiprotein complexes. Its primary use case is to identify regions within a protein complex that are significantly altered under different experimental conditions via random‐walk network analysis.
Key Architectural Components
a. Data Layer
• Input files:
• mmCIF structures (Data/*.cif)
• Name and significance text files (Data/*.txt, Data/significance_file_*)
• These are static, versioned sample data for pipeline validation and examples.
b. Pre‐processing Modules
• check_cif_completeness.py
• reindex_pdb.py / batch_reindex_pdb.py
• split_cif_by_entity.py
• extract_sequence.py
These scripts validate and normalize raw mmCIFs, split by chain/entity, and pull sequence data.
c. Distance and Contact Computation
• calculate_distance.py / batch_calc_dist.py
• contacts_from_dist.py
These compute pairwise atom/residue distances and identify physical contacts to build graph edges.
d. Network Construction & Analysis
• intcryomics.py (builds interaction network annotated with experimental changes)
• pimp_my_network.py (enhances network attributes, e.g., weights)
• Region_selection_infomap.py (runs random‐walk/Infomap community detection)
• intcryomics_sigassign.py (assigns significance metrics to detected regions)
e. Batch Workflow Orchestration
• Python_Modules/batch_*.py invoke each step across multiple input sets.
f. Packaging & CLI
• cosneti/pyproject.toml & setup.cfg define the installable package “cosneti.”
• cosneti/src/modules mirror Python_Modules scripts as importable functions.
• USAGE.md documents CLI commands and recommended invocation order.
g. Outputs & Visualization
• Text reports, network files (e.g., GraphML), significance summaries
Relationships & Data Flow
• Data Input → Pre‐processing → Distance Computation → Network Construction → Community Detection → Significance Assignment → Output Reports
• Batch scripts wrap the linear pipeline for high‐throughput runs.
• The cosneti package provides a programmatic API for each module, enabling users to build custom pipelines or integrate into larger workflows.
Architectural Patterns & Principles
• Pipeline / ETL (Extract-Transform-Load) pattern: each script/module transforms data and passes it downstream.
• Modular design: independent, single-responsibility scripts that can be invoked in series or in batch.
• Layered packaging: top-level scripts for quick runs; cosneti package for importable modules.
• Separation of concerns: data validation, computation, network analysis, and reporting are distinct steps.