R Limma包寻找差异表达基因

R Limma包寻找差异表达基因,r,bioinformatics,bioconductor,limma,R,Bioinformatics,Bioconductor,Limma,我的矩阵按以下方式设计,我将其命名为mat1: Probes sample1 sample1 sample2 sample2 sample3 sample3 sample4 sample4 rep1 rep2 rep1 rep2 rep1 rep2 rep1 rep2 ------------------------------------------------------------------------ ge

我的矩阵按以下方式设计,我将其命名为mat1:

 Probes  sample1  sample1 sample2 sample2 sample3 sample3 sample4 sample4  
         rep1      rep2    rep1   rep2    rep1    rep2    rep1    rep2
 ------------------------------------------------------------------------
   gene1   5.098   5.076   5.072  4.677  7.450   7.456   8.564   8.555
   gene2   8.906   8.903   6.700  6.653  6.749   6.754   7.546   7.540
   gene3   7.409   7.398   5.392  5.432  6.715   6.724   5.345   5.330
   gene4   4.876   4.869   5.864  5.981  4.280   4.290   4.267   4.255
   gene4   3.567   3.560   3.554  3.425  8.500   8.564   6.345   6.330 
   gene5   2.569   2.560   8.600  8.645  5.225   5.234   7.345   7.333
我使用limma包来查找DEG

Group <- factor(c("p1", "p1", "p2", "p2","p3", "p4","p4")
design <- model.matrix(~0 + Group)
colnames(design) <- gsub("Group","", colnames(design))
fit <- lmFit(mat1[,1:4],design)
contrast.matrix<-makeContrasts(p1-p2,levels=design)
fit2<-contrasts.fit(fit,contrast.matrix)
fit2<-eBayes(fit2)
sel.diif<-p.adjust(fit2$F.p.value,method="fdr")<0.05
deg<-mat1[,1:4][sel.diif,]

Group您的示例不可复制,即我无法复制结果。然而,以下是一些评论:

  • 关于
    deg
    ,您是正确的。它将寻找两个样本之间不同的基因
  • 对比度矩阵:

    makeContrasts(contrasts="p1-(p2+p3+p4)/3", levels=design)
    
    这就是我(可能)解决这个问题的方法。但是,这可能会抵消影响。例如,如果
    p2
    较高,而
    p3
    较低

  • 或者,您也可以使用类似以下内容:

    makeContrasts(contrasts=c("p1-p2", "p1-p3", "p1-p4"), levels=design)
    
    看看重叠的基因


  • 差异表达是什么意思。例如,在示例1中,我必须为
    gene1
    :5.098和5.076设置两个值。为了让它们得到不同的表达,我需要将它们与其他东西进行比较。我应该把它们和什么做比较呢?也许我不清楚,是的,样本1中的那些基因与样本2,3,4相比。我只是想看看我这样做是否正确。
    makeContrasts(contrasts=c("p1-p2", "p1-p3", "p1-p4"), levels=design)