Source code used to analyse the data and generate graphics for the publication:
Tania Chancellor1,§ and Gabriel Ferreras Garrucho1,§, Garo Z. Akmakjian2, Héctor Montero1, Emma Wallington3, Samik Bhattacharya4, Christian Korfhage4, Julia Bailey-Serres2, Uta Paszkowski1,5,*
1Crop Science Centre, Department of Plant Sciences, University of Cambridge, 93 Lawrence Weaver Rd, Cambridge, United Kingdom, CB3 0LE. 2University of California-Riverside, Department of Botany and Plant Sciences and Center for Plant Cell Biology, Riverside, CA 92521-0217, USA. 3NIAB, Park Farm, Villa Road, Histon, Cambridge, CB24 9NZ, UK. 4Resolve BioSciences GmbH, Creative Campus Monheim, Creative-Campus-Allee 12, 40789 Monheim, Germany. 5RIKEN, Center for Sustainable Resource Science, Yokohama, Kanagawa 230-0045, Japan. *Corresponding author: up220@cam.ac.uk §These authors contributed equally to this article.
This directory contains scripts for analyzing spatial transcriptomics data generated using the Resolve BioSciences Molecular Cartography platform.
- MC_singlecell_Seurat.R: Single-cell clustering analysis and quality control on all detected cells in the dataset
- MC_arbuscule_singlecell_Seurat.R: Focused single-cell clustering analysis specifically for arbuscule-containing cells
- MC_colocalization.R: Hierarchical clustering analysis to identify co-localization patterns of gene expression
- MC_DGE_DESeq2.R: Differential gene expression analysis between cell types and conditions
- MC_vesicle_arbuscules.R: Calculates transcripts per unit area in vesicles and arbuscules
- cell_segmentation_for_ImageJ/: Segmented cell coordinates for viewing in raw images (AllCells/ and Arbuscules_Vesicles/ subfolders)
- raw_data/: Contains raw gene count matrices and metadata:
Arbuscule_metadata.csv: Metadata for arbuscule-specific analysisArbuscule_pooled_gene_counts.csv: Gene count matrix for arbuscule samplesgene_count_matrix_sample_probe_filtered.csv: Filtered gene count matrixmock_median_matrix.csv: Mock treatment median expression valuesmyc_median_matrix.csv: Mycorrhizal treatment median expression valuespooled_ROI_matrix_filteredv2.txt: Filtered region-of-interest matrixsample_info.csv: Sample metadata and annotationsvesicle_arbuscule_areas.csv: Consolidated area measurements for vesicles and arbusculesvesicle_arbuscule_transcripts.csv: Consolidated gene transcript counts for vesicles and arbuscules
- results/: Output directory organized by analysis type:
single_cell/{plots,tables}/: Single-cell analysis resultsarbuscule_single_cell/{plots,tables}/: Arbuscule-specific resultscolocalization/{plots,tables}/: Clustering and co-localization resultsDGE/{plots,tables}/: Differential expression resultsvesicle_arbuscule/{plots,tables}/: Vesicle/arbuscule transcript per area analysis results
This directory contains scripts for analyzing translating ribosome affinity purification sequencing (TRAP-seq) data.
- TRAP_DGE_analysis.R: Differential gene expression analysis using DESeq2, including:
- Quality control visualizations
- Library complexity assessment
- Variance-stabilizing transformation (VST)
- DEG identification and annotation
- TRAP_plotting_results.R: Comprehensive visualization script generating publication-quality figures, including:
- PCA plots
- Heatmaps with multiple gene sets
- Venn diagrams for DEG comparisons
- GO enrichment analysis and plotting
- gene_count_tables/: Pre-processed gene count matrices:
gene_count_matrix.csv: Raw TRAP-seq countsDESeq2_counts.csv: DESeq2-normalized countsDESeq2_normalized_counts.csv: Size-factor normalized countsDESeq2_VSD_counts.csv: Variance-stabilized transformed countsDESeq2_VSD_counts_averages.csv: VST counts averaged by condition
- info_sheets/: Gene annotations, GO terms, and metadata tables
- results/: Output directory organized by analysis type:
plots/{Average_expression_plots,Heatmaps,Venn,Correlation,Scatterplots,Gene_count_plots,DEG_number,PCA,GO}/DEG_tables/: Activated and repressed gene lists for each comparisoncomparison_tables/: Full comparison results including log2FC and adjusted p-values
-
Clone or download this repository locally
git clone https://github.com/gabriel-ferreras/Spatial_rice_AMF_2025.git cd Spatial_rice_AMF_2025 -
Required R packages
Both analysis pipelines require the following packages (see script headers for complete dependency lists):
- Bioconductor packages: DESeq2, Seurat, ggplot2, ComplexHeatmap, clusterProfiler
- CRAN packages: tidyverse, ggpubr, scales, ggvenn, circlize
-
Molecular Cartography Analysis
The Molecular Cartography scripts process spatial transcriptomics data:
A. Run
MC_singlecell_Seurat.R- Loads raw count matrix and sample metadata
- Performs QC filtering, normalization, and clustering
- Outputs single-cell clustering plots and tables
- Results saved to
results/single_cell/{plots,tables}/
B. Run
MC_arbuscule_singlecell_Seurat.R- Focuses analysis on arbuscule-containing cells
- Performs subset clustering and analysis
- Results saved to
results/arbuscule_single_cell/{plots,tables}/
C. Run
MC_colocalization.R- Performs hierarchical clustering for co-localization analysis
- Generates clustering heatmaps
- Results saved to
results/colocalization/{plots,tables}/
D. Run
MC_DGE_DESeq2.R- Differential expression analysis between cell types/conditions
- Outputs DEG tables and volcano plots
- Results saved to
results/DGE/{plots,tables}/
E. Run
MC_vesicle_arbuscules.R- Analyzes gene expression normalized to structure area (transcripts per μm²)
- Compares expression levels in vesicles vs arbuscules
- Generates individual gene plots and multi-gene comparison plots
- Results saved to
results/vesicle_arbuscule/{plots,tables}/ - Note: Requires
raw_data/vesicle_arbuscule_areas.csvandraw_data/vesicle_arbuscule_transcripts.csvto be present. If working from raw per-image data, run the consolidation scriptraw_data/consolidate_vesicle_arbuscule_data.Rfirst.
-
TRAP-seq Analysis
The TRAP-seq scripts analyze translating ribosome affinity purification sequencing data:
A. Run
TRAP_DGE_analysis.RSections include:
-
LOADING PACKAGES - Install and load required R packages
-
DESEQ2
- Constructs DESeqDataSet from the count matrix
- Performs sample QC, pre-filtering, and variance-stabilizing transformation (VST)
- Saves normalized count matrices for downstream analysis
-
DEG RESULTS
- Extracts statistically significant DEGs
- Generates MA plots and volcano plots
- Outputs DEG tables with annotations to
DEG_tables/andcomparison_tables/
B. Run
TRAP_plotting_results.Rto generate publication-quality figuresImportant: For Figure S12 to generate correctly, copy the Molecular Cartography comparison table into the TRAP-seq
comparison_tables/folder before running this script. The code requires the Molecular Cartography results to compare with TRAP-seq results:cp MolecularCartography/results/DGE/tables/* TRAPseq/comparison_tables/Then uncomment and run the FC and FDR matrix generation code in the script.
Sections include:
-
LOADING PACKAGES - Loads required libraries
-
LOADING DATA
- Loads gene annotations, GO terms, and gene sets
- Loads DEG lists and count matrices
- Prepares FC and p-value matrices
-
PCA
- Principal component analysis from VST-transformed counts
- Figure 5B output
-
DEG NUMBER PLOTS
- Visualizes number of differentially expressed genes per comparison
- Figure 5C output
-
VENN DIAGRAMS
- Shows DEG overlap between conditions and published datasets
- Figures 5D, S10B-D, 6B outputs
-
NORMALISED GENE COUNT PLOTS
- Individual gene expression patterns across samples
- Figure S10A output
-
HEATMAPS
- Expression heatmaps for specific gene categories:
- Cell wall genes (Figure S14B)
- Strigolactone pathway genes (Figure S13)
- Cell-type markers (Figure 5E/S11)
- Nutrient signaling (Figure 6D/S15)
- Defense and immunity genes (Figure S14A)
- Resolve gene set comparison (Figure S12)
- Expression heatmaps for specific gene categories:
-
GO ENRICHMENT
- Gene ontology enrichment analysis for DEG sets
- Generates GO term plots by category
- Figure 6A output
-
Raw sequences, images, and gene count matrices generated in this study are available in the NCBI GEO database under the following accessions:
-
TRAP-seq and Total RNA sequencing data: GSE308140
- Includes raw sequencing reads (fastq files) and processed count matrices for total and TRAP-pulled mRNA samples
- https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE308140
-
Molecular Cartography data: GSE316219
- Includes raw image files and processed spatial transcriptomics count matrices
- https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE316219
To reproduce the analysis from raw data, use the Lexogen NGS Kangaroo Data Analysis Platform or equivalent pipeline to perform:
- Quality control and trimming
- UMI deduplication
- STAR alignment to the Oryza sativa Nipponbare reference transcriptome (Os-Nipponbare-Reference-IRGSP-1.0.58)
- Transcript count quantification
Alternatively, use the pre-processed gene count matrices provided in this repository.
If you use this code or dataset, please cite the associated publication (DOI and citation to be added upon acceptance).