Metadata-Version: 2.4
Name: oncoresolve
Version: 1.0.0
Summary: A High-Hygiene Explainable AI and Patient-Centric Uniqueness Framework for Breast Cancer Subtyping
Author-email: Shubham Jha <shubhamkjha369@gmail.com>
License: MIT
Keywords: bioinformatics,breast-cancer,machine-learning,explainable-ai
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.24.0
Requires-Dist: pandas>=2.0.0
Requires-Dist: scikit-learn>=1.3.0
Requires-Dist: joblib>=1.3.0
Requires-Dist: lifelines>=0.27.0
Dynamic: license-file

# OncoResolve: Reusable Python Bioinformatics Package

A High-Hygiene Explainable AI and Patient-Centric Uniqueness Framework for Breast Cancer Subtyping. This package allows you to clean custom transcriptomic matrices, run PAM50 predictions using pre-trained TCGA models, compute N-of-1 patient Uniqueness scores (CUS), and predict overall survival risk scores (CRS).

## Installation

### Local development install
From the root of this project folder:
```bash
pip install -e .
```

### Direct install from GitHub
```bash
pip install git+https://github.com/shubhamkjha369/OncoResolve.git
```

## Reusable Library Usage

Once installed, you can import the package using capital `OncoResolve`:

```python
import OncoResolve as orr
import pandas as pd

# 1. Prepare and Harmonize your custom RNA-seq expression matrix (genes as columns)
# Pass in the path to the tcga_entrez_to_hugo.pkl mapping file
df_clean = orr.harmonize_namespaces(df_raw, "path/to/tcga_entrez_to_hugo.pkl")
df_scaled = orr.scale_cohort(df_clean)

# Load the required features list directly from the pre-trained model metadata 
# and align columns alphabetically (filling missing genes with 0.0)
required_features = sorted(orr.OncoPrognosis().model_.summary.index.tolist())
# Alternatively, use a custom list of consensus genes:
# required_features = list(pd.read_parquet("path/to/final_consensus_biomarkers.parquet")["gene"])

df_aligned = orr.align_features(df_scaled, required_features)

# 2. Run classification using pre-trained SVM or Logistic Regression models
# Note: Since models are bundled, you don't need to specify paths to load pre-trained models!
clf = orr.OncoClassifier(model_type="svm")
predictions = clf.predict(df_aligned)        # Returns PAM50 subtype strings
probabilities = clf.predict_proba(df_aligned)  # Returns class probabilities DataFrame

# 3. Compute Patient Uniqueness Scores (CUS)
df_cus = orr.compute_cus(df_aligned, barcodes=df_aligned.index, alpha=0.001)

# 4. Predict Overall Survival Risk Scores (Consensus Cox CRS)
# Note: Since survival models are bundled, no path specification is required!
prog = orr.OncoPrognosis()
risk_scores = prog.predict_risk(df_aligned)
```

## Authors
* **Shubham Jha** (shubhamkjha369@gmail.com)

