一键导入
bulk-wgcna-analysis-with-omicverse
// WGCNA co-expression network: soft-threshold, module detection, eigengenes, hub genes, and trait correlation in OmicVerse.
// WGCNA co-expression network: soft-threshold, module detection, eigengenes, hub genes, and trait correlation in OmicVerse.
| name | bulk-wgcna-analysis-with-omicverse |
| title | Bulk WGCNA analysis with omicverse |
| description | WGCNA co-expression network: soft-threshold, module detection, eigengenes, hub genes, and trait correlation in OmicVerse. |
Activate this skill for users who want to reproduce the WGCNA workflow from t_wgcna.ipynb. It guides you through loading expression data, configuring PyWGCNA, constructing weighted gene co-expression networks, and inspecting modules of interest.
omicverse as ov, scanpy as sc, matplotlib.pyplot as plt, and pandas as pd.ov.plot_set().expressionList.csv).from statsmodels import robust and gene_mad = data.apply(robust.mad).data = data.T.loc[gene_mad.sort_values(ascending=False).index[:2000]]).pyWGCNA_5xFAD = ov.bulk.pyWGCNA(name=..., species='mus musculus', geneExp=data.T, outputPath='', save=True).pyWGCNA_5xFAD.geneExpr looks correct before proceeding.pyWGCNA_5xFAD.preprocess() to drop low-expression genes and problematic samples.pyWGCNA_5xFAD.calculate_soft_threshold().calculating_adjacency_matrix() and calculating_TOM_similarity_matrix().calculate_geneTree(), calculate_dynamicMods(kwargs_function={'cutreeHybrid': {...}}).calculate_gene_module(kwargs_function={'moduleEigengenes': {'softPower': 8}}).plot_matrix(save=False) if needed.get_sub_module([...], mod_type='module_color').get_sub_network(mod_list=[...], mod_type='module_color', correlation_threshold=0.2) and plot them via plot_sub_network(...).updateSampleInfo(path='.../sampleInfo.csv', sep=',').setMetadataColor(...).analyseWGCNA() to compute module–trait statistics.plotModuleEigenGene(module, metadata, show=True) and barplotModuleEigenGene(...).top_n_hub_genes(moduleName='lightgreen', n=10).# Before WGCNA: verify enough genes remain after MAD filtering
assert data.shape[0] >= 1000, f"Only {data.shape[0]} genes after filtering — WGCNA needs >1000 for meaningful modules"
# Verify expression values are numeric and non-negative
assert data.dtypes.apply(lambda d: d.kind in 'iuf').all(), "Expression matrix contains non-numeric columns"
# Verify enough samples for network construction
assert data.shape[1] >= 6, f"Only {data.shape[1]} samples — WGCNA needs >=6 samples for reliable co-expression"
save=False to avoid writing many intermediate files.deepSplit or softPower.t_wgcna.ipynbreference.mdBulk RNA-seq batch correction with pyComBat: remove batch effects from merged cohorts, export corrected matrices, and benchmark visualizations.
Bulk RNA-seq DEG pipeline: gene ID mapping, DESeq2 normalization, statistical testing, volcano plots, and pathway enrichment in OmicVerse.
PyDESeq2 differential expression: ID mapping, DE testing, fold-change thresholding, and GSEA enrichment visualization in OmicVerse.
Turn bulk RNA-seq cohorts into synthetic single-cell datasets using omicverse's Bulk2Single workflow for cell fraction estimation, beta-VAE generation, and quality control comparisons against reference scRNA-seq.
Extend scRNA-seq developmental trajectories with BulkTrajBlend by generating intermediate cells from bulk RNA-seq, training beta-VAE and GNN models, and interpolating missing states.
Gene set enrichment analysis with correct geneset format handling. Critical guidance for loading pathway databases and running enrichment in OmicVerse.