【问题标题】:Plot a gene matrix绘制基因矩阵
【发布时间】:2023-03-04 00:13:02
【问题描述】:

我有一个包含基因计数和许多样本的 .csv 文件(如下所示)。我希望能够按样本绘制总基因计数图。文件格式如下:

       Sample
Gene    1        2
gene1   272.43    911.83
gene2   212.29    151.55
gene3   39.41      22.17

任何想法如何做到这一点?

【问题讨论】:

    标签: r matrix plot bioinformatics


    【解决方案1】:

    不确定您要的是什么,但也许这就是您的想法:

    library('ggplot2')
    Sample <- melt(data.frame(Gene=c('gene1', 'gene2', 'gene3'), sample1=c(272.43,212.29,39.41), sample2=c(911.83,151.55,22.17)))
    p <- ggplot(data=Sample, aes(x=variable, y=value)) + geom_line(aes(colour=Gene, group=Gene))
    p
    

    给你这个:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-03-20
      • 2019-09-19
      • 2019-05-09
      • 2016-01-31
      • 2020-10-22
      • 2015-02-23
      • 2017-09-16
      相关资源
      最近更新 更多