Skip to content

bisect-group/SPECTRA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SPECTRA: Scalable Platform for Extracting
Constraint-based Top-down Reconstructions and Analysis

Overview

SPECTRA is a unified, scalable framework for reconstructing metabolic models from multi-omics data. It integrates diverse optimization strategies (linear and mixed-integer linear programming) to extract metabolic networks at multiple biological scales-from minimal reactomes and context-specific models (CSMs) to microbial community models and multi-tissue models.

Installation & Setup

Prerequisites

Installation

git clone https://github.com/NiravBhattLab/SPECTRA.git
cd SPECTRA

Reproducing Manuscript Results

This repository contains the code necessary to reproduce the results and figures presented in the main manuscript and supplementary information. The scripts are organized into corresponding folders.

1. Build Cancer Models (Context-Specific Models)

Located in BuildCancerModels/ Build context-specific models using DepMap transcriptomics data.

  • Workflow:
    • DepMapModels_Recon/PrepareDepMapData.m: Extract transcriptomics data.
    • DepMapModels_Recon/modGenesIDConv.m: Convert gene IDs in UpdatedRecon3D.mat.
    • DepMapModels_Recon/GiniReactionImportance.m: Obtain core reactions from transcriptomics.
    • DepMapModels_Recon/BuildDepMapModels.m: Build models using fastcore, swiftcore, and SPECTRA methods.
  • Analysis:
    • coverage_core/Cancerrxnscoverage.m: to calculate the count of cancer hallmark reactions captured by the models.
    • flux_results/ and fva/: Evaluate FVA span ratios and flux enrichment analysis.

2. Recon3D+

Located in Recon3D+/ Contains the updated version of Recon3D (UpdatedRecon3D.mat) file with manually curated reactions

3. Runtime Comparisons

Located in RuntimeComparisons/ Use these scripts to benchmark the runtime performance of SPECTRA formulations.

  • ForSPECTRA_CCResults.m: Efficiency comparison for Consistency Checking.
  • ForSPECTRA_MEResults.m: Efficiency comparison for model building with an input consistent universal model.
  • ForSPECTRA_CC_MEResults.m: Efficiency comparison for model building with an input inconsistent universal model.
  • checkModelQuality.m: Helper script to evaluate output models to check if the core reactions are present and to confirm if the model is consistent.

4. Gap-filling & Random Reaction Removal (AGORA2)

Located in RandomReactionRemovalAGORA/ and gapFilledAGORA_DB/ Evaluates the SPECTRA for random reaction removal and gapfilling entire AGORA2 database.

  • RandomReactionRemovalAGORA/GapFillAGORADraftModels.m: gapfills the draft models generated by randomly removing a certain percent of reactions in the AGORA2 models
  • RandomReactionRemovalAGORA/getResultsOnGapfill30_LP_MILP_DC.m: Evaluates the built models using distinct metrics like Recall, Precision and F1 score.
  • gapFilledAGORA_DB/BuildUmodelFromAGORAdb.m: To build an uninversal model for AGORA2 models
  • gapFilledAGORA_DB/GetGapFilledAGORAmodel.m: To get the gapfilled AGORA2 models

5. Deep Learning EC Match Verification

Located in Verify_new_reactions_AGORA_using_DL/ Verify the biological viability of the new reactions.

  • getECmatch.m: Matches deep-learning-based Enzyme Commission (EC) numbers with newly obtained reactions.

6. LP7 vs LPforwardCC comparison

Located in LP7_vs_LPf/ Evaluates efficiency of LPforwardCC against LP7 of fastcore.

  • LP7_LPf.m: Benchmarking and demonstrating the efficiency of SPECTRA LP-based fast consistency checker vs existing tool.

7. Microbial community model building

Located in hCOM_community/ To build microbial community model.

  • RandomDeletion_AGORA/: Codes required for random reactions removal from AGORA2 database and community scale gapfilling
  • CommunityGapFilling/: Codes for building a community scale model using carveme's unviversal model.

8. Visualisations & Figures

Located in Visualisations/ Contains Python Notebooks (.ipynb) and MATLAB .mat files that were used to plot the final paper figures.


Quick Start Guide

Step 1: Prepare The Inputs

The omics data can be used to derive the following three inputs to SPECTRA.

Parameter Purpose
Core reactions These reactions will be present in the final model
Weights Numbers that determine the relative importance of the reactions to be included (or excluded)
Box contraints Lower and upper bounds to the reactions in the universal model

The following code demonstrates the same for a toy network model:

  % loading the universal model
  model = three_pathway_toy_model(); % A toy model with eight metabolites and eleven reactions

  % defining the box constraints 
  model.ub(:) = 10; 
  model.ub([1,6,9]) = 1; % constraining the media reactions

  % defining the core reactions
  core = 5; % the reaction indices of the core reactions

  % defining the weights of the reactions (For this example, we are using tradeOff as the network inference method)
  weights = [1,1,-2,-1,1,1,2,-1,-2,0,1]'; % Same size as the number of reactions

Step 2: Choose The Network Inference Formulation

Formulation Objective Use Case Input Weights
minNetLP Minimize total flux Extracting minimal networks preserving core reactions Non-negative weights
minNetMILP Minimize reaction count Extracting minimal networks preserving core reactions Non-negative weights
minNetDC Cardinality minimization Extracting minimal networks preserving core reactions Non-negative weights
tradeOff Maximize weighted reactions Balancing positive vs. negative evidence Any real values
optimBiomass Maximize biomass + minimize flux Biological growth optimization Non-negative weights

Step 3: Model reconstruction

% For flux consistent universal models
consType = 'stoichiometry'; % to use stoichiometric constraints or topology constraints
probType = 'tradeOff'; % network inference method
altSolMethod = {}; % method to obtain alternate solutions
nSol = 1; % number of alternate solutions required
solveTime = 7200; % maximum time for solving MILP problem
tol = 1e-5; % defining the small positive number
[Model_tradeOff] = spectraME(model,core,tol,consType,weights,nSol,altSolMethod,probType,solveTime); 

% For flux inconsistent universal models (simultaneous consistency checking + extraction)
[Model_tradeOff] = spectraCCME(model,core,tol,consType,weights,nSol,altSolMethod,probType,solveTime); 

Step 4: To Generate Alternative Solutions

  % Pathway exclusion (for MILP formulations like tradeOff and minNetMILP)
  altSolMethod = 'pathwayExclusion'; % method to obtain alternate solutions
  nSol = 5; % number of alternate solutions required
  [Model_tradeoff_altSols] = spectraME(model,core,tol,consType,weights,nSol,altSolMethod,probType,solveTime); 

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors