0%

基因表达时序聚类分析Mfuzz包

Mfuzz能够识别表达谱潜在的时间序列模式,并将具有相似表达模式的基因进行聚类。
本文介绍Mfuzz包的使用。

1. 安装

1
2
3
4
> BiocManager::install("Mfuzz")
> library(Mfuzz)
#载入数据,行为基因,列为样本
> data <- read.csv(file = "data.csv",header = T)

2.Mfuzz使用

构建对象,并对表达矩阵进行标准化,进行聚类分析。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 构建对象
> dat <- new('ExpressionSet',exprs = data)
# 处理NA,如果缺失值的比例超过thres,则会被过滤掉
> dat <- filter.NA(dat,thres=0.1)
# 将缺失值替换,可选:mean、median等
> dat <- fill.NA(dat,mode = mean)
# 标准化
> dat <- standardise(dat)

# 评估最佳的m值
> m <- mestimate(dat)
# mfuzz聚类,聚类的个数c需要自己定义
> cl <- mfuzz(dat,c=8,m=m)

# time.labels参数设置时间轴label
> mfuzz.plot(dat,cl=cl,mfrow=c(4,2),time.labels=seq(0,160,10))

3. 获取各个cluster中的基因

1
2
3
4
5
6
# 每个cluster的基因数目
> cl$size
# 每个基因所属的cluster
> head(cl$cluster)
> head(cl$membership)