やったこと
RのscRNA-seq用発現変動遺伝子解析パッケージのDEsingleは並列化に対応しているらしいと言うことで試してみました。
DEsingleについては以下を参照してください。
Zhun Miao, Ke Deng, Xiaowo Wang, Xuegong Zhang (2018). DEsingle for detecting three types of differential expression in single-cell RNA-seq data. Bioinformatics, bty332. 10.1093/bioinformatics/bty332.
install
今回はWindows10、R-4.0.0で実行しました。Rを起動し、DEsingleとBiocParallelをインストールします。
BiocManager::install("DEsingle")
BiocManager::install("BiocParallel")
library(DEsingle)
library(BiocParallel)
これで準備完了。
データセット
GEOデータベースのGSE143214のデータセットを使いました。老年と若年者ドナーから採取したT細胞のscRNA-seqデータです。老年725サンプル、若年者716サンプルで計1441サンプルになります。老年サンプルと若年サンプルで発現変動している遺伝子を抽出します。それぞれ別々のファイルに遺伝子発現量が記載されています。ファイルをデータベースからダウンロードして解凍して使用します。
DEG検出
# データの読み込み
old <- read.table("GSE143214_TPM_sc_old.txt", header = T, sep = "\t")
young <- read.table("GSE143214_TPM_sc_young.txt", header = T, sep = "\t")
# データのマージ
all_samples <- merge(old, young, by = "X")
rownames(all_samples) <- all_samples$X
# parallelパラメータの設定
param <- SnowParam(workers = 6, type = "SOCK", progressbar = TRUE)
register(param)
# DEG検出
counts <- all_samples[,2:ncol(all_samples)]
group <- factor(c(rep("O", ncol(old) -1), rep("Y", ncol(young) -1)))
before <- proc.time();results <- DEsingle(counts = counts, group = group, parallel = TRUE, BPPARM = param);after <- proc.time()
after - before
結果
第8世代のIntel(R)Core(TM)i7-8750H 6コアで1323.66秒かかりました。並列化なしと比較しようと思いましたが、時間かかりそうなのでパス。正常に動作していることが確認出来たので良しとしましょう。DEG検出の時間短縮に使えるでしょう。
参考
- DEsingleについて
Zhun Miao, Ke Deng, Xiaowo Wang, Xuegong Zhang (2018). DEsingle for detecting three types of differential expression in single-cell RNA-seq data. Bioinformatics, bty332. 10.1093/bioinformatics/bty332. - データセット
Kared H, Tan SW, Lau MC, Chevrier M et al. Immunological history governs human stem cell memory CD4 heterogeneity via the Wnt signaling pathway. Nat Commun 2020 Feb 10;11(1):821. PMID: 32041953