美文网首页
利用MATLAB实现聚类

利用MATLAB实现聚类

作者: 七禾叶瓣 | 来源:发表于2022-05-29 15:14 被阅读0次

一.数据基本信息
数据来源:GEO GSE62533 (CLL)
sample: 12
Sample info:from mononuclear cells from peripheral blood
CLL patients were treat by DMSO or BV6
case:control 3:3:3:3 treat 4h or 20h by DMSO(对照) or BV6(实验) (分别用DMSO和BV6治疗4h和20h)
Platform:GPL570
gene:20486
二.实验目的
基于物体的相似性将物体分成不同的组
三.实验项目

  1. 相似性指标
  2. 层次聚类(对样本)
    x为54675*12基因表达矩阵 原文件GSE62533.matrix.txt
    代码:
    y=x';
    y1=pdist(x','euclidean');#计算欧式距离
    z=linkage(y1);
  3. K-均值聚类(对基因)
    代码:
    K-[idx,C]=kmeans(x,4); %分四类
    figure;
    plot(x(idx==1,1),x(idx==1,2),'r.','MarkerSize',12) %第一类
    hold on
    plot(x(idx==2,1),x(idx==2,2),'b.','MarkerSize',12) %第二类
    hold on
    plot(x(idx==3,1),x(idx==3,2),'g.','MarkerSize',12) %第三类
    hold on
    plot(x(idx==4,1),x(idx==4,2),'m.','MarkerSize',12) %第四类
    plot(C(:,1),C(:,2),'kx',...
    'MarkerSize',15,'LineWidth',3)
    legend('Cluster1','Cluster2','Cluster3','Cluster4',...
    'Location','NW') %图例
    title'Cluster Gene';
    四.实验结果
    层次聚类(Q型)


    image.png
    image.png

    K-均值聚类(R型)


    image.png

相关文章

网友评论

      本文标题:利用MATLAB实现聚类

      本文链接:https://www.haomeiwen.com/subject/soruprtx.html