Marginal differential expression

Guillermo Ayala

5/11/23

Abstract

In this vignette we review the basic functions to perform a marginal differential expression analysis.

Packages

First, we need to load Biobase and tami with

library(Biobase)
library(tami)

or

pacman::p_load(Biobase,tami)

Data

The data set will be loaded from tamidata using

data(gse21942,package="tamidata")

The class (kind of data) of this data set is

class(gse21942)
[1] "ExpressionSet"
attr(,"package")
[1] "Biobase"

Additional information about the data set could be obtained with

help(gse21942,package="tamidata")

or just searching gse21942 in the web.

The phenotipic variables contains the information about the samples. Their names are

varLabels(gse21942)
 [1] "Source.Name"                            
 [2] "Comment..Sample_description."           
 [3] "Comment..Sample_source_name."           
 [4] "Characteristics.Organism."              
 [5] "Term.Source.REF"                        
 [6] "Term.Accession.Number"                  
 [7] "Characteristics.cell.type."             
 [8] "Characteristics.disease.state."         
 [9] "Term.Source.REF.1"                      
[10] "Term.Accession.Number.1"                
[11] "Protocol.REF"                           
[12] "Term.Source.REF.2"                      
[13] "Protocol.REF.1"                         
[14] "Term.Source.REF.3"                      
[15] "Extract.Name"                           
[16] "Material.Type"                          
[17] "Protocol.REF.2"                         
[18] "Term.Source.REF.4"                      
[19] "Labeled.Extract.Name"                   
[20] "Label"                                  
[21] "Protocol.REF.3"                         
[22] "Term.Source.REF.5"                      
[23] "Hybridization.Name"                     
[24] "Array.Design.REF"                       
[25] "Term.Source.REF.6"                      
[26] "Protocol.REF.4"                         
[27] "Term.Source.REF.7"                      
[28] "Protocol.REF.5"                         
[29] "Term.Source.REF.8"                      
[30] "Array.Data.File"                        
[31] "Comment..ArrayExpress.FTP.file."        
[32] "Protocol.REF.6"                         
[33] "Term.Source.REF.9"                      
[34] "Normalization.Name"                     
[35] "Derived.Array.Data.File"                
[36] "Comment..Derived.ArrayExpress.FTP.file."
[37] "FactorValue..DISEASE.STATE."            
[38] "Term.Source.REF.10"                     
[39] "Term.Accession.Number.2"                
[40] "GROUP"                                  

The phenotipic variables can be obtained with

pData(gse21942)
              Source.Name
GSM545846.CEL GSM545846 1
GSM545845.CEL GSM545845 1
GSM545844.CEL GSM545844 1
GSM545843.CEL GSM545843 1
GSM545842.CEL GSM545842 1
GSM545841.CEL GSM545841 1
GSM545840.CEL GSM545840 1
GSM545839.CEL GSM545839 1
GSM545838.CEL GSM545838 1
GSM545837.CEL GSM545837 1
GSM545836.CEL GSM545836 1
GSM545835.CEL GSM545835 1
GSM545834.CEL GSM545834 1
GSM545833.CEL GSM545833 1
GSM545832.CEL GSM545832 1
GSM545831.CEL GSM545831 1
GSM545830.CEL GSM545830 1
GSM545829.CEL GSM545829 1
GSM545828.CEL GSM545828 1
GSM545827.CEL GSM545827 1
GSM545826.CEL GSM545826 1
GSM545825.CEL GSM545825 1
GSM545824.CEL GSM545824 1
GSM545823.CEL GSM545823 1
GSM545822.CEL GSM545822 1
GSM545821.CEL GSM545821 1
GSM545820.CEL GSM545820 1
GSM545819.CEL GSM545819 1
GSM545818.CEL GSM545818 1
                                                         Comment..Sample_description.
GSM545846.CEL                                   Gene expression data from MS patients
GSM545845.CEL                                   Gene expression data from MS patients
GSM545844.CEL                                   Gene expression data from MS patients
GSM545843.CEL                                   Gene expression data from MS patients
GSM545842.CEL                                   Gene expression data from MS patients
GSM545841.CEL                                   Gene expression data from MS patients
GSM545840.CEL                                   Gene expression data from MS patients
GSM545839.CEL                                   Gene expression data from MS patients
GSM545838.CEL                                   Gene expression data from MS patients
GSM545837.CEL                                   Gene expression data from MS patients
GSM545836.CEL                                   Gene expression data from MS patients
GSM545835.CEL                                   Gene expression data from MS patients
GSM545834.CEL                                   Gene expression data from MS patients
GSM545833.CEL                                   Gene expression data from MS patients
GSM545832.CEL Gene expression data from controls representing the general population.
GSM545831.CEL Gene expression data from controls representing the general population.
GSM545830.CEL Gene expression data from controls representing the general population.
GSM545829.CEL Gene expression data from controls representing the general population.
GSM545828.CEL Gene expression data from controls representing the general population.
GSM545827.CEL Gene expression data from controls representing the general population.
GSM545826.CEL Gene expression data from controls representing the general population.
GSM545825.CEL Gene expression data from controls representing the general population.
GSM545824.CEL Gene expression data from controls representing the general population.
GSM545823.CEL Gene expression data from controls representing the general population.
GSM545822.CEL Gene expression data from controls representing the general population.
GSM545821.CEL Gene expression data from controls representing the general population.
GSM545820.CEL Gene expression data from controls representing the general population.
GSM545819.CEL Gene expression data from controls representing the general population.
GSM545818.CEL Gene expression data from controls representing the general population.
                    Comment..Sample_source_name. Characteristics.Organism.
GSM545846.CEL peripheral blood mononuclear cells              Homo sapiens
GSM545845.CEL peripheral blood mononuclear cells              Homo sapiens
GSM545844.CEL peripheral blood mononuclear cells              Homo sapiens
GSM545843.CEL peripheral blood mononuclear cells              Homo sapiens
GSM545842.CEL peripheral blood mononuclear cells              Homo sapiens
GSM545841.CEL peripheral blood mononuclear cells              Homo sapiens
GSM545840.CEL peripheral blood mononuclear cells              Homo sapiens
GSM545839.CEL peripheral blood mononuclear cells              Homo sapiens
GSM545838.CEL peripheral blood mononuclear cells              Homo sapiens
GSM545837.CEL peripheral blood mononuclear cells              Homo sapiens
GSM545836.CEL peripheral blood mononuclear cells              Homo sapiens
GSM545835.CEL peripheral blood mononuclear cells              Homo sapiens
GSM545834.CEL peripheral blood mononuclear cells              Homo sapiens
GSM545833.CEL peripheral blood mononuclear cells              Homo sapiens
GSM545832.CEL peripheral blood mononuclear cells              Homo sapiens
GSM545831.CEL peripheral blood mononuclear cells              Homo sapiens
GSM545830.CEL peripheral blood mononuclear cells              Homo sapiens
GSM545829.CEL peripheral blood mononuclear cells              Homo sapiens
GSM545828.CEL peripheral blood mononuclear cells              Homo sapiens
GSM545827.CEL peripheral blood mononuclear cells              Homo sapiens
GSM545826.CEL peripheral blood mononuclear cells              Homo sapiens
GSM545825.CEL peripheral blood mononuclear cells              Homo sapiens
GSM545824.CEL peripheral blood mononuclear cells              Homo sapiens
GSM545823.CEL peripheral blood mononuclear cells              Homo sapiens
GSM545822.CEL peripheral blood mononuclear cells              Homo sapiens
GSM545821.CEL peripheral blood mononuclear cells              Homo sapiens
GSM545820.CEL peripheral blood mononuclear cells              Homo sapiens
GSM545819.CEL peripheral blood mononuclear cells              Homo sapiens
GSM545818.CEL peripheral blood mononuclear cells              Homo sapiens
              Term.Source.REF                            Term.Accession.Number
GSM545846.CEL             EFO http://purl.org/obo/owl/NCBITaxon#NCBITaxon_9606
GSM545845.CEL             EFO http://purl.org/obo/owl/NCBITaxon#NCBITaxon_9606
GSM545844.CEL             EFO http://purl.org/obo/owl/NCBITaxon#NCBITaxon_9606
GSM545843.CEL             EFO http://purl.org/obo/owl/NCBITaxon#NCBITaxon_9606
GSM545842.CEL             EFO http://purl.org/obo/owl/NCBITaxon#NCBITaxon_9606
GSM545841.CEL             EFO http://purl.org/obo/owl/NCBITaxon#NCBITaxon_9606
GSM545840.CEL             EFO http://purl.org/obo/owl/NCBITaxon#NCBITaxon_9606
GSM545839.CEL             EFO http://purl.org/obo/owl/NCBITaxon#NCBITaxon_9606
GSM545838.CEL             EFO http://purl.org/obo/owl/NCBITaxon#NCBITaxon_9606
GSM545837.CEL             EFO http://purl.org/obo/owl/NCBITaxon#NCBITaxon_9606
GSM545836.CEL             EFO http://purl.org/obo/owl/NCBITaxon#NCBITaxon_9606
GSM545835.CEL             EFO http://purl.org/obo/owl/NCBITaxon#NCBITaxon_9606
GSM545834.CEL             EFO http://purl.org/obo/owl/NCBITaxon#NCBITaxon_9606
GSM545833.CEL             EFO http://purl.org/obo/owl/NCBITaxon#NCBITaxon_9606
GSM545832.CEL             EFO http://purl.org/obo/owl/NCBITaxon#NCBITaxon_9606
GSM545831.CEL             EFO http://purl.org/obo/owl/NCBITaxon#NCBITaxon_9606
GSM545830.CEL             EFO http://purl.org/obo/owl/NCBITaxon#NCBITaxon_9606
GSM545829.CEL             EFO http://purl.org/obo/owl/NCBITaxon#NCBITaxon_9606
GSM545828.CEL             EFO http://purl.org/obo/owl/NCBITaxon#NCBITaxon_9606
GSM545827.CEL             EFO http://purl.org/obo/owl/NCBITaxon#NCBITaxon_9606
GSM545826.CEL             EFO http://purl.org/obo/owl/NCBITaxon#NCBITaxon_9606
GSM545825.CEL             EFO http://purl.org/obo/owl/NCBITaxon#NCBITaxon_9606
GSM545824.CEL             EFO http://purl.org/obo/owl/NCBITaxon#NCBITaxon_9606
GSM545823.CEL             EFO http://purl.org/obo/owl/NCBITaxon#NCBITaxon_9606
GSM545822.CEL             EFO http://purl.org/obo/owl/NCBITaxon#NCBITaxon_9606
GSM545821.CEL             EFO http://purl.org/obo/owl/NCBITaxon#NCBITaxon_9606
GSM545820.CEL             EFO http://purl.org/obo/owl/NCBITaxon#NCBITaxon_9606
GSM545819.CEL             EFO http://purl.org/obo/owl/NCBITaxon#NCBITaxon_9606
GSM545818.CEL             EFO http://purl.org/obo/owl/NCBITaxon#NCBITaxon_9606
                Characteristics.cell.type. Characteristics.disease.state.
GSM545846.CEL peripheral blood mononuclear             multiple sclerosis
GSM545845.CEL peripheral blood mononuclear             multiple sclerosis
GSM545844.CEL peripheral blood mononuclear             multiple sclerosis
GSM545843.CEL peripheral blood mononuclear             multiple sclerosis
GSM545842.CEL peripheral blood mononuclear             multiple sclerosis
GSM545841.CEL peripheral blood mononuclear             multiple sclerosis
GSM545840.CEL peripheral blood mononuclear             multiple sclerosis
GSM545839.CEL peripheral blood mononuclear             multiple sclerosis
GSM545838.CEL peripheral blood mononuclear             multiple sclerosis
GSM545837.CEL peripheral blood mononuclear             multiple sclerosis
GSM545836.CEL peripheral blood mononuclear             multiple sclerosis
GSM545835.CEL peripheral blood mononuclear             multiple sclerosis
GSM545834.CEL peripheral blood mononuclear             multiple sclerosis
GSM545833.CEL peripheral blood mononuclear             multiple sclerosis
GSM545832.CEL peripheral blood mononuclear                        healthy
GSM545831.CEL peripheral blood mononuclear                        healthy
GSM545830.CEL peripheral blood mononuclear                        healthy
GSM545829.CEL peripheral blood mononuclear                        healthy
GSM545828.CEL peripheral blood mononuclear                        healthy
GSM545827.CEL peripheral blood mononuclear                        healthy
GSM545826.CEL peripheral blood mononuclear                        healthy
GSM545825.CEL peripheral blood mononuclear                        healthy
GSM545824.CEL peripheral blood mononuclear                        healthy
GSM545823.CEL peripheral blood mononuclear                        healthy
GSM545822.CEL peripheral blood mononuclear                        healthy
GSM545821.CEL peripheral blood mononuclear                        healthy
GSM545820.CEL peripheral blood mononuclear                        healthy
GSM545819.CEL peripheral blood mononuclear                        healthy
GSM545818.CEL peripheral blood mononuclear                        healthy
              Term.Source.REF.1 Term.Accession.Number.1 Protocol.REF
GSM545846.CEL               EFO             EFO_0003885 P-GSE21942-2
GSM545845.CEL               EFO             EFO_0003885 P-GSE21942-2
GSM545844.CEL               EFO             EFO_0003885 P-GSE21942-2
GSM545843.CEL               EFO             EFO_0003885 P-GSE21942-2
GSM545842.CEL               EFO             EFO_0003885 P-GSE21942-2
GSM545841.CEL               EFO             EFO_0003885 P-GSE21942-2
GSM545840.CEL               EFO             EFO_0003885 P-GSE21942-2
GSM545839.CEL               EFO             EFO_0003885 P-GSE21942-2
GSM545838.CEL               EFO             EFO_0003885 P-GSE21942-2
GSM545837.CEL               EFO             EFO_0003885 P-GSE21942-2
GSM545836.CEL               EFO             EFO_0003885 P-GSE21942-2
GSM545835.CEL               EFO             EFO_0003885 P-GSE21942-2
GSM545834.CEL               EFO             EFO_0003885 P-GSE21942-2
GSM545833.CEL               EFO             EFO_0003885 P-GSE21942-2
GSM545832.CEL                                           P-GSE21942-2
GSM545831.CEL                                           P-GSE21942-2
GSM545830.CEL                                           P-GSE21942-2
GSM545829.CEL                                           P-GSE21942-2
GSM545828.CEL                                           P-GSE21942-2
GSM545827.CEL                                           P-GSE21942-2
GSM545826.CEL                                           P-GSE21942-2
GSM545825.CEL                                           P-GSE21942-2
GSM545824.CEL                                           P-GSE21942-2
GSM545823.CEL                                           P-GSE21942-2
GSM545822.CEL                                           P-GSE21942-2
GSM545821.CEL                                           P-GSE21942-2
GSM545820.CEL                                           P-GSE21942-2
GSM545819.CEL                                           P-GSE21942-2
GSM545818.CEL                                           P-GSE21942-2
              Term.Source.REF.2 Protocol.REF.1 Term.Source.REF.3
GSM545846.CEL                NA   P-GSE21942-3                NA
GSM545845.CEL                NA   P-GSE21942-3                NA
GSM545844.CEL                NA   P-GSE21942-3                NA
GSM545843.CEL                NA   P-GSE21942-3                NA
GSM545842.CEL                NA   P-GSE21942-3                NA
GSM545841.CEL                NA   P-GSE21942-3                NA
GSM545840.CEL                NA   P-GSE21942-3                NA
GSM545839.CEL                NA   P-GSE21942-3                NA
GSM545838.CEL                NA   P-GSE21942-3                NA
GSM545837.CEL                NA   P-GSE21942-3                NA
GSM545836.CEL                NA   P-GSE21942-3                NA
GSM545835.CEL                NA   P-GSE21942-3                NA
GSM545834.CEL                NA   P-GSE21942-3                NA
GSM545833.CEL                NA   P-GSE21942-3                NA
GSM545832.CEL                NA   P-GSE21942-3                NA
GSM545831.CEL                NA   P-GSE21942-3                NA
GSM545830.CEL                NA   P-GSE21942-3                NA
GSM545829.CEL                NA   P-GSE21942-3                NA
GSM545828.CEL                NA   P-GSE21942-3                NA
GSM545827.CEL                NA   P-GSE21942-3                NA
GSM545826.CEL                NA   P-GSE21942-3                NA
GSM545825.CEL                NA   P-GSE21942-3                NA
GSM545824.CEL                NA   P-GSE21942-3                NA
GSM545823.CEL                NA   P-GSE21942-3                NA
GSM545822.CEL                NA   P-GSE21942-3                NA
GSM545821.CEL                NA   P-GSE21942-3                NA
GSM545820.CEL                NA   P-GSE21942-3                NA
GSM545819.CEL                NA   P-GSE21942-3                NA
GSM545818.CEL                NA   P-GSE21942-3                NA
                     Extract.Name Material.Type Protocol.REF.2
GSM545846.CEL GSM545846 extract 1     total RNA   P-GSE21942-4
GSM545845.CEL GSM545845 extract 1     total RNA   P-GSE21942-4
GSM545844.CEL GSM545844 extract 1     total RNA   P-GSE21942-4
GSM545843.CEL GSM545843 extract 1     total RNA   P-GSE21942-4
GSM545842.CEL GSM545842 extract 1     total RNA   P-GSE21942-4
GSM545841.CEL GSM545841 extract 1     total RNA   P-GSE21942-4
GSM545840.CEL GSM545840 extract 1     total RNA   P-GSE21942-4
GSM545839.CEL GSM545839 extract 1     total RNA   P-GSE21942-4
GSM545838.CEL GSM545838 extract 1     total RNA   P-GSE21942-4
GSM545837.CEL GSM545837 extract 1     total RNA   P-GSE21942-4
GSM545836.CEL GSM545836 extract 1     total RNA   P-GSE21942-4
GSM545835.CEL GSM545835 extract 1     total RNA   P-GSE21942-4
GSM545834.CEL GSM545834 extract 1     total RNA   P-GSE21942-4
GSM545833.CEL GSM545833 extract 1     total RNA   P-GSE21942-4
GSM545832.CEL GSM545832 extract 1     total RNA   P-GSE21942-4
GSM545831.CEL GSM545831 extract 1     total RNA   P-GSE21942-4
GSM545830.CEL GSM545830 extract 1     total RNA   P-GSE21942-4
GSM545829.CEL GSM545829 extract 1     total RNA   P-GSE21942-4
GSM545828.CEL GSM545828 extract 1     total RNA   P-GSE21942-4
GSM545827.CEL GSM545827 extract 1     total RNA   P-GSE21942-4
GSM545826.CEL GSM545826 extract 1     total RNA   P-GSE21942-4
GSM545825.CEL GSM545825 extract 1     total RNA   P-GSE21942-4
GSM545824.CEL GSM545824 extract 1     total RNA   P-GSE21942-4
GSM545823.CEL GSM545823 extract 1     total RNA   P-GSE21942-4
GSM545822.CEL GSM545822 extract 1     total RNA   P-GSE21942-4
GSM545821.CEL GSM545821 extract 1     total RNA   P-GSE21942-4
GSM545820.CEL GSM545820 extract 1     total RNA   P-GSE21942-4
GSM545819.CEL GSM545819 extract 1     total RNA   P-GSE21942-4
GSM545818.CEL GSM545818 extract 1     total RNA   P-GSE21942-4
              Term.Source.REF.4 Labeled.Extract.Name  Label Protocol.REF.3
GSM545846.CEL                NA       GSM545846 LE 1 biotin   P-GSE21942-5
GSM545845.CEL                NA       GSM545845 LE 1 biotin   P-GSE21942-5
GSM545844.CEL                NA       GSM545844 LE 1 biotin   P-GSE21942-5
GSM545843.CEL                NA       GSM545843 LE 1 biotin   P-GSE21942-5
GSM545842.CEL                NA       GSM545842 LE 1 biotin   P-GSE21942-5
GSM545841.CEL                NA       GSM545841 LE 1 biotin   P-GSE21942-5
GSM545840.CEL                NA       GSM545840 LE 1 biotin   P-GSE21942-5
GSM545839.CEL                NA       GSM545839 LE 1 biotin   P-GSE21942-5
GSM545838.CEL                NA       GSM545838 LE 1 biotin   P-GSE21942-5
GSM545837.CEL                NA       GSM545837 LE 1 biotin   P-GSE21942-5
GSM545836.CEL                NA       GSM545836 LE 1 biotin   P-GSE21942-5
GSM545835.CEL                NA       GSM545835 LE 1 biotin   P-GSE21942-5
GSM545834.CEL                NA       GSM545834 LE 1 biotin   P-GSE21942-5
GSM545833.CEL                NA       GSM545833 LE 1 biotin   P-GSE21942-5
GSM545832.CEL                NA       GSM545832 LE 1 biotin   P-GSE21942-5
GSM545831.CEL                NA       GSM545831 LE 1 biotin   P-GSE21942-5
GSM545830.CEL                NA       GSM545830 LE 1 biotin   P-GSE21942-5
GSM545829.CEL                NA       GSM545829 LE 1 biotin   P-GSE21942-5
GSM545828.CEL                NA       GSM545828 LE 1 biotin   P-GSE21942-5
GSM545827.CEL                NA       GSM545827 LE 1 biotin   P-GSE21942-5
GSM545826.CEL                NA       GSM545826 LE 1 biotin   P-GSE21942-5
GSM545825.CEL                NA       GSM545825 LE 1 biotin   P-GSE21942-5
GSM545824.CEL                NA       GSM545824 LE 1 biotin   P-GSE21942-5
GSM545823.CEL                NA       GSM545823 LE 1 biotin   P-GSE21942-5
GSM545822.CEL                NA       GSM545822 LE 1 biotin   P-GSE21942-5
GSM545821.CEL                NA       GSM545821 LE 1 biotin   P-GSE21942-5
GSM545820.CEL                NA       GSM545820 LE 1 biotin   P-GSE21942-5
GSM545819.CEL                NA       GSM545819 LE 1 biotin   P-GSE21942-5
GSM545818.CEL                NA       GSM545818 LE 1 biotin   P-GSE21942-5
              Term.Source.REF.5 Hybridization.Name Array.Design.REF
GSM545846.CEL                NA          GSM545846        A-AFFY-44
GSM545845.CEL                NA          GSM545845        A-AFFY-44
GSM545844.CEL                NA          GSM545844        A-AFFY-44
GSM545843.CEL                NA          GSM545843        A-AFFY-44
GSM545842.CEL                NA          GSM545842        A-AFFY-44
GSM545841.CEL                NA          GSM545841        A-AFFY-44
GSM545840.CEL                NA          GSM545840        A-AFFY-44
GSM545839.CEL                NA          GSM545839        A-AFFY-44
GSM545838.CEL                NA          GSM545838        A-AFFY-44
GSM545837.CEL                NA          GSM545837        A-AFFY-44
GSM545836.CEL                NA          GSM545836        A-AFFY-44
GSM545835.CEL                NA          GSM545835        A-AFFY-44
GSM545834.CEL                NA          GSM545834        A-AFFY-44
GSM545833.CEL                NA          GSM545833        A-AFFY-44
GSM545832.CEL                NA          GSM545832        A-AFFY-44
GSM545831.CEL                NA          GSM545831        A-AFFY-44
GSM545830.CEL                NA          GSM545830        A-AFFY-44
GSM545829.CEL                NA          GSM545829        A-AFFY-44
GSM545828.CEL                NA          GSM545828        A-AFFY-44
GSM545827.CEL                NA          GSM545827        A-AFFY-44
GSM545826.CEL                NA          GSM545826        A-AFFY-44
GSM545825.CEL                NA          GSM545825        A-AFFY-44
GSM545824.CEL                NA          GSM545824        A-AFFY-44
GSM545823.CEL                NA          GSM545823        A-AFFY-44
GSM545822.CEL                NA          GSM545822        A-AFFY-44
GSM545821.CEL                NA          GSM545821        A-AFFY-44
GSM545820.CEL                NA          GSM545820        A-AFFY-44
GSM545819.CEL                NA          GSM545819        A-AFFY-44
GSM545818.CEL                NA          GSM545818        A-AFFY-44
              Term.Source.REF.6 Protocol.REF.4 Term.Source.REF.7 Protocol.REF.5
GSM545846.CEL                NA   P-GSE21942-6                NA   P-GSE21942-7
GSM545845.CEL                NA   P-GSE21942-6                NA   P-GSE21942-7
GSM545844.CEL                NA   P-GSE21942-6                NA   P-GSE21942-7
GSM545843.CEL                NA   P-GSE21942-6                NA   P-GSE21942-7
GSM545842.CEL                NA   P-GSE21942-6                NA   P-GSE21942-7
GSM545841.CEL                NA   P-GSE21942-6                NA   P-GSE21942-7
GSM545840.CEL                NA   P-GSE21942-6                NA   P-GSE21942-7
GSM545839.CEL                NA   P-GSE21942-6                NA   P-GSE21942-7
GSM545838.CEL                NA   P-GSE21942-6                NA   P-GSE21942-7
GSM545837.CEL                NA   P-GSE21942-6                NA   P-GSE21942-7
GSM545836.CEL                NA   P-GSE21942-6                NA   P-GSE21942-7
GSM545835.CEL                NA   P-GSE21942-6                NA   P-GSE21942-7
GSM545834.CEL                NA   P-GSE21942-6                NA   P-GSE21942-7
GSM545833.CEL                NA   P-GSE21942-6                NA   P-GSE21942-7
GSM545832.CEL                NA   P-GSE21942-6                NA   P-GSE21942-7
GSM545831.CEL                NA   P-GSE21942-6                NA   P-GSE21942-7
GSM545830.CEL                NA   P-GSE21942-6                NA   P-GSE21942-7
GSM545829.CEL                NA   P-GSE21942-6                NA   P-GSE21942-7
GSM545828.CEL                NA   P-GSE21942-6                NA   P-GSE21942-7
GSM545827.CEL                NA   P-GSE21942-6                NA   P-GSE21942-7
GSM545826.CEL                NA   P-GSE21942-6                NA   P-GSE21942-7
GSM545825.CEL                NA   P-GSE21942-6                NA   P-GSE21942-7
GSM545824.CEL                NA   P-GSE21942-6                NA   P-GSE21942-7
GSM545823.CEL                NA   P-GSE21942-6                NA   P-GSE21942-7
GSM545822.CEL                NA   P-GSE21942-6                NA   P-GSE21942-7
GSM545821.CEL                NA   P-GSE21942-6                NA   P-GSE21942-7
GSM545820.CEL                NA   P-GSE21942-6                NA   P-GSE21942-7
GSM545819.CEL                NA   P-GSE21942-6                NA   P-GSE21942-7
GSM545818.CEL                NA   P-GSE21942-6                NA   P-GSE21942-7
              Term.Source.REF.8 Array.Data.File
GSM545846.CEL                NA   GSM545846.CEL
GSM545845.CEL                NA   GSM545845.CEL
GSM545844.CEL                NA   GSM545844.CEL
GSM545843.CEL                NA   GSM545843.CEL
GSM545842.CEL                NA   GSM545842.CEL
GSM545841.CEL                NA   GSM545841.CEL
GSM545840.CEL                NA   GSM545840.CEL
GSM545839.CEL                NA   GSM545839.CEL
GSM545838.CEL                NA   GSM545838.CEL
GSM545837.CEL                NA   GSM545837.CEL
GSM545836.CEL                NA   GSM545836.CEL
GSM545835.CEL                NA   GSM545835.CEL
GSM545834.CEL                NA   GSM545834.CEL
GSM545833.CEL                NA   GSM545833.CEL
GSM545832.CEL                NA   GSM545832.CEL
GSM545831.CEL                NA   GSM545831.CEL
GSM545830.CEL                NA   GSM545830.CEL
GSM545829.CEL                NA   GSM545829.CEL
GSM545828.CEL                NA   GSM545828.CEL
GSM545827.CEL                NA   GSM545827.CEL
GSM545826.CEL                NA   GSM545826.CEL
GSM545825.CEL                NA   GSM545825.CEL
GSM545824.CEL                NA   GSM545824.CEL
GSM545823.CEL                NA   GSM545823.CEL
GSM545822.CEL                NA   GSM545822.CEL
GSM545821.CEL                NA   GSM545821.CEL
GSM545820.CEL                NA   GSM545820.CEL
GSM545819.CEL                NA   GSM545819.CEL
GSM545818.CEL                NA   GSM545818.CEL
                                                                                    Comment..ArrayExpress.FTP.file.
GSM545846.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.raw.1.zip
GSM545845.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.raw.1.zip
GSM545844.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.raw.1.zip
GSM545843.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.raw.1.zip
GSM545842.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.raw.1.zip
GSM545841.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.raw.1.zip
GSM545840.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.raw.1.zip
GSM545839.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.raw.1.zip
GSM545838.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.raw.1.zip
GSM545837.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.raw.1.zip
GSM545836.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.raw.1.zip
GSM545835.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.raw.1.zip
GSM545834.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.raw.1.zip
GSM545833.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.raw.1.zip
GSM545832.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.raw.1.zip
GSM545831.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.raw.1.zip
GSM545830.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.raw.1.zip
GSM545829.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.raw.1.zip
GSM545828.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.raw.1.zip
GSM545827.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.raw.1.zip
GSM545826.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.raw.1.zip
GSM545825.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.raw.1.zip
GSM545824.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.raw.1.zip
GSM545823.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.raw.1.zip
GSM545822.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.raw.1.zip
GSM545821.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.raw.1.zip
GSM545820.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.raw.1.zip
GSM545819.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.raw.1.zip
GSM545818.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.raw.1.zip
              Protocol.REF.6 Term.Source.REF.9              Normalization.Name
GSM545846.CEL   P-GSE21942-1                NA GSM545846_sample_table.txt norm
GSM545845.CEL   P-GSE21942-1                NA GSM545845_sample_table.txt norm
GSM545844.CEL   P-GSE21942-1                NA GSM545844_sample_table.txt norm
GSM545843.CEL   P-GSE21942-1                NA GSM545843_sample_table.txt norm
GSM545842.CEL   P-GSE21942-1                NA GSM545842_sample_table.txt norm
GSM545841.CEL   P-GSE21942-1                NA GSM545841_sample_table.txt norm
GSM545840.CEL   P-GSE21942-1                NA GSM545840_sample_table.txt norm
GSM545839.CEL   P-GSE21942-1                NA GSM545839_sample_table.txt norm
GSM545838.CEL   P-GSE21942-1                NA GSM545838_sample_table.txt norm
GSM545837.CEL   P-GSE21942-1                NA GSM545837_sample_table.txt norm
GSM545836.CEL   P-GSE21942-1                NA GSM545836_sample_table.txt norm
GSM545835.CEL   P-GSE21942-1                NA GSM545835_sample_table.txt norm
GSM545834.CEL   P-GSE21942-1                NA GSM545834_sample_table.txt norm
GSM545833.CEL   P-GSE21942-1                NA GSM545833_sample_table.txt norm
GSM545832.CEL   P-GSE21942-1                NA GSM545832_sample_table.txt norm
GSM545831.CEL   P-GSE21942-1                NA GSM545831_sample_table.txt norm
GSM545830.CEL   P-GSE21942-1                NA GSM545830_sample_table.txt norm
GSM545829.CEL   P-GSE21942-1                NA GSM545829_sample_table.txt norm
GSM545828.CEL   P-GSE21942-1                NA GSM545828_sample_table.txt norm
GSM545827.CEL   P-GSE21942-1                NA GSM545827_sample_table.txt norm
GSM545826.CEL   P-GSE21942-1                NA GSM545826_sample_table.txt norm
GSM545825.CEL   P-GSE21942-1                NA GSM545825_sample_table.txt norm
GSM545824.CEL   P-GSE21942-1                NA GSM545824_sample_table.txt norm
GSM545823.CEL   P-GSE21942-1                NA GSM545823_sample_table.txt norm
GSM545822.CEL   P-GSE21942-1                NA GSM545822_sample_table.txt norm
GSM545821.CEL   P-GSE21942-1                NA GSM545821_sample_table.txt norm
GSM545820.CEL   P-GSE21942-1                NA GSM545820_sample_table.txt norm
GSM545819.CEL   P-GSE21942-1                NA GSM545819_sample_table.txt norm
GSM545818.CEL   P-GSE21942-1                NA GSM545818_sample_table.txt norm
                 Derived.Array.Data.File
GSM545846.CEL GSM545846_sample_table.txt
GSM545845.CEL GSM545845_sample_table.txt
GSM545844.CEL GSM545844_sample_table.txt
GSM545843.CEL GSM545843_sample_table.txt
GSM545842.CEL GSM545842_sample_table.txt
GSM545841.CEL GSM545841_sample_table.txt
GSM545840.CEL GSM545840_sample_table.txt
GSM545839.CEL GSM545839_sample_table.txt
GSM545838.CEL GSM545838_sample_table.txt
GSM545837.CEL GSM545837_sample_table.txt
GSM545836.CEL GSM545836_sample_table.txt
GSM545835.CEL GSM545835_sample_table.txt
GSM545834.CEL GSM545834_sample_table.txt
GSM545833.CEL GSM545833_sample_table.txt
GSM545832.CEL GSM545832_sample_table.txt
GSM545831.CEL GSM545831_sample_table.txt
GSM545830.CEL GSM545830_sample_table.txt
GSM545829.CEL GSM545829_sample_table.txt
GSM545828.CEL GSM545828_sample_table.txt
GSM545827.CEL GSM545827_sample_table.txt
GSM545826.CEL GSM545826_sample_table.txt
GSM545825.CEL GSM545825_sample_table.txt
GSM545824.CEL GSM545824_sample_table.txt
GSM545823.CEL GSM545823_sample_table.txt
GSM545822.CEL GSM545822_sample_table.txt
GSM545821.CEL GSM545821_sample_table.txt
GSM545820.CEL GSM545820_sample_table.txt
GSM545819.CEL GSM545819_sample_table.txt
GSM545818.CEL GSM545818_sample_table.txt
                                                                                  Comment..Derived.ArrayExpress.FTP.file.
GSM545846.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.processed.1.zip
GSM545845.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.processed.1.zip
GSM545844.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.processed.1.zip
GSM545843.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.processed.1.zip
GSM545842.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.processed.1.zip
GSM545841.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.processed.1.zip
GSM545840.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.processed.1.zip
GSM545839.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.processed.1.zip
GSM545838.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.processed.1.zip
GSM545837.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.processed.1.zip
GSM545836.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.processed.1.zip
GSM545835.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.processed.1.zip
GSM545834.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.processed.1.zip
GSM545833.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.processed.1.zip
GSM545832.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.processed.1.zip
GSM545831.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.processed.1.zip
GSM545830.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.processed.1.zip
GSM545829.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.processed.1.zip
GSM545828.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.processed.1.zip
GSM545827.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.processed.1.zip
GSM545826.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.processed.1.zip
GSM545825.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.processed.1.zip
GSM545824.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.processed.1.zip
GSM545823.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.processed.1.zip
GSM545822.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.processed.1.zip
GSM545821.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.processed.1.zip
GSM545820.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.processed.1.zip
GSM545819.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.processed.1.zip
GSM545818.CEL ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/experiment/GEOD/E-GEOD-21942/E-GEOD-21942.processed.1.zip
              FactorValue..DISEASE.STATE. Term.Source.REF.10
GSM545846.CEL          multiple sclerosis                EFO
GSM545845.CEL          multiple sclerosis                EFO
GSM545844.CEL          multiple sclerosis                EFO
GSM545843.CEL          multiple sclerosis                EFO
GSM545842.CEL          multiple sclerosis                EFO
GSM545841.CEL          multiple sclerosis                EFO
GSM545840.CEL          multiple sclerosis                EFO
GSM545839.CEL          multiple sclerosis                EFO
GSM545838.CEL          multiple sclerosis                EFO
GSM545837.CEL          multiple sclerosis                EFO
GSM545836.CEL          multiple sclerosis                EFO
GSM545835.CEL          multiple sclerosis                EFO
GSM545834.CEL          multiple sclerosis                EFO
GSM545833.CEL          multiple sclerosis                EFO
GSM545832.CEL                     healthy                   
GSM545831.CEL                     healthy                   
GSM545830.CEL                     healthy                   
GSM545829.CEL                     healthy                   
GSM545828.CEL                     healthy                   
GSM545827.CEL                     healthy                   
GSM545826.CEL                     healthy                   
GSM545825.CEL                     healthy                   
GSM545824.CEL                     healthy                   
GSM545823.CEL                     healthy                   
GSM545822.CEL                     healthy                   
GSM545821.CEL                     healthy                   
GSM545820.CEL                     healthy                   
GSM545819.CEL                     healthy                   
GSM545818.CEL                     healthy                   
              Term.Accession.Number.2 GROUP
GSM545846.CEL             EFO_0003885     1
GSM545845.CEL             EFO_0003885     1
GSM545844.CEL             EFO_0003885     1
GSM545843.CEL             EFO_0003885     1
GSM545842.CEL             EFO_0003885     1
GSM545841.CEL             EFO_0003885     1
GSM545840.CEL             EFO_0003885     1
GSM545839.CEL             EFO_0003885     1
GSM545838.CEL             EFO_0003885     1
GSM545837.CEL             EFO_0003885     1
GSM545836.CEL             EFO_0003885     1
GSM545835.CEL             EFO_0003885     1
GSM545834.CEL             EFO_0003885     1
GSM545833.CEL             EFO_0003885     1
GSM545832.CEL                             0
GSM545831.CEL                             0
GSM545830.CEL                             0
GSM545829.CEL                             0
GSM545828.CEL                             0
GSM545827.CEL                             0
GSM545826.CEL                             0
GSM545825.CEL                             0
GSM545824.CEL                             0
GSM545823.CEL                             0
GSM545822.CEL                             0
GSM545821.CEL                             0
GSM545820.CEL                             0
GSM545819.CEL                             0
GSM545818.CEL                             0

The variable giving the condition is FactorValue..DISEASE.STATE..

pData(gse21942)[,"FactorValue..DISEASE.STATE."]
 [1] multiple sclerosis multiple sclerosis multiple sclerosis multiple sclerosis
 [5] multiple sclerosis multiple sclerosis multiple sclerosis multiple sclerosis
 [9] multiple sclerosis multiple sclerosis multiple sclerosis multiple sclerosis
[13] multiple sclerosis multiple sclerosis healthy            healthy           
[17] healthy            healthy            healthy            healthy           
[21] healthy            healthy            healthy            healthy           
[25] healthy            healthy            healthy            healthy           
[29] healthy           
Levels: healthy multiple sclerosis

The absolute frequencies are

table(pData(gse21942)[,"FactorValue..DISEASE.STATE."])

           healthy multiple sclerosis 
                15                 14 

t-test for a given gene (row)

We choose the gene in row 698 in the expression matrix. The t-test comparing the means assuming a common variance can be applied using stats::t.test.

x0 = pData(gse21942)[,"FactorValue..DISEASE.STATE."]
y0 = exprs(gse21942)[698,]
t.test(y0 ~ x0,var.equal=TRUE)

    Two Sample t-test

data:  y0 by x0
t = 4.4829, df = 27, p-value = 0.0001222
alternative hypothesis: true difference in means between group healthy and group multiple sclerosis is not equal to 0
95 percent confidence interval:
 0.2135285 0.5739697
sample estimates:
           mean in group healthy mean in group multiple sclerosis 
                        5.761981                         5.368232 

t-tests for all genes

It can be used genefilter::rowttests.

tt = genefilter::rowttests(gse21942,pData(gse21942)[,"FactorValue..DISEASE.STATE."])

The first rows can be seen with

head(tt)
            statistic          dm     p.value
1007_s_at -2.29869931 -0.15981906 0.029492008
1053_at    3.44084102  0.20940361 0.001901206
117_at    -0.08505071 -0.01110444 0.932848609
121_at    -0.53362792 -0.02274832 0.597965094
1255_g_at -1.01536731 -0.04339509 0.318943716
1294_at   -1.05030996 -0.07873761 0.302886126

Note that tt is a data.frame.

class(tt)
[1] "data.frame"

The column headed statistic is the statistic of the t-test assuming a common variance. The column dm is the difference of the sample means and the column headed p.value is the p-value of the t-test. These are the raw p-values.

We can evaluated how many genes are significant for a given threshold \(\alpha = 0.05\).

tt[,"p.value"] < 0.001

The rows (in the expression matrix) of these genes are

which(tt[,"p.value"] < 0.001)

The rows for the minimum and maximum p-value can be found with

which.min(tt[,"p.value"])
[1] 37952
which.max(tt[,"p.value"])
[1] 52300

A summary of the p-values can be produced using

summary(tt[,"p.value"])
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
0.00000 0.02348 0.20089 0.30861 0.55059 0.99999 

A kernel estimator of the density of these p-values could be obtained with

pacman::p_load(ggplot2)
ggplot(tt, aes(x=p.value)) +  geom_density(adjust=1/5)

We can adjust the p-values using the Benjamini-Hochberg method

p_BH = p.adjust(tt[,"p.value"])

or using the Bonferroni correction.

p_Bonferroni = p.adjust(tt[,"p.value"])

Density estimators for Benjamini-Hochberg and Bonferroni adjusted p-values can be obtained with

df = data.frame(p_BH)
ggplot(df, aes(x=p_BH)) +  geom_density(adjust=1/5)

and

df = data.frame(p_Bonferroni)
ggplot(df, aes(x=p_Bonferroni)) +  geom_density(adjust=1/5)

q-values

The q-values can be calculated using the package qvalue.

pacman::p_load(qvalue)
qval = qvalue(tt[,"p.value"])

Some plots for these q-values just calculated are obtained with

plot(qval)

In particular the bottom-left plot shows the q-values against the raw p-values.

t-test using tami::dema

The function tami::dema performs a differential expression analysis in one step.

The first option is the usual t-test with a Benjamini-Hochberg correction.

x1 = tami::dema(x=gse21942,y="FactorValue..DISEASE.STATE.",test = rowt,
          correction = "BH",fdr=.0001,foutput = "gse21942_rowt")

A tidy report can be obtained using

x1_df = tidy(x1)

We have obtained a data.frame. The first rows can be obtained with

head(x1_df)
          PROBEID ENTREZID         ENSEMBL   SYMBOL         GO EVIDENCE
1171 1552312_a_at     4238 ENSG00000037749    MFAP3 GO:0005576      TAS
3614 1552660_a_at    55322 ENSG00000082213  C5orf22       <NA>     <NA>
3736 1552670_a_at    79660 ENSG00000173281  PPP1R3B GO:0000164      IEA
3792   1552675_at   150353 ENSG00000172404   DNAJB7 GO:0051087      IPI
4078 1552717_s_at   645455 ENSG00000276725 CEP170P1 GO:0005515      IPI
5331   1552867_at     <NA>            <NA>     <NA>       <NA>     <NA>
     ONTOLOGY statistic         rawp         adjp         qval
1171       CC  7.813037 2.115225e-08 5.511837e-06 2.847585e-06
3614     <NA>  7.165150 1.049814e-07 1.445808e-05 7.469493e-06
3736       CC  6.245573 1.110567e-06 6.876589e-05 3.552658e-05
3792       MF  7.307560 7.349016e-08 1.198296e-05 6.190769e-06
4078       MF  7.745471 2.493649e-08 6.254140e-06 3.231082e-06
5331     <NA>  6.211773 1.213190e-06 7.297158e-05 3.769937e-05

In particular, the results for the gene in row 698 previously considered are obtained with

x1_df[698,]
           PROBEID ENTREZID         ENSEMBL SYMBOL         GO EVIDENCE ONTOLOGY
531463 223585_x_at    25948 ENSG00000170852 KBTBD2 GO:0004842      IBA       MF
       statistic         rawp         adjp         qval
531463   8.41056 5.063783e-09 2.193817e-06 1.133394e-06

The same report in a html file is obtained with

glimpse(x1)
[1] "./reports/gse21942_rowt.html"

The html file just generated can be open with

browseURL(glimpse(x1))

Using moderated t-tests

We are use the moderated t-tests using the package limma. The test used in tami::dema have to be replaced by rowtmod.

x2 = dema(x=gse21942,y="FactorValue..DISEASE.STATE.",
                test = rowtmod,correction = "BH",
                fdr = .0001,foutput = "gse21942_rowtmod")

A data.frame with the results is obtained with

x2_df= tidy(x2)

The same report in a html file is obtained with

glimpse(x2)
[1] "./reports/gse21942_rowtmod.html"

We can open the file with

browseURL(glimpse(x2))

Comparing procedures

Let us assume that we have tested the differential expression using two procedures rowt and rowtmod. We want to compare the results obtained.

Note that the data.frames generated using tidy provides information about those genes with a adjusted p-value lesser than the used fdr. If we want all genes in the study we have to set fdr to 1.

How many genes are called significant for a fdr equal to .0001 using rowt?

nrow(x1_df)
[1] 1044

And using rowtmod?

nrow(x2_df)
[1] 1563

We don’t want to set previously given fdr’s. The fdr is set to 1 and the function dema is executed again for both procedures. Note that the values of each functions is saved in the same objects x1 and x2.

x1 = dema(x=gse21942,y="FactorValue..DISEASE.STATE.",
                test = rowt,correction = "BH",
                fdr = 1,foutput = "gse21942_rowt")

x2 = dema(x=gse21942,y="FactorValue..DISEASE.STATE.",
                test = rowtmod,correction = "BH",
                fdr = 1,foutput = "gse21942_rowtmod")

The new data.frames are generated.

x1_df= tidy(x1)
x2_df= tidy(x2)

What information contains these data.frames just generated?

names(x1_df)
 [1] "PROBEID"   "ENTREZID"  "ENSEMBL"   "SYMBOL"    "GO"        "EVIDENCE" 
 [7] "ONTOLOGY"  "statistic" "rawp"      "adjp"      "qval"     

They are different gene identifiers and the usual statistic of the test used (rowt or rowtmod), the raw p-value, the corresponding adjusted p-value (using the correction method for multiple testing) and the Storey’s q-value.

Now we set a value for fdr

fdr0 = .000001

and the number of significant for each method would be

table(x1_df[,"adjp"] < fdr0)

FALSE  TRUE 
54610    65 

and

table(x2_df[,"adjp"] < fdr0)

FALSE  TRUE 
54497   178 

We can compare the results for both methods using

res1 = x1_df[,"adjp"] < fdr0
res2 = x2_df[,"adjp"] < fdr0
table(res1,res2)
       res2
res1    FALSE  TRUE
  FALSE 54496   114
  TRUE      1    64