DOI: 10.5281/zenodo.14198997
title: Systems-level design principles of metabolic rewiring in an animal

description: Description: 

This repository contains all source codes, necessary input and output data, and raw figures and tables for reproducing all figures and results published in the following study: 

Xuhang Li#, Hefei Zhang#, Thomas Hodder, Wen Wang, L. Safak Yilmaz, Chad L. Myers, Albertha J.M. Walhout. Systems-level Worm Perturb-Seq reveals design principles of metabolic rewiring. (2025) Nature, in press (# equal contribution)

Files:

This repository contains the entire project working directory for this publication. To deposit into Zenodo, we have individually zipped each subfolder of the root directory. To reproduce our study, it is advised that one should download the entire Zenodo repository and unzip every zip file to produce the corresponding subfolders. The "root.zip" should be directly unzipped into the root directory of this project (not your system root!!). 

The recovered working directory should be like this: 



10_revision/

1_QC_dataCleaning/

2_DE/

3_imageAnalysis/

4_networkAnalysis/

5_GSA/

7_FBA_modeling/

data_and_tables_to_publish/

input_data/

generate_all_tables_for_publication.R

prepareTbls_met12.R

prepareTbls_metVali1_OCC.R

prepareTbls_metVali2_b12.R

prepareTbls_metVali3_detox.R

prepareTbls.R

prepareTbls_SPECIAL.R

REWIRING_FIGURE_LOOKUP.xlsx


Please be advised that this repository contains raw codes and data that are not directly related to a figure in our paper. However, they may be useful to generate input used in the analysis of a figure, or to reproduce tables in our manuscript. It may also contain unpublished analyses and figures, which we did not intentionally delete and kept for records. 

Usage: 

Please refer to the table in below to locate a specific file for reproducing a figure of interest (also availabe in the REWIRING_FIGURE_LOOKUP.xlsx under the root directory). 




Figure
File
Linesa
Notes


Fig. 1b
1_QC_dataCleaning/5_supplementary_figure_rewiring.R
1-190
 


Fig. 1c
2_DE/3_1_DE_network_analysis.R
1-83
 


Fig. 1d
11_additional analysis/special RNAi.R
entire file
 


Fig. 1e
2_DE/output/metabolic_GRN_layout2.cys
open in Cytoscape


Fig. 1f
2_DE/3_1_DE_network_analysis.R
1-71
 


Fig. 1g
2_DE/3_1_DE_network_analysis.R
1-145
 


Fig. 2a
2_DE/5_2_coexpression_analysis_direct_tree.R
1-235
 


Fig. 2b
2_DE/5_1_1_DE_similarity_analysis.R
232-287
 


Fig. 2c
2_DE/5_1_1_DE_similarity_analysis.R
468-765
For producing the embedding, see "2_DE/clustering_python/cluster_RNAi_UMAP_DBSCAN.ipynb"


Fig. 2d
2_DE/5_2_coexpression_analysis_direct_tree.R
136-181
 


Fig. 2e
2_DE/5_2_coexpression_analysis_direct_tree.R
136-338
 


Fig. 2f
2_DE/6_2_rewiring_summary_map_PCCtree.R
entire file
 


Fig. 3b
2_DE/4_2_pathway_level_analysis.R
2247-2539
 


Fig. 3c
2_DE/4_2_pathway_level_analysis.R
2247-2506
the published figure uses level 4 and up direction (2_DE/figures/1_pathway_level_analysis/rxn_and_pathway_rewiring_LEVEL4_up.pdf)


Fig. 3d
2_DE/4_2_pathway_level_analysis.R
2183-2235
 


Fig. 3e
2_DE/4_2_pathway_level_analysis.R
1751-2159
 


Fig. 3g
4_networkAnalysis/2_visualize_example_rewirings.R
803-807
please load the dependency starting from line 1


Fig. 3h
11_additional analysis/glycine tracing/glycine RNAi tracing.R
entire file
source data also provided along the paper


Fig. 3j
4_networkAnalysis/2_visualize_example_rewirings.R
1-601
 


Fig. 3k
4_networkAnalysis/1_rewiring_network_modules.R
entire file
 


Fig. 4a
7_FBA_modeling/CR_model_final_run/2_DEG_modeling_basic_CR_model.R
853-881
run lines 1-100 to load dependency; Euler plot depends on a random seeds; we manually picked one output figure that has best visual representations; see the corresponding Github or "7_FBA_modeling/CR_model_final_run/a1_gene_obj_classification.m" for generating the input matrix (core function matrix)


Fig. 4b
7_FBA_modeling/CR_model_final_run/2_DEG_modeling_supp_gspd_1_example_objHeatmap.R
entire file
 


Fig. 4c
7_FBA_modeling/CR_model_final_run/2_DEG_modeling_basic_CR_model.R
1-270
 


Fig. 4d
7_FBA_modeling/CR_model_final_run/3_DEG_modeling_edge_direction_test_randFBA.R, 7_FBA_modeling/CR_model_final_run/3_DEG_modeling_edge_direction_test_randGRN.R
entire file
Reproducing this figure is complex because it integrates multiple randomization results; search "fitted_CR_interaction_diagram.pdf" or "fitted_CR_interaction_diagram_randGRN.pdf" to locate the code for making the figure (two randomizations, respectively), and track up for a few lines to load the dependency. To fully reproduce the analysis, follow the instructions in the Github and you will need to execute all four files named "3_DEG_modeling_edge_*.R".


Fig. 4f
7_FBA_modeling/CR_model_final_run/2_DEG_modeling_supp_fused_with_FBA.R
1-154
numbers are in variable "model_explained"


Fig. 4g (left)
7_FBA_modeling/CR_model_final_run/2_DEG_modeling_supp_fused_with_FBA.R
entire file
corresponding figure produced by lines 342-345


Fig. 4g (right)
7_FBA_modeling/CR_model_final_run/2_DEG_modeling_supp_parameter_sensitivity_fused_with_FBA.R
entire file
 


Fig. 5a
7_FBA_modeling/REVISION/human_perturb_seq/2_DEG_modeling_basic_CR_model.R
1-297
 


Fig. 5b
7_FBA_modeling/REVISION/human_perturb_seq/3_DEG_modeling_edge_direction_test_randFBA.R
entire file and see notes
Reproducing this figure is complex because it integrates multiple randomization results; search "fitted_CR_interaction_diagram.pdf" to locate the code for making the figure, and track up for a few lines to load the dependency. To fully reproduce the analysis, follow the instructions in the Github and you will need to execute all two files named "3_DEG_modeling_edge_*.R".


Fig. 5c
7_FBA_modeling/REVISION/human_perturb_seq/2_DEG_modeling_supp_fused_with_FBA.R
entire file
corresponding figure produced by lines 343-346


Fig. 5d
7_FBA_modeling/REVISION/human_perturb_seq/2_DEG_modeling_supp_DEG_cutoff_sensitivity_fused_with_FBA.R
entire file
 


Extended Data Fig. 1a
1_QC_dataCleaning/5_supplementary_figure_rewiring.R
193-219
 


Extended Data Fig. 1b
1_QC_dataCleaning/5_supplementary_figure_rewiring.R
1-91
the published figure was remade manually for prettier representations, the plotting function for which is not provided in this code. However, the raw data stays the same.


Extended Data Fig. 1c
2_DE/SUPP_extra_figures_for_rewiring.R
280-379
 


Extended Data Fig. 1d
4_networkAnalysis/s2_rewiring_and_network_GPR.R
387-555
some inputs were generated by "4_networkAnalysis/s2_rewiring_and_network_GPR.m"


Extended Data Fig. 1e
4_networkAnalysis/s2_rewiring_and_network_GPR.R
387-555
some inputs were generated by "4_networkAnalysis/s2_rewiring_and_network_GPR.m"


Extended Data Fig. 1f
2_DE/4_2_pathway_level_analysis.R
170-257
 


Extended Data Fig. 1g
2_DE/4_2_pathway_level_analysis.R
170-297
 


Extended Data Fig. 1h
11_additional analysis/Wormsize/plot for publishing.R
entire file
 


Extended Data Fig. 1i
11_additional analysis/Wormsize/plot for publishing.R
entire file
 


Extended Data Fig. 2a
2_DE/3_1_DE_network_analysis.R
1-61
 


Extended Data Fig. 2b
2_DE/3_1_DE_network_analysis.R
1-180
 


Extended Data Fig. 2c
2_DE/3_1_DE_network_analysis.R
1-152
 


Extended Data Fig. 2d
2_DE/3_1_DE_network_analysis.R
364-397
 


Extended Data Fig. 2e
2_DE/3_1_DE_network_analysis.R
364-383
 


Extended Data Fig. 2f
2_DE/3_1_DE_network_analysis.R
1-264
 


Extended Data Fig. 2g
5_GSA/1_DE_annotation_pipeline.R
1389-1522
 


Extended Data Fig. 3
2_DE/5_1_1_DE_similarity_analysis.R
468-765
For producing the embedding, see "2_DE/clustering_python/cluster_RNAi_UMAP_DBSCAN.ipynb"


Extended Data Fig. 4a
4_networkAnalysis/s3_rewiring_and_network_connections.R
1-254
 


Extended Data Fig. 4b
4_networkAnalysis/s3_rewiring_and_network_connections.R
258-303
 


Extended Data Fig. 4c
2_DE/5_2_coexpression_analysis_direct_tree.R
136-283
 


Extended Data Fig. 4d
2_DE/SUPP_extra_figures_for_rewiring.R
725-813
 


Extended Data Fig. 4e
2_DE/5_2_coexpression_analysis_direct_tree.R
136-589
 


Extended Data Fig. 4f
11_additional analysis/regulators_nhr_sbp_tor_GEP_mGRN.R
entire file
 


Extended Data Fig. 5a
2_DE/6_3_scatter_plot_for_each_DEG_cluster_PCCtree.R
1-224
 


Extended Data Fig. 5b
2_DE/6_3_scatter_plot_for_each_DEG_cluster_PCCtree.R
1-92
 


Extended Data Fig. 6a
2_DE/6_1_biCluster_heatmaps_PCCtree.R (top row); 2_DE/6_2_rewiring_summary_map_PCCtree.R (bottom row)
top row: 210-219; 229-238; bottom row: 1-162; 162-229
These two scripts produced the last two figures in the first row and the first two figures in the second row. The remaining two figures are repetitive with other main/extended data figures, whose source code were specified there


Extended Data Fig. 6b
10_revision/2_tissue_expression_analysis.R
1-184
 


Extended Data Fig. 6c
10_revision/2_tissue_expression_analysis.R
189-319
 


Extended Data Fig. 6d
10_revision/2_tissue_expression_analysis.R
326-480
 


Extended Data Fig. 7a-e
2_DE/6_3_scatter_plot_for_each_DEG_cluster_PCCtree.R
1-189
The annotation bar plot is in 2_DE/SUPP_extra_figures_for_rewiring.R lines 394-715


Extended Data Fig. 8a
2_DE/3_1_DE_network_analysis.R
649-753
 


Extended Data Fig. 8b
2_DE/3_1_DE_network_analysis.R
649-785
 


Extended Data Fig. 8c
4_networkAnalysis/2_visualize_example_rewirings.R
759-764
 


Extended Data Fig. 8d
2_DE/4_2_pathway_level_analysis.R
2247-2506
the published figure uses level 4 and up direction (2_DE/figures/1_pathway_level_analysis/rxn_and_pathway_rewiring_LEVEL4_up.pdf)


Extended Data Fig. 8e
4_networkAnalysis/2_visualize_example_rewirings.R
803-807
please load the dependency starting from line 1


Extended Data Fig. 8f
4_networkAnalysis/2_visualize_example_rewirings.R
870-874
please load the dependency starting from line 1


Extended Data Fig. 8g
11_additional analysis/uPhe tracing/uphe RNAi.R
entire file
source data also provided along the paper


Extended Data Fig. 9a
4_networkAnalysis/2_visualize_example_rewirings.R
1-601
 


Extended Data Fig. 9b
4_networkAnalysis/2_visualize_example_rewirings.R
691-714
please load the dependency starting from line 1


Extended Data Fig. 9c
11_additional analysis/uGlucose tracing/uGlu rewiring.R
entire file
source data also provided along the paper


Extended Data Fig. 9d
4_networkAnalysis/2_visualize_example_rewirings.R
607-629
please load the dependency starting from line 1


Extended Data Fig. 9e
4_networkAnalysis/2_visualize_example_rewirings.R
636-685
 


Extended Data Fig. 9f
4_networkAnalysis/1_rewiring_network_modules.R
entire file
 


Extended Data Fig. 10a
2_DE/6_2_rewiring_summary_map_PCCtree.R
entire file
This figure is a subset of fig. 2f


Extended Data Fig. 10c
7_FBA_modeling/REVISION/1_cluster_CR_model.R
entire file
 


Extended Data Fig. 11a
7_FBA_modeling/CR_model_final_run/2_DEG_modeling_supp_excludeMultiObjGenes.R
entire file
 


Extended Data Fig. 11b
7_FBA_modeling/CR_model_final_run/2_DEG_modeling_supp_fused_with_FBA.R
1-225
 


Extended Data Fig. 11c
7_FBA_modeling/CR_model_final_run/2_DEG_modeling_supp_fused_with_FBA.R
entire file
corresponding figure produced by lines 337-340


Extended Data Fig. 11d
7_FBA_modeling/CR_model_final_run/2_DEG_modeling_supp_fused_with_FBA.R
entire file
corresponding figure produced by lines 352-355


Extended Data Fig. 11e
7_FBA_modeling/CR_model_final_run/2_DEG_modeling_supp_fused_with_FBA.R
entire file
corresponding figure produced by lines 362-365


Extended Data Fig. 11f
10_revision/2_tissue_expression_analysis.R
486-742
 


Extended Data Fig. 12a
7_FBA_modeling/REVISION/human_perturb_seq/2_DEG_modeling_basic_CR_model.R
300-329
run lines 1-101 to load dependency; Euler plot depends on a random seeds; we manually picked one output figure that has best visual representations; see the corresponding Github or "7_FBA_modeling/REVISION/human_perturb_seq/a1_gene_obj_classification.m" for generating the input matrix (core function matrix)


Extended Data Fig. 12b
7_FBA_modeling/REVISION/human_perturb_seq/1_EDA_of_human_perturb_seq.R
1-176
 


Extended Data Fig. 12c
7_FBA_modeling/REVISION/human_perturb_seq/2_DEG_modeling_basic_CR_model.R
1-297
 


Extended Data Fig. 12d
7_FBA_modeling/REVISION/human_perturb_seq/2_DEG_modeling_basic_CR_model.R
1-297
 


Extended Data Fig. 12e
7_FBA_modeling/REVISION/human_perturb_seq/2_DEG_modeling_supp_fused_with_FBA.R
1-224
 


Extended Data Fig. 12f
7_FBA_modeling/REVISION/human_perturb_seq/2_DEG_modeling_supp_fused_with_FBA.R
entire file
corresponding figure produced by lines 337-341


Extended Data Fig. 12g
7_FBA_modeling/REVISION/human_perturb_seq/2_DEG_modeling_supp_fused_with_FBA.R
entire file
corresponding figure produced by lines 353-356


Extended Data Fig. 12h
7_FBA_modeling/REVISION/human_perturb_seq/2_DEG_modeling_supp_fused_with_FBA.R
entire file
corresponding figure produced by lines 363-366


Extended Data Fig. 12i
7_FBA_modeling/REVISION/human_perturb_seq/2_DEG_modeling_supp_parameter_sensitivity_fused_with_FBA.R
entire file
 


Supplementary Data Fig. 2a
2_DE/5_1_1_DE_similarity_analysis.R
467-572
 


Supplementary Data Fig. 2b
2_DE/6_4_Wald_heatmap_each_RNAi_Cluster.R
entire file
 


Supplementary Data Fig. 2c
2_DE/5_1_2_DE_cluster_justification.R
1-389
 


Supplementary Data Fig. 2d
2_DE/5_1_2_DE_cluster_justification.R
1-308
 


Supplementary Data Fig. 2e
2_DE/5_1_2_DE_cluster_justification.R
1-234
 


Supplementary Data Fig. 2f
12_FLEX_benchmark/run_FLEX_eval.sh
entire file
the bash scripts calls corresponding R scripts for reproducing the figures. You will need to install the FLEX package to run these codes. 


Supplementary Data Fig. 3, 4
N/A
N/A
No coding involved as these figures were made manually


Supplementary Data Fig. 5
7_FBA_modeling/CR_model_final_run/2_DEG_modeling_basic_CR_model.R
1-270
 


Supplementary Data Fig. 6
7_FBA_modeling/CR_model_final_run/2_DEG_modeling_basic_CR_model.R
274-578
please load the dependency starting from line 1




a: The lines indicate the chunk of codes to reproduce the corresponding figure; The figure is reproduced at the end of the referred codes. Please note that you may have to run the codes above the referred chunk (i.e., from the first line) to load dependent variables to execute the referred codes. However, you should be able to reproduce the figure only with the codes within the referred script. 

Notice:

We advise you download the entire project working directory (including all zip files and unzip them into corresponding folders), for reproducing any analysis. If you only download the zip file relevant to your figure of interest, you may or may not run into issues due to the missing files in another folder.  

Contact:

For any questions, please contact Xuhang (Hang) Li at Xuhang.Li@umassmed.edu. (we plan to deposit an updated version with better code annotations, but cannot complete that currently due to time restirctions)