生信软件

聚类: mfuzz

2023-04-13  本文已影响0人  LET149

https://blog.csdn.net/qazplm12_3/article/details/117341589 https://zhuanlan.zhihu.com/p/493458069

1. 分析代码

require("Mfuzz")

#------------------------------------------------------------------------------------------#
kk <- read.table("/home/zhiyong/Desktop/CCCCCCCC-Drosophila/Figure-1/D/comparasion_of_Dmel-Dsim-Dyak/Comparation-2/CV/Dmel_Dsim_Dyak/Genes_with_all_low_CV_removed/CV_of_Dmel_Dsim_Dyak_for_Heatmap_left.txt")

#------------------------------------------------------------------------------------------#
mfuzz_matrix <- as.matrix(kk)

# create mfuzz-form object
mfuzz_object <- new('ExpressionSet', exprs = mfuzz_matrix)

# process abnormal or missing values, choose one method from below
mfuzz_object <- filter.NA(mfuzz_object, thres = 0.25)
mfuzz_object <- fill.NA(mfuzz_object, mode = 'mean')
mfuzz_object <- filter.std(mfuzz_object, min.std = 0)

# standardization, this step should be ignored if not necessary
mfuzz_object <- standardise(mfuzz_object)

#------------------------------------------------------------------------------------------#
# clustering
set.seed(123)   # set random seed
mfuzz_result <- mfuzz(mfuzz_object, c =6, m = mestimate(mfuzz_object))  # run mfuzz

#------------------------------------------------------------------------------------------#
# plot
mfuzz.plot2(mfuzz_object, cl = mfuzz_result, mfrow = c(2, 3), min.mem=0.1, colo="fancy",
            time.labels = colnames(mfuzz_object), centre=T, centre.col="black", centre.lwd=4)

mfuzz.plot2(mfuzz_object, cl = mfuzz_result, mfrow = c(2, 3), min.mem=0.1,
            time.labels = colnames(mfuzz_object), centre=T, centre.col="black", centre.lwd=4)

pdf("/home/zhiyong/Desktop/CCCCCCCC-Drosophila/Figure-1/D/comparasion_of_Dmel-Dsim-Dyak/Comparation-2/CV/Dmel_Dsim_Dyak/Genes_with_all_low_CV_removed/Mfuzz/cluster-6/plot.pdf", width = 21, height = 10)
mfuzz.plot2(mfuzz_object, cl = mfuzz_result, mfrow = c(1,1), min.mem=0.1,x11=T,
            time.labels = colnames(mfuzz_object), centre=F, centre.col="black", centre.lwd=4, single=1)
dev.off()


kk <- mfuzz.plot2(mfuzz_object, cl = mfuzz_result, mfrow = c(1,1), min.mem=0.1, x11=F,
                  time.labels = colnames(mfuzz_object), centre=F, centre.col="black", centre.lwd=4, single=1)

2. 输出绘图

设置x11=F

上一篇下一篇

猜你喜欢

热点阅读