Nov 03, 2025

Public workspaceDS_Type: A framework to detect phenotype-specific co-expression shifts in small-n RNA-seq

  • Jung-Chen Su1,
  • Chen-Ling Lee2,
  • Fan-Wei Yang1,
  • Yan-Chih Chen2,
  • Te-Lun Mai*2
  • 1Department of Pharmacy, National Yang Ming Chiao Tung University;
  • 2Department of Life Science, National Taiwan University
Icon indicating open access to content
QR code linking to this content
Protocol CitationJung-Chen Su, Chen-Ling Lee, Fan-Wei Yang, Yan-Chih Chen, Te-Lun Mai* 2025. DS_Type: A framework to detect phenotype-specific co-expression shifts in small-n RNA-seq. protocols.io https://dx.doi.org/10.17504/protocols.io.bp2l6zemdgqe/v1
Manuscript citation:
Jung-Chen Su, Chen-Ling Lee, Fan-Wei Yang, Yan-Chih Chen, and Te-Lun Mai*. "Network-based exploration of 4-(Phenylsulfonyl)morpholine molecules for metastatic triple-negative breast cancer suppression," under review.
License: This is an open access protocol distributed under the terms of the Creative Commons Attribution License,  which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited
Protocol status: In development
We are still developing and optimizing this protocol
Created: November 01, 2025
Last Modified: November 03, 2025
Protocol Integer ID: 231296
Keywords: gene co-expression analysis, differential network analysis, small-n RNA-seq, classifies gene pairs into ds1, specific changes in gene, classifies gene pair, ds-type, rna, ds1, gene, ds3, ds2, phenotype, seq this protocol, seq design, seq
Abstract
This protocol provides an executable workflow to detect phenotype-specific changes in gene–gene co-expression from small-N RNA-seq designs. The procedure reconstructs per-condition correlations, estimates empirical P-values by permutation, and classifies gene pairs into DS1 (gain), DS2 (loss), or DS3 (changed magnitude) relative to paired before/after states (e.g., DMSO → GL24) for each cell line.
Troubleshooting
Before start
  • Operating system: Linux/macOS/Windows with Rscript available.
  • R (≥ 4.2) with packages: data.table, stringr (install commands below).
  • Source code and toy example: GitHub release/DS_type (https://github.com/telunmai/DS_type)
Section 1 — Environment setup
Install R packages
install.packages(data.table)
install.packages(stringr)

Load R packages
library(data.table)
library(stringr)

Section 2 — Step 1: Per-condition correlations with empirical P
Run Step 1 (default settings)
Script 1 builds per-group correlation statistics and permutation empirical P-values.
Rscript Step1.Correlation_for_DS.R

Input file: TPM_matrix_sample.txt (genes × samples, with one gene ID column.)
Output file: DS_pairwise_cor_stats.tsv (Build per-group stats (V_, Cor_, P_, empP_))

Notes.
  • A gene pair is evaluable within a group if ≥ 3 valid paired observations.
  • The script sets an internal random seed per permutation replicate to support reproducibility.
  • The number of permutations (B_perm) controls stability of empirical P; increase for larger datasets.
Section 3 — Step 2: DS classification
Run Step 2 (default settings)
Script 2 calls S/NS/NA per condition, derives per-line transitions, and classifies DS1/DS2/DS3.
Rscript Step2.Identify_DS_types.R

Input file: DS_pairwise_cor_stats.tsv
Output file: DS_types.tsv (Classify DS1/DS2/DS3 from the stats table)
Notes.
  • Significant (S): P < 0.005 and empP < 0.005.
  • Non-significant (NS): P > 0.05 (irrespective of empP)
  • NA: any other case
Results: DS classification

For each line’s before → after switch:
  • DS1 (gain): all evaluable “effective” lines switch from NS/NA → S; reference lines remain unchanged (if required).
  • DS2 (loss): all evaluable “effective” lines switch from S → NS/NA; reference lines unchanged (if required).
  • DS3 (changed magnitude): evaluable “effective” lines remain S→S, and the absolute change in correlation magnitude satisfies (default delta_r_thresh is 0.10):

Δr= |​∣rafter​∣−∣rbefore​∣​| ≥ delta_r_thresh