这个专辑主要在对以前的WGCNA教程进行整理与更新,来看看2025年的新版本吧,以及后续会添加新的内容进来~
以前的专辑见:wgcna,以及 githut上的代码:https://github.com/jmzeng1314/my_WGCNA
本期更新的内容为对三阴性乳腺癌的样本做WGCNA分析,文献为《Co-expression networks revealed potential core lncRNAs in the triple-negative breast cancer》,文章主要使用共表达网络鉴定了三阴性乳腺癌中的核心hub lncRNA,先分别得到差异mRNA与差异lncRNA,然后使用差异分子构建共表达网络。
这里使用TCGA数据库的乳腺癌样本进行WGCNA分析。
按照原来的教程,下载地址为xenabrowser数据库:https://xenabrowser.net/datapages/?cohort=GDC%20TCGA%20Breast%20Cancer%20(BRCA)&removeHub=https%3A%2F%2Fxena.treehouse.gi.ucsc.edu%3A443,但是我发现下载下来的 phenotype中没有 雌激素受体(ER)、黄体酮受体(PR)、人类表皮生长因子受体(HER2) 的信息,这里统一更新为使用 TCGAbiolinks
包去TGCA官网下载数据。
来看看TCGA官网下载的数据。按照之前的帖子:TCGA数据库| 如何将表达矩阵与样本临床数据进行合并?, 使用 TCGAbiolinks
包进行下载,下载好clinical信息,这里不在描述了。
提取三阴性乳腺癌:雌激素受体(ER)、黄体酮受体(PR)、人类表皮生长因子受体(HER2)都表达为阴性的样本
# 临床信息
clinical <- readRDS(file = "../../TCGA_database/TCGA-BRCA/TCGA-BRCA.clinical_patient.rds")
head(clinical)
colnames(clinical)
# 获取含有受体的列名,找出三种受体状态所在的列
grep("receptor", colnames(clinical),value = T)
grep("her2", colnames(clinical),value = T)
# 雌激素受体(ER)
table(clinical$breast_carcinoma_estrogen_receptor_status)
# 黄体酮受体(PR)
table(clinical$breast_carcinoma_progesterone_receptor_status)
# 人类表皮生长因子受体(HER2)
table(clinical$lab_proc_her2_neu_immunohistochemistry_receptor_status)
## 根据ER,PR,HER2将样本分组
table(clinical$breast_carcinoma_estrogen_receptor_status == 'Negative' &
clinical$breast_carcinoma_progesterone_receptor_status == 'Negative' &
clinical$lab_proc_her2_neu_immunohistochemistry_receptor_status == 'Negative')
tnbc_sample <- clinical[clinical$breast_carcinoma_estrogen_receptor_status == 'Negative' &
clinical$breast_carcinoma_progesterone_receptor_status == 'Negative' &
clinical$lab_proc_her2_neu_immunohistochemistry_receptor_status == 'Negative', ]
dim(tnbc_sample)
save(tnbc_sample,file = 'TCGA_BRCA/tnbc_sample.Rdata')
共有116个patient为三阴性乳腺癌病人。
在TCGA中第14,15位的数字01~09代表肿瘤样本,10以上则为正常样本。
按照之前的帖子:TCGA数据库| 如何将表达矩阵与样本临床数据进行合并?, 使用 TCGAbiolinks
包进行下载,下载好lncRNA和mRNA的表达矩阵,这里不在描述了,直接读取下载好的矩阵。
## 1.mRNA expression
## load packages
library(TCGAbiolinks)
library(SummarizedExperiment)
library(tidyverse)
## 提取样本
mrna_count <- readRDS("../../TCGA_database/TCGA-BRCA/tcga_mrna_count_symbol.rds")
mrna_count <- as.data.frame(mrna_count)
rownames(mrna_count) <- mrna_count[,1]
mrna_count <- mrna_count[,-1]
dim(mrna_count)
mrna_count[1:5, 1:5]
1.提取三阴性实体肿瘤样本,14-16编号01A:
# 1.提取三阴性实体肿瘤样本,14-16编号01A
table(substr(colnames(mrna_count),14,16))
tumor_sample <- colnames(mrna_count)[substr(colnames(mrna_count),14,16)=="01A"]
head(tumor_sample)
tumor_sampleid <- substr(tumor_sample,1,12)
head(tumor_sampleid)
# 与三阴性取交集
head(tnbc_sample$bcr_patient_barcode)
tnbc_com <- intersect(tnbc_sample$bcr_patient_barcode, tumor_sampleid)
tnbc_com
length(tnbc_com)
mrna_count_tnbc_tumor <- tumor_sample[ substr(tumor_sample,1,12) %in% tnbc_com ]
mrna_count_tnbc_tumor <- mrna_count[, mrna_count_tnbc_tumor]
mrna_count_tnbc_tumor[1:5, 1:5]
2.提取三阴性正常样本,14-16编号11A:
# 2.提取三阴性正常样本,14-16编号11A
normal_sample <- colnames(mrna_count)[substr(colnames(mrna_count),14,16)=="11A"]
head(normal_sample)
normal_sampleid <- substr(normal_sample,1,12)
head(normal_sampleid)
# 与三阴性取交集
head(tnbc_sample$bcr_patient_barcode)
tnbc_com <- intersect(tnbc_sample$bcr_patient_barcode, normal_sampleid)
tnbc_com
length(tnbc_com)
mrna_count_tnbc_normal <- normal_sample[ substr(normal_sample,1,12) %in% tnbc_com ]
mrna_count_tnbc_normal <- mrna_count[, mrna_count_tnbc_normal]
mrna_count_tnbc_normal[1:5, 1:5]
3.合并:
# 3.合并
mrna_count_tnbc <- cbind(mrna_count_tnbc_tumor, mrna_count_tnbc_normal)
dim(mrna_count_tnbc)
table(substr(colnames(mrna_count_tnbc),14,16))
save(mrna_count_tnbc, file = 'TCGA_BRCA/mrna_count_tnbc.Rdata')
4.提取对应的fpkm矩阵:
# 4.对应的fpkm矩阵
mrna_fpkm <- readRDS("../../TCGA_database/TCGA-BRCA/tcga_mrna_fpkm_symbol.rds")
mrna_fpkm <- as.data.frame(mrna_fpkm)
rownames(mrna_fpkm) <- mrna_fpkm[,1]
mrna_fpkm <- mrna_fpkm[,-1]
mrna_fpkm[1:5, 1:5]
mrna_fpkm_tnbc <- mrna_fpkm[, colnames(mrna_count_tnbc)]
save(mrna_fpkm_tnbc, file = 'TCGA_BRCA/mrna_fpkm_tnbc.Rdata')
5.对应的lncRNA expression count矩阵:
# 5.对应的lncRNA expression count矩阵
lnc_count <- readRDS("../../TCGA_database/TCGA-BRCA/tcga_lnc_count_symbol.rds")
lnc_count <- as.data.frame(lnc_count)
rownames(lnc_count) <- lnc_count[,1]
lnc_count <- lnc_count[,-1]
lnc_count[1:5, 1:5]
lnc_count_tnbc <- lnc_count[, colnames(mrna_count_tnbc)]
dim(lnc_count_tnbc)
save(lnc_count_tnbc, file = 'TCGA_BRCA/lnc_count_tnbc.Rdata')
6.对应的lnc fpkm表达:
# 6.对应的lnc fpkm表达:
lnc_fpkm <- readRDS("../../TCGA_database/TCGA-BRCA/tcga_lnc_fpkm_symbol.rds")
lnc_fpkm <- as.data.frame(lnc_fpkm)
rownames(lnc_fpkm) <- lnc_fpkm[,1]
lnc_fpkm <- lnc_fpkm[,-1]
lnc_fpkm[1:5, 1:5]
lnc_fpkm_tnbc <- lnc_fpkm[, colnames(mrna_count_tnbc)]
dim(lnc_fpkm_tnbc)
save(lnc_fpkm_tnbc, file = 'TCGA_BRCA/lnc_fpkm_tnbc.Rdata')
下一期见~