# HG changeset patch # User francesco_lapi # Date 1761392343 0 # Node ID fd53d42348bd858f40d88ee36e792b4238548ed0 # Parent f79250e824b524a1c57bdbbc27bf13a3d8c83b9f Uploaded diff -r f79250e824b5 -r fd53d42348bd COBRAxy/README.md --- a/COBRAxy/README.md Sat Oct 25 11:05:14 2025 +0000 +++ b/COBRAxy/README.md Sat Oct 25 11:39:03 2025 +0000 @@ -65,7 +65,7 @@ ## Requirements -- **Python**: 3.8-3.11 +- **Python**: 3.8-3.12 - **OS**: Linux, macOS, Windows (Linux recommended) - **Dependencies**: Automatically installed via pip (COBRApy, pandas, numpy, etc.) diff -r f79250e824b5 -r fd53d42348bd COBRAxy/docs/README.md --- a/COBRAxy/docs/README.md Sat Oct 25 11:05:14 2025 +0000 +++ b/COBRAxy/docs/README.md Sat Oct 25 11:39:03 2025 +0000 @@ -2,21 +2,27 @@ > A Python toolkit for metabolic flux analysis and visualization, with Galaxy integration. -COBRAxy transforms gene expression and metabolite data into meaningful metabolic insights through flux sampling and interactive pathway maps. +COBRAxy enables the integration of transcriptomics data with COBRA-based metabolic models, offering a comprehensive framework for studying metabolism in both health and disease. With COBRAxy, users can load and enrich metabolic models by incorporating transcriptomic data and adjusting the model’s medium conditions. ## Overview -COBRAxy provides a complete pipeline for metabolic modeling and analysis, from raw omics data to publication-ready pathway visualizations. Whether you're a researcher analyzing metabolic changes in disease, a systems biologist studying metabolic networks, or a bioinformatician building analysis pipelines, COBRAxy offers the tools you need. +COBRAxy enables constraint-based modeling and sampling techniques, allowing users to compute metabolic +flux distributions for multiple biological samples. The tool also enables the integration of medium +composition information to refine flux predictions. Additionally, COBRAxy provides a user-friendly interface +for visualizing significant flux differences between populations on an enriched metabolic map. This +extension provides a comprehensive and accessible framework for advanced metabolic analysis, enabling +researchers without extensive programming expertise to explore complex metabolic processes + +By offering an intuitive and accessible platform for multi-omics integration and metabolic analysis, COBRAxy meets the growing need for tools that help researchers explore complex metabolic processes with ease. ## Key Features +- **Galaxy Tools** - Web-based analysis with intuitive interface - **Reaction Activity Scores (RAS)** - Compute metabolic activity from gene expression data - **Reaction Propensity Scores (RPS)** - Infer metabolic preferences from metabolite abundance -- **Flux Sampling** - Sample metabolic flux distributions with CBS or OptGP algorithms -- **Statistical Analysis** - Perform pFBA, FVA, and sensitivity analysis -- **Interactive Maps** - Generate publication-ready pathway visualizations with SVG/PDF export -- **Galaxy Tools** - Web-based analysis with intuitive interface -- **Built-in Models** - Ready-to-use models including ENGRO2 and Recon +- **Flux computation** - Compute metabolic flux distributions using different optimization or sampling algorithms +- **Statistical Analysis** - Perform statistically significant flux differences between groups of samples and report on an enriched metabolic map +- **Built-in Models** - Ready-to-use models including ENGRO2 and Recon3D ## Quick Navigation @@ -31,10 +37,11 @@ ## Data Flow -COBRAxy follows two parallel analysis paths: +COBRAxy follows several analysis paths: -1. **Enrichment Analysis**: RAS + RPS → MAREA → Enriched Maps -2. **Flux Simulation**: RAS → Model Constraints → Flux Sampling → Flux Maps +1. **RAS Enrichment Analysis**: RAS computation → MAREA → Enriched Maps +2. **Flux Enrichment Analysis Simulation**: RAS computation → Model Constraints → Flux Sampling → Flux Maps +3. **RAS/RPS Enrichment Analysis**: RAS + RPS computation → MAREA → Enriched Maps ## Community & Support diff -r f79250e824b5 -r fd53d42348bd COBRAxy/docs/installation.md --- a/COBRAxy/docs/installation.md Sat Oct 25 11:05:14 2025 +0000 +++ b/COBRAxy/docs/installation.md Sat Oct 25 11:39:03 2025 +0000 @@ -4,7 +4,7 @@ ## System Requirements -- **Python**: 3.8-3.11 +- **Python**: 3.8-3.12 - **Operating System**: Linux (recommended), macOS, Windows - **Storage**: 2GB free space for installation and temporary files @@ -34,50 +34,7 @@ ## Dependencies -COBRAxy automatically installs its Python dependencies: - -- **COBRApy** - Core metabolic modeling -- **pandas** - Data manipulation -- **numpy** - Numerical computations -- **scipy** - Scientific computing - -## Optional System Libraries - -Install additional libraries for enhanced features: - -### Ubuntu/Debian - -```bash -# Install GLPK solver -sudo apt-get update -sudo apt-get install libglpk40 glpk-utils - -# Install libvips for SVG processing -sudo apt-get install libvips - -# Install Python GLPK bindings -pip install swiglpk -``` - -### macOS - -```bash -# Using Homebrew -brew install glpk vips - -# Install Python bindings -pip install swiglpk -``` - -### Windows - -```bash -# Using conda (recommended for Windows) -conda install -c conda-forge glpk - -# Or using pip -pip install swiglpk -``` +COBRAxy automatically installs its Python dependencies (COBRApy, pandas, numpy, etc.) ## Verify Installation @@ -87,39 +44,6 @@ # Check if COBRAxy tools are available ras_generator --help flux_simulation --help - -# Test with example data (if available) -cd COBRAxy -python testing.py -``` - -## Troubleshooting Installation - -### Common Issues - -**Import Error: No module named 'cobra'** -```bash -# Install COBRApy manually -pip install cobra -``` - -**GLPK solver not found** -```bash -# Install GLPK solver -# Ubuntu/Debian: sudo apt-get install glpk-utils -# macOS: brew install glpk -# Then: pip install swiglpk -``` - -**Permission denied errors** -```bash -# Use user installation -pip install --user . -# Or use virtual environment (recommended) -python -m venv cobraxy-env -source cobraxy-env/bin/activate # Linux/macOS -# cobraxy-env\Scripts\activate # Windows -pip install . ``` ## Virtual Environment (Recommended) diff -r f79250e824b5 -r fd53d42348bd COBRAxy/docs/tools/README.md --- a/COBRAxy/docs/tools/README.md Sat Oct 25 11:05:14 2025 +0000 +++ b/COBRAxy/docs/tools/README.md Sat Oct 25 11:39:03 2025 +0000 @@ -1,15 +1,3 @@ -# Tool| Tool | Purpose | Input | Output | -|------|---------|--------|---------| -| [RAS Generator](ras-generator.md) | Compute reaction activity scores | Gene expression + GPR rules | RAS values | -| [RPS Generator](rps-generator.md) | Compute reaction propensity scores | Metabolite abundance | RPS values | -| [MAREA](marea.md) | Statistical pathway enrichment | RAS/RPS data | Enriched maps + statistics | -| [RAS to Bounds](ras-to-bounds.md) | Apply RAS constraints to model | RAS + SBML model | Constrained bounds | -| [Flux Simulation](flux-simulation.md) | Sample metabolic fluxes | Constrained model | Flux distributions | -| [Flux to Map](flux-to-map.md) | Visualize flux data on maps | Flux samples + statistical comparison | Color-coded pathway maps | -| [Model Setting](metabolic-model-setting.md) | Extract model components | SBML/JSON/MAT/YML model | Tabular model data | -| [Tabular to Model](tabular-to-model.md) | Create COBRA models | Tabular reaction data | SBML/JSON/MAT/YAML models | -| [MAREA Cluster](marea-cluster.md) | Cluster analysis | Expression/RAS/RPS/flux data | Sample clusters + validation plots |ation - Complete reference for all COBRAxy tools with parameters, examples, and usage guidelines. ## Available Tools @@ -42,6 +30,9 @@ ## Usage Patterns +### Galaxy Integration +All tools include Galaxy XML wrappers for web-based usage through the Galaxy interface. + ### Command Line Usage ```bash # Basic pattern for all tools @@ -51,18 +42,6 @@ ras_generator -td $(pwd) -in expression.tsv -ra ras_output.tsv -rs ENGRO2 ``` -### Python API Usage -```python -import tool_module - -# All tools accept argument lists -args = ['-td', '/path/to/cobraxy', '-in', 'input.tsv', '-out', 'output.tsv'] -tool_module.main(args) -``` - -### Galaxy Integration -All tools include Galaxy XML wrappers for web-based usage through the Galaxy interface. - ## Parameter Reference ### File Format Requirements @@ -87,9 +66,8 @@ | Model | Organism | Reactions | Genes | Best For | |-------|----------|-----------|-------|----------| -| **ENGRO2** | Human | ~2,000 | ~500 | Focused analysis, faster computation | -| **Recon** | Human | ~10,000 | ~2,000 | Comprehensive metabolism | -| **HMRcore** | Human | ~5,000 | ~1,000 | Balanced coverage | +| **ENGRO2** | Human | ~500 | ~500 | Focused analysis, faster computation | +| **RECON3D** | Human | ~10,000 | ~2,000 | Comprehensive metabolism | ## Tool Selection Guide diff -r f79250e824b5 -r fd53d42348bd COBRAxy/docs/tools/ras-generator.md --- a/COBRAxy/docs/tools/ras-generator.md Sat Oct 25 11:05:14 2025 +0000 +++ b/COBRAxy/docs/tools/ras-generator.md Sat Oct 25 11:39:03 2025 +0000 @@ -65,22 +65,15 @@ **Gene Mapping**: Each gene in the expression data is mapped to reactions via GPR rules. **Logical Operations**: -- **OR**: `Gene1 or Gene2` → `max(expr1, expr2)` or `expr1 + expr2` +- **OR**: `Gene1 or Gene2` → `expr1 + expr2` - **AND**: `Gene1 and Gene2` → `min(expr1, expr2)` **Missing Gene Handling**: -- `-n true`: Missing genes treated as 0, OR operations continue -- `-n false`: Missing genes cause reaction score to be null +- `-n true`: Ignore missing genes in the GPR rules. +- `-n false`: Missing genes cause reaction score to be NaN ### RAS Computation -For each reaction and sample: - -1. **Parse GPR rule** into nested logical structure -2. **Replace gene names** with expression values -3. **Evaluate logical operations** recursively -4. **Assign RAS score** based on final result - **Example**: ``` GPR: (HGNC:5 and HGNC:10) or HGNC:15 @@ -154,21 +147,15 @@ ### ENGRO2 (Recommended for most analyses) - **Scope**: Focused human metabolism -- **Reactions**: ~2,000 +- **Reactions**: ~500 - **Genes**: ~500 -- **Use case**: General metabolic analysis +- **Use case**: Core metabolic analysis ### Recon (Comprehensive analysis) - **Scope**: Complete human metabolism - **Reactions**: ~10,000 - **Genes**: ~2,000 -- **Use case**: Detailed metabolic studies - -### HMRcore (Balanced option) -- **Scope**: Core human metabolism -- **Reactions**: ~5,000 -- **Genes**: ~1,000 -- **Use case**: Balanced coverage +- **Use case**: Genome-wide metabolic studies ## Gene ID Mapping @@ -194,7 +181,7 @@ Solution: Check gene ID format matches model expectations - Verify gene identifiers (HGNC vs symbols vs Ensembl) - Use gene mapping tools if needed -- Set -n true to handle missing genes gracefully +- Set -n true to handle missing genes ``` **"No computable scores" error** @@ -249,11 +236,6 @@ print(f"Reactions with no data: {null_reactions}") ``` -### Expected Results - -- **Coverage**: 60-90% of reactions should have computable scores -- **Range**: RAS values typically 0-20 for log-transformed expression -- **Distribution**: Should reflect biological variation in your samples ## Integration with Other Tools diff -r f79250e824b5 -r fd53d42348bd COBRAxy/flux_simulation.xml --- a/COBRAxy/flux_simulation.xml Sat Oct 25 11:05:14 2025 +0000 +++ b/COBRAxy/flux_simulation.xml Sat Oct 25 11:39:03 2025 +0000 @@ -94,14 +94,14 @@ - + diff -r f79250e824b5 -r fd53d42348bd COBRAxy/metabolicModel2Tabular.py --- a/COBRAxy/metabolicModel2Tabular.py Sat Oct 25 11:05:14 2025 +0000 +++ b/COBRAxy/metabolicModel2Tabular.py Sat Oct 25 11:39:03 2025 +0000 @@ -22,7 +22,7 @@ ARGS : argparse.Namespace def process_args(args: List[str] = None) -> argparse.Namespace: """ - Parse command-line arguments for metabolic_model_setting. + Parse command-line arguments. """ parser = argparse.ArgumentParser( @@ -342,7 +342,7 @@ if not expected or not os.path.exists(expected) or os.path.getsize(expected) == 0: raise utils.DataErr(expected, "Output not created or empty") - print("Metabolic_model_setting: completed successfully") + print("Completed successfully") if __name__ == '__main__': diff -r f79250e824b5 -r fd53d42348bd COBRAxy/metabolicModel2Tabular.xml --- a/COBRAxy/metabolicModel2Tabular.xml Sat Oct 25 11:05:14 2025 +0000 +++ b/COBRAxy/metabolicModel2Tabular.xml Sat Oct 25 11:39:03 2025 +0000 @@ -105,7 +105,7 @@ cond_model['model_selector'] == 'Recon' - + cond_model['model_selector'] == 'Custom_model' diff -r f79250e824b5 -r fd53d42348bd COBRAxy/ras_generator.xml --- a/COBRAxy/ras_generator.xml Sat Oct 25 11:05:14 2025 +0000 +++ b/COBRAxy/ras_generator.xml Sat Oct 25 11:39:03 2025 +0000 @@ -25,11 +25,11 @@ + label="Model tabular file:" help="Upload the CSV/TSV file containing the information generated by the metabolicModel2Tabular tool." /> - + @@ -40,37 +40,28 @@ diff -r f79250e824b5 -r fd53d42348bd COBRAxy/rps_generator.xml --- a/COBRAxy/rps_generator.xml Sat Oct 25 11:05:14 2025 +0000 +++ b/COBRAxy/rps_generator.xml Sat Oct 25 11:39:03 2025 +0000 @@ -35,10 +35,10 @@