Gene Co-expression Visualization

Bioinformatics
Go
Visualization
D3.js
A Go program with an interactive D3.js web app to detect and explore gene co-expression clusters from an expression matrix.

Download presentation (.pptx) Download report (PDF)

Overview

Goal. Identify co-expressed gene groups from a user-provided expression matrix and visualize the network interactively.

Two modes. - Text mode: write detected clusters to a results file. - Web mode: serve an interactive D3.js force-layout graph via a Go HTTP server.

Positive correlations are one edge color and negative correlations another; users can inspect cluster membership and relationships at a glance.


Quick Start

Text mode (CLI)

  1. Provide an expression matrix (rows = genes, cols = samples).

  2. Run the executable with:

    ./Go_codes.exe text <input.txt> <output.txt> <corr_threshold>
  3. The output file lists clusters and membership.

Web mode (interactive)

  1. Start the server:

    ./Go_codes.exe web
  2. Open http://localhost:8000.

  3. Upload your matrix, set correlation cutoff, browse clusters, and click Generate graph to open an interactive view.


Methods (brief)

  • Filtering: remove genes with low expression across all samples (threshold configurable in code).
  • Similarity: compute Pearson correlation for all gene pairs.
  • Graph: build an adjacency matrix using a user-defined cutoff (e.g., |r| ≥ 0.85) to mark edges.
  • Clustering: traverse the undirected graph via DFS to extract connected components.
  • Visualization: render selected component with D3.js (force-directed layout).
  • Enrichment (optional): export cluster gene lists and analyze in shinyGO (external).

Example (replace with your assets)

  • Dataset: Data/sample_200_rand.txt (subset for speed).

  • Example command:

    ./Go_codes.exe text Data/sample_200_rand.txt Results/coexpr.txt 0.85
  • Web demo screenshot:
    Interactive graph example


Notes & Future Work

  • Make expression cutoff user-configurable (currently hardcoded in the sample).
  • Pass selected cluster index across handlers to load the matching JSON (avoid hardcoding index 0).
  • Add optional parallelism for correlation and traversal on large matrices.
  • Provide built-in GO enrichment by calling an R script from Go for one-shot reports.