How ejmric/stmf works
Project type and purpose
• The core deliverable is a Python module (STMF.py and STMF_urf_ulf.py) offering STMF class methods (fit, predict_all). Surrounding scripts/notebooks perform data preprocessing, model initialization, evaluation (distance correlation), permutation experiments, and result plotting.
File structure
• Top-level code modules:
• STMF.py, STMF_urf_ulf.py – core algorithms
• utils.py – helper functions
• distance_correlation.py – implementation of evaluation metric
• Data directories:
• multi_omic/ – real TCGA/PAM50/CBIO raw data files (.txt, .csv)
• initializations/ – sample initialization matrices (notebooks + .ipynb)
• synthetic_experiments/ & perm_techn/ & real_data_experiments/ – numerous Jupyter notebooks and associated CSV result folders
• Config/requirements:
• requirements.txt – Python dependencies
• .gitignore – excludes result artifacts and data caches
README for additional insights
• The README describes how to import and run the model, points at external data sources (TCGA, CBIO, PAM50) and the academic reference.
Main components and interactions (
a. Components:
1. Data Sources (external links → raw CSVs/TXT)
2. Data Preprocessing layer (notebooks or Python scripts in initializations, utils)
3. Initialization module (initializations/, random or custom starts)
4. Core STMF Engine (STMF.py, STMF_urf_ulf.py)
5. Evaluation Metric (distance_correlation.py)
6. Experiment Orchestration (Jupyter notebooks under real_data_experiments/, synthetic_experiments/, perm_techn/)
7. Results Storage (CSV outputs under results/ subfolders)
8. Visualization (notebooks that generate violin plots, critical difference charts)
9. External References (academic papers, external data download sites)
b. Relationships & data flow:
• Raw Data → Preprocessing → Initialization → STMF Engine → Approximation
• Approximation + Raw Data → Evaluation Module → Metrics
• Metrics → Visualization → Plots (CSV + embedded graphs)
• Experiment scripts glue these steps: import Data, call STMF, call distance_correlation, write results
c. Architectural patterns & design principles:
• Modular design: Core algorithm separated from evaluation/utilities and orchestration notebooks.
• Reusability: STMF class exposes a simple API (fit, predict_all), pluggable “initialization” strategies.
d. Key technologies:
• Python 3.x, NumPy, SciPy, Pandas (in requirements.txt)
• Jupyter notebooks for interactive orchestration
• CSV/TXT for data interchange
• Git for version control
Detailed capture of essential elements
• “Experiment Notebooks” to “STMF Core”, “utils.py”, “distance_correlation.py”.
• “Results CSV Folders” as output sinks from notebooks.
• External data URLs feeding into “multi_omic” folder.
• “requirements.txt” as dependency loader for Python environment.