Compare co-expression and regulatory networks between conditions to find rewired gene-gene relationships. DiffCorr tests correlation differences with Fisher's z (gained/lost/reversed edges); DiffCoEx finds rewired modules; DINGO/iDINGO test direct (partial-correlation) rewiring; CoDiNA compares many networks. The key insight: differential connectivity is NOT differential expression -- a gene can rewire its partners with no change in mean expression and be the key signal (Hudson's myostatin). The dominant pitfall is power: rewiring needs more samples than DE, and pairwise testing has a p^2/2 multiple-testing explosion, so most small-cohort "rewired hub" claims are underpowered noise.
# R packages
install.packages('DiffCorr')
install.packages('igraph')
# DGCA (archived from CRAN 2024-05, GitHub-only)
devtools::install_github('andymckenzie/DGCA')
# Python alternative
pip install pandas numpy scipy statsmodels networkx matplotlib
Minimum 20 samples per condition recommended (15 absolute floor).
Tell your AI agent what you want to do: - "Compare co-expression networks between disease and control" - "Find genes with rewired regulatory connections between conditions" - "Which gene pairs gain or lose co-expression in my treatment group?" - "Identify hub genes with the most differential connections"
"I have normalized RNA-seq data from 25 disease and 25 control samples. Find differentially correlated gene pairs."
"Run DiffCorr to compare co-expression between treated and untreated groups."
"Which genes have the most rewired connections between my tumor and normal samples?"
"Show me gained, lost, and reversed edges in the differential network."
"I want direct (not indirect) rewiring between conditions. Run DINGO on partial correlations."
"Find modules that rewire between conditions with DiffCoEx instead of testing every edge."
"Visualize the differential co-expression network colored by edge type."
"Create a network plot showing rewired connections for the top 50 most differentially connected genes."
multipletests defaults to Holm-Sidak; pass method='fdr_bh' for BH.