Flux distribution segregation visualization
Curated, evidence-grounded skill and software-tool collections for scientific AI agents, generated by the AgenticScienceBuilder
npx -y skills add HolobiomicsLab/asb-skill-collections --skill flux-distribution-segregation-visualizationAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 14 stars14 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Use when you have sampled feasible flux distributions from multiple constraint-based models (e.g., cell-line-specific variants of a metabolic model) and need to visually and quantitatively compare how well different constraint scenarios segregate biological samples.
The file declares its own license as CC-BY-4.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
10.5 KB, as published. Nobody here has run it
flux-distribution-segregation-visualization
Summary
Apply t-SNE dimensionality reduction to sampled steady-state flux distributions from constraint-based metabolic models to visualize and quantify cell-line-specific segregation. This skill evaluates whether integrating multiple constraint types (nutrient availability, extracellular flux ratios, transcriptomics-derived reaction activity scores) improves inter-model separation and intra-model cohesion.
When to use
Use this skill when you have sampled feasible flux distributions from multiple constraint-based models (e.g., cell-line-specific variants of a metabolic model) and need to visually and quantitatively compare how well different constraint scenarios segregate biological samples. Specifically, apply it when comparing constraint combinations (e.g., type 1 only, type 1+2, type 1+2+3) to determine which constraint integration strategy best distinguishes cell lines or phenotypes by their metabolic flux profiles.
When NOT to use
- Input flux distributions are not sampled uniformly from the null space or have been filtered/biased by prior optimization; t-SNE may misrepresent the true feasible region geometry.
- Sample size is <1,000 solutions per model; insufficient sampling leads to spurious clustering and unreliable t-SNE topology.
- Models differ only in objective function or biomass coefficient, not in constraint structure; segregation differences will be minimal and the comparison uninformative.
Inputs
- constraint-based metabolic models (SBML or COBRApy format) with multiple variants (e.g., ENGRO2_MCF102A.xml, ENGRO2_MDAMB231.xml, etc.)
- sampled feasible flux distributions (CSV files from optGpSampler; rows=solutions, columns=reaction fluxes; typically 10,000 samples per model)
- experimental phenotypic data (e.g., growth yield on glucose, YSI bioanalyzer measurements)
- constraint scenario definitions (binary flags or lists indicating which constraint types—nutrient availability, extracellular flux ratios, transcriptomics RAS scores—are active)
Outputs
- t-SNE embedded flux distribution maps (2D coordinates for each solution, colored by cell line)
- visual comparison plots (one t-SNE plot per constraint scenario, aligned for side-by-side assessment)
- Spearman correlation coefficients and p-values between experimental and in silico predictions (per constraint scenario)
- segregation quality metrics (intra-model variance, inter-model separation distance, silhouette scores if computed)
How to apply
First, sample 10,000 steady-state flux distributions from the null space of each constraint-based model using uniform sampling (e.g., optGpSampler in COBRApy). Apply t-SNE dimensionality reduction independently to each constraint scenario's combined flux distribution matrix, using default or optimized hyperparameters (perplexity, learning rate, n_iterations). Generate a two-dimensional map for each constraint condition and visually inspect intra-model clustering (tightness within cell line) and inter-model separation (distance between cell line clusters). Compute Spearman rank correlation between experimental phenotypic measurements (e.g., growth yield on glucose) and the in silico model predictions to quantify predictive power under each constraint scenario. Compare segregation quality across scenarios using visual assessment and statistical correlation p-values to identify which constraints best resolve biological heterogeneity.
Related tools
- optGpSampler (uniform sampling of steady-state flux distributions from the null space of the stoichiometric matrix)
- COBRApy (constraint-based metabolic model loading, constraint application, and integration with Python sampling workflows) — https://github.com/opencobra/cobrapy
- t-SNE (scikit-learn or standalone) (nonlinear dimensionality reduction of flux distribution matrices to 2D for visualization)
- scipy.stats.spearmanr (computation of Spearman rank correlation between experimental phenotypes and in silico predictions to assess model predictive power)
- matplotlib / seaborn (rendering of t-SNE scatter plots and comparison visualizations across constraint scenarios)
Examples
python pipeline/randomSampling.py 10000 1 && python -c "from sklearn.manifold import TSNE; import pandas as pd; flux_df = pd.read_csv('randomSampling_ENGRO2_nSol_10000_MCF102A.csv'); tsne = TSNE(n_components=2, random_state=42); coords = tsne.fit_transform(flux_df.iloc[:, 1:]); import matplotlib.pyplot as plt; plt.scatter(coords[:, 0], coords[:, 1]); plt.show()"
Evaluation signals
- Intra-model cluster compactness: Solutions from the same cell line should cluster tightly in t-SNE space; visual inspection confirms reduced spread compared to inter-model distances under the type 1+2+3 constraint scenario.
- Inter-model separation: Cluster centroids for different cell lines should be maximally separated in the type 1+2+3 scenario relative to type 1, 1+2 scenarios; measure as minimum Euclidean distance between cluster centroids or silhouette coefficient > 0.3.
- Correlation with phenotype: Spearman ρ between experimental growth yield and in silico predictions should be statistically significant (p < 0.05) and highest under the type 1+2+3 constraint scenario, indicating constraint integration improves biological fidelity.
- Constraint monotonicity: Inter-model separation should monotonically increase (or plateau) as constraints are added incrementally (type 1 → type 1+2 → type 1+2+3); regression to type 1 performance when constraints are removed signals genuine constraint contribution.
- Solution diversity check: Sample size verification ensures 10,000 solutions per model were successfully sampled; histogram of flux values per reaction shows multimodal (not delta-function) distribution, confirming feasible region sampling rather than optimization convergence.
Limitations
- t-SNE is stochastic and hyperparameter-dependent; results may vary across runs or perplexity settings. Use fixed random seed and report hyperparameters for reproducibility.
- Limited metabolite coverage in metabolomics dataset constrains the number of reactions that can be analyzed and constrained, potentially underutilizing type 2 and 3 constraints.
- Allosteric regulation, product inhibition, and cofactor/prosthetic group effects cannot be discriminated from flux distributions alone; type 3 constraints based on transcriptomics (RAS) may not capture post-transcriptional or allosteric control.
- Visual segregation is subjective; quantitative metrics (silhouette score, Davies-Bouldin index) should accompany qualitative t-SNE plots to avoid over-interpretation of minor clustering differences.
- Sample size limited to 10,000 steady-state solutions for computational visualization; larger sample sizes may reveal finer structure in the feasible region but require downsampling for t-SNE rendering.
Evidence
- [other] Does the simultaneous application of all three constraint types (nutrient availability, extracellular fluxes, and transcriptomics-derived constraints) segregate the five breast cell lines better than any subset of constraints, as evaluated by t-SNE visualization of feasible flux distributions?: "research question defining the skill application scenario and evaluation criterion"
- [other] Type 1+2+3 constraints together achieve superior segregation of the five cell line flux distributions compared to individual or paired constraint applications, as demonstrated by t-SNE visualization showing decreased intra-model and increased inter-model separation of steady-state solutions.: "finding confirming expected outcome of the skill"
- [other] Sample 10,000 steady-state flux distributions from the null space of the stoichiometric matrix for each cell line using uniform sampling (optGpSampler).: "workflow step specifying sampling method and sample size"
- [other] Apply t-SNE dimensionality reduction to the sampled flux distributions to produce a two-dimensional map and visualize the segregation of the five cell lines.: "workflow step specifying dimensionality reduction and output"
- [other] Compute the Spearman correlation coefficient between experimental and in silico growth yield on glucose for each constraint scenario and report p-values.: "workflow step specifying quantitative evaluation metric"
- [results] For computational reasons, only 10000 steady-state solutions sampled within the feasible region of each model were plotted: "justification for sample size and computational constraint"
- [other] constraint-based stoichiometric metabolic models, Flux Variability Analysis, optGpSampler, COBRApy, t-SNE: "tools used in the skill application"