## Gene expression profiling of bone marrow-derived mononuclear cells (BMMC) from patients with rheumatoid arthritis (RA) vs. osteoarthritis (OA)
​
Nuria Renard r0368280
​
Nathalie Van den Berghe r0368279
​
Hanne Ruts r0384457

Gene expression profiling of bone marrow-derived mononuclear cells (BMMC) from patients with rheumatoid arthritis (RA) vs. osteoarthritis (OA)

Nuria Renard r0368280

Nathalie Van den Berghe r0368279

Hanne Ruts r0384457

 
### Introduction 
​
​
##### Used article: Lee et al. Abnormal networks of immune response-related molecules in bone marow cells from patients with rheumatoid arthritis as revealed by DNA microarray analysis. Arthritis & Therapy 2011, 13:R89 
​
https://www.ncbi.nlm.nih.gov/pubmed/21679443
​
##### Microarray data:
​
https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE27390
​
Rheumatoid arthritis (RA) is a systemic autoimmune disease characterized by chronic synovitis that is often pathogenic and destructive to articular cartilage and bone. Accumulating evidence suggest that abnormalities in bone marrow (BM) have a significant role in RA inflammation. In this study, differentially expressed molecules in BM cells from rheumatoid arthritis (RA) and osteoarthritis (OA) patients were compared and abnormal regulatory networks were analyzed to identify the role of BM cells in RA. OA patients were chosen as controls because the OA pathology is relatively well understood and the BM cells from these patients are far more readily available than those from healthy subjects. 
​
We start off with the analysis of a microarray dataset obtained from bone marrow samples of 9 RA and 10 OA patients. From this microarray data we generated a list of differentially expressed genes and performed a ranking-based analysis by use of GORilla. Subsequently, iRegulon analysis was performed on this list of differentially expressed genes to predict regulators and targets. From the list of predicted transcription factors and based on the literature we chose NFKB1 as a possible regulator of the upregulated genes in RA. From genemania we retrieved an association network of NFKB1, we analyzed the gene set with iRegulon and found that the motif was enriched. 
Furthermore a Chipseq dataset of NFKB1 was analyzed to investigate if NFKB1 directly binds the target genes (i.e. the upregulated genes in RA)
​

Introduction

https://www.ncbi.nlm.nih.gov/pubmed/21679443

Microarray data:

https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE27390

Rheumatoid arthritis (RA) is a systemic autoimmune disease characterized by chronic synovitis that is often pathogenic and destructive to articular cartilage and bone. Accumulating evidence suggest that abnormalities in bone marrow (BM) have a significant role in RA inflammation. In this study, differentially expressed molecules in BM cells from rheumatoid arthritis (RA) and osteoarthritis (OA) patients were compared and abnormal regulatory networks were analyzed to identify the role of BM cells in RA. OA patients were chosen as controls because the OA pathology is relatively well understood and the BM cells from these patients are far more readily available than those from healthy subjects.

We start off with the analysis of a microarray dataset obtained from bone marrow samples of 9 RA and 10 OA patients. From this microarray data we generated a list of differentially expressed genes and performed a ranking-based analysis by use of GORilla. Subsequently, iRegulon analysis was performed on this list of differentially expressed genes to predict regulators and targets. From the list of predicted transcription factors and based on the literature we chose NFKB1 as a possible regulator of the upregulated genes in RA. From genemania we retrieved an association network of NFKB1, we analyzed the gene set with iRegulon and found that the motif was enriched. Furthermore a Chipseq dataset of NFKB1 was analyzed to investigate if NFKB1 directly binds the target genes (i.e. the upregulated genes in RA)

 
## 1. Microarray analysis 
### 1.1 Libraries
First we load the following libraries: the affy package to deal with Affymetrix microarray data and the limma package for differential expression analysis.

1. Microarray analysis

1.1 Libraries

First we load the following libraries: the affy package to deal with Affymetrix microarray data and the limma package for differential expression analysis.

In [1]:
 
library(limma)
library(affy)
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: ‘BiocGenerics’

The following objects are masked from ‘package:parallel’:

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following object is masked from ‘package:limma’:

    plotMA

The following object is masked from ‘package:stats’:

    xtabs

The following objects are masked from ‘package:base’:

    anyDuplicated, append, as.data.frame, as.vector, cbind, colnames,
    do.call, duplicated, eval, evalq, Filter, Find, get, intersect,
    is.unsorted, lapply, Map, mapply, match, mget, order, paste, pmax,
    pmax.int, pmin, pmin.int, Position, rank, rbind, Reduce, rep.int,
    rownames, sapply, setdiff, sort, table, tapply, union, unique,
    unlist, unsplit

Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

In [2]:
 
#we downloaded the cel files in: 
celfiles = Sys.glob("/mnt/storage/r0368280/jupyternotebooks/Examenopdracht/*.gz")
 
The original files are located in "/mnt/storage/r0368280/jupyternotebooks/Examenopdracht/"
​
​
Under the account of r0368280

The original files are located in "/mnt/storage/r0368280/jupyternotebooks/Examenopdracht/"

Under the account of r0368280

 
### 1.2 Loading the raw probe data

1.2 Loading the raw probe data

In [3]:
 
celfiles
  1. '/mnt/storage/r0368280/jupyternotebooks/Examenopdracht/GSM677339.CEL.gz'
  2. '/mnt/storage/r0368280/jupyternotebooks/Examenopdracht/GSM677340.CEL.gz'
  3. '/mnt/storage/r0368280/jupyternotebooks/Examenopdracht/GSM677341.CEL.gz'
  4. '/mnt/storage/r0368280/jupyternotebooks/Examenopdracht/GSM677342.CEL.gz'
  5. '/mnt/storage/r0368280/jupyternotebooks/Examenopdracht/GSM677343.CEL.gz'
  6. '/mnt/storage/r0368280/jupyternotebooks/Examenopdracht/GSM677344.CEL.gz'
  7. '/mnt/storage/r0368280/jupyternotebooks/Examenopdracht/GSM677345.CEL.gz'
  8. '/mnt/storage/r0368280/jupyternotebooks/Examenopdracht/GSM677346.CEL.gz'
  9. '/mnt/storage/r0368280/jupyternotebooks/Examenopdracht/GSM677347.CEL.gz'
  10. '/mnt/storage/r0368280/jupyternotebooks/Examenopdracht/GSM677348.CEL.gz'
  11. '/mnt/storage/r0368280/jupyternotebooks/Examenopdracht/GSM677349.CEL.gz'
  12. '/mnt/storage/r0368280/jupyternotebooks/Examenopdracht/GSM677350.CEL.gz'
  13. '/mnt/storage/r0368280/jupyternotebooks/Examenopdracht/GSM677351.CEL.gz'
  14. '/mnt/storage/r0368280/jupyternotebooks/Examenopdracht/GSM677352.CEL.gz'
  15. '/mnt/storage/r0368280/jupyternotebooks/Examenopdracht/GSM677353.CEL.gz'
  16. '/mnt/storage/r0368280/jupyternotebooks/Examenopdracht/GSM677354.CEL.gz'
  17. '/mnt/storage/r0368280/jupyternotebooks/Examenopdracht/GSM677355.CEL.gz'
  18. '/mnt/storage/r0368280/jupyternotebooks/Examenopdracht/GSM677356.CEL.gz'
  19. '/mnt/storage/r0368280/jupyternotebooks/Examenopdracht/GSM677357.CEL.gz'
 
The variable celfiles contain a list of cell file names, nothing more. The data is not loaded yet. To load the files we will use a function from the bioconductor affy package

The variable celfiles contain a list of cell file names, nothing more. The data is not loaded yet. To load the files we will use a function from the bioconductor affy package

In [4]:
 
rawcel <- ReadAffy(filenames=celfiles)
 
The variable rawcel contains an AffyBatch object. 
​
Next step is to annotate the samples: the rawcel object only knows of the file names:

The variable rawcel contains an AffyBatch object.

Next step is to annotate the samples: the rawcel object only knows of the file names:

In [5]:
 
sampleNames(rawcel)
  1. 'GSM677339.CEL.gz'
  2. 'GSM677340.CEL.gz'
  3. 'GSM677341.CEL.gz'
  4. 'GSM677342.CEL.gz'
  5. 'GSM677343.CEL.gz'
  6. 'GSM677344.CEL.gz'
  7. 'GSM677345.CEL.gz'
  8. 'GSM677346.CEL.gz'
  9. 'GSM677347.CEL.gz'
  10. 'GSM677348.CEL.gz'
  11. 'GSM677349.CEL.gz'
  12. 'GSM677350.CEL.gz'
  13. 'GSM677351.CEL.gz'
  14. 'GSM677352.CEL.gz'
  15. 'GSM677353.CEL.gz'
  16. 'GSM677354.CEL.gz'
  17. 'GSM677355.CEL.gz'
  18. 'GSM677356.CEL.gz'
  19. 'GSM677357.CEL.gz'
 
We want to let R know which disease is which: rheumatoid arthritis (RA) or osteoarthritis (OA). To do this we will make a vector with the diseases.

We want to let R know which disease is which: rheumatoid arthritis (RA) or osteoarthritis (OA). To do this we will make a vector with the diseases.

In [2]:
 
disease = c("RA", 
              "RA",
              "RA", 
              "RA",
              "RA", 
              "RA",
              "RA", 
              "RA",
              "RA", 
              "OA",
              "OA",
              "OA",
              "OA",
              "OA",
              "OA",
              "OA",
              "OA",
              "OA",
              "OA")
 
​
Now we'll merge the sample names and the disease into one data frame:

Now we'll merge the sample names and the disease into one data frame:

In [7]:
 
#first make a data frame
pd <- data.frame(disease = disease)
rownames(pd) <- sampleNames(rawcel)
pd
​
disease
GSM677339.CEL.gzRA
GSM677340.CEL.gzRA
GSM677341.CEL.gzRA
GSM677342.CEL.gzRA
GSM677343.CEL.gzRA
GSM677344.CEL.gzRA
GSM677345.CEL.gzRA
GSM677346.CEL.gzRA
GSM677347.CEL.gzRA
GSM677348.CEL.gzOA
GSM677349.CEL.gzOA
GSM677350.CEL.gzOA
GSM677351.CEL.gzOA
GSM677352.CEL.gzOA
GSM677353.CEL.gzOA
GSM677354.CEL.gzOA
GSM677355.CEL.gzOA
GSM677356.CEL.gzOA
GSM677357.CEL.gzOA
 
We will convert this dataframe to an AnnotatedDataFrame, which is a variant of a data.frame that the affy package requires for annotated data, and assign it to our rawcel object:

We will convert this dataframe to an AnnotatedDataFrame, which is a variant of a data.frame that the affy package requires for annotated data, and assign it to our rawcel object:

In [8]:
 
#this library contains the AnnotatedDataFrame:
library(Biobase)
​
phenoData(rawcel) <- AnnotatedDataFrame(data=pd)
 
### 1.3. Normalization
​
Next, we use frma (other option: SCAN) to normalize the data. We have 19 different samples so we have to normalize.

1.3. Normalization

Next, we use frma (other option: SCAN) to normalize the data. We have 19 different samples so we have to normalize.

In [9]:
 
#load the frma library
library(frma)
​
Creating a generic function for ‘nchar’ from package ‘base’ in package ‘S4Vectors’
In [10]:
 
eset <- frma(rawcel, verbose=TRUE)
​
Background Correcting ...


Normalizing ...

Summarizing ...

In [11]:
 
save(eset, file="/mnt/storage/r0368280/jupyternotebooks/Examenopdracht/GSE27390.eset")
 
We now have an expression set loaded as an `ExpressionSet`. 
The eset objects contain the normalized data per probe and some experimental annotation. 
​
However, the sample names are not very imformative:

We now have an expression set loaded as an ExpressionSet. The eset objects contain the normalized data per probe and some experimental annotation.

However, the sample names are not very imformative:

In [12]:
 
sampleNames(eset)
  1. 'GSM677339.CEL.gz'
  2. 'GSM677340.CEL.gz'
  3. 'GSM677341.CEL.gz'
  4. 'GSM677342.CEL.gz'
  5. 'GSM677343.CEL.gz'
  6. 'GSM677344.CEL.gz'
  7. 'GSM677345.CEL.gz'
  8. 'GSM677346.CEL.gz'
  9. 'GSM677347.CEL.gz'
  10. 'GSM677348.CEL.gz'
  11. 'GSM677349.CEL.gz'
  12. 'GSM677350.CEL.gz'
  13. 'GSM677351.CEL.gz'
  14. 'GSM677352.CEL.gz'
  15. 'GSM677353.CEL.gz'
  16. 'GSM677354.CEL.gz'
  17. 'GSM677355.CEL.gz'
  18. 'GSM677356.CEL.gz'
  19. 'GSM677357.CEL.gz'
 
We'll fix this by assigning sample names manually:

We'll fix this by assigning sample names manually:

In [13]:
 
eset.labels <- c("RA_1", "RA_2", "RA_3", "RA_4",
                 "RA_5", "RA_6", "RA_7", "RA_8",
                 "RA_9", "OA_1", "OA_2", "OA_3",
                 "OA_4", "OA_5", "OA_6", "OA_7", "OA_8", "OA_9", "OA_10")
​
sampleNames(eset) <- eset.labels
 
We can check the normalized expression level on a probe by probe basis:

We can check the normalized expression level on a probe by probe basis:

In [14]:
 
probe.counts <- exprs(eset)
head (probe.counts)
​
RA_1RA_2RA_3RA_4RA_5RA_6RA_7RA_8RA_9OA_1OA_2OA_3OA_4OA_5OA_6OA_7OA_8OA_9OA_10
1007_s_at6.2567536.7259906.7488816.6279906.3995356.3025096.7223247.0645416.7551496.5138516.7514426.5878056.6176316.4212666.9772056.7718476.6372356.4453936.856034
1053_at7.1509506.8106016.8730386.7754987.0404566.5288716.3167566.7568726.6681596.9705767.2294597.4227066.9765877.4826347.2164597.3222857.0391357.1296316.857154
117_at8.3802369.4355619.1948677.8228587.8183028.3050488.9297798.5324178.6112878.4506227.1725498.4360439.1119937.1886507.7427466.8348707.5398408.8321517.784423
121_at7.6039667.4991107.6178287.5004987.4149127.6980237.8294977.9919207.8361317.6642597.6340037.6456787.7412017.7980147.8525777.7912407.7034847.7794047.882568
1255_g_at3.3624683.6761633.4827113.3835313.6186273.5734363.5424743.6251133.5735453.4805563.3905143.4362803.4541463.4931983.6176793.5439973.4939073.5441903.442363
1294_at8.4943448.9063778.8663848.5400898.5805148.4951938.4079888.5406468.5638968.0836148.2178248.0983908.3935867.9368628.0864278.0577577.9615708.0205548.361202
 
The names in the first column (e.g. 1007_s_at) are the ID's of the probes. The names in the first row are the sample names. 

The names in the first column (e.g. 1007_s_at) are the ID's of the probes. The names in the first row are the sample names.

 
### 1.4 Gene names
​
The probe names are not very informative. So, we will assign gene names to each probe.
First we will load two extra libraries. The latter contains the annotation of our microarray platform (GeneChip Human Genome U133 Plus 2.0 Array (Affymetrix, Santa Clara, CA, USA))

1.4 Gene names

The probe names are not very informative. So, we will assign gene names to each probe. First we will load two extra libraries. The latter contains the annotation of our microarray platform (GeneChip Human Genome U133 Plus 2.0 Array (Affymetrix, Santa Clara, CA, USA))

In [15]:
 
library(annotate)
library(hgu133plus2.db)
Loading required package: AnnotationDbi
Loading required package: stats4
Loading required package: GenomeInfoDb
Loading required package: S4Vectors
Loading required package: IRanges
Loading required package: XML
Loading required package: org.Hs.eg.db


 
Now we will link the probe to its corresponding gene name using the `getSYMBOL` function

Now we will link the probe to its corresponding gene name using the getSYMBOL function

In [16]:
 
probe.names <- rownames(probe.counts)
gene.symbols <- getSYMBOL(probe.names, "hgu133plus2")
head(gene.symbols)
1007_s_at
'NA'
1053_at
'RFC2'
117_at
'HSPA6'
121_at
'PAX8'
1255_g_at
'GUCA1A'
1294_at
'NA'
 
Now we will perform a few extra steps to fix the raw expression table.
The first step is to convert the raw expression to a data.frame with the gene symbols added as an extra column:

Now we will perform a few extra steps to fix the raw expression table. The first step is to convert the raw expression to a data.frame with the gene symbols added as an extra column:

In [17]:
 
probe.counts.genesymbol <- as.data.frame(cbind(as.data.frame(probe.counts), gene.symbols))
head(probe.counts.genesymbol)
RA_1RA_2RA_3RA_4RA_5RA_6RA_7RA_8RA_9OA_1OA_2OA_3OA_4OA_5OA_6OA_7OA_8OA_9OA_10gene.symbols
1007_s_at6.2567536.7259906.7488816.6279906.3995356.3025096.7223247.0645416.7551496.5138516.7514426.5878056.6176316.4212666.9772056.7718476.6372356.4453936.856034NA
1053_at7.1509506.8106016.8730386.7754987.0404566.5288716.3167566.7568726.6681596.9705767.2294597.4227066.9765877.4826347.2164597.3222857.0391357.1296316.857154RFC2
117_at8.3802369.4355619.1948677.8228587.8183028.3050488.9297798.5324178.6112878.4506227.1725498.4360439.1119937.1886507.7427466.8348707.5398408.8321517.784423HSPA6
121_at7.6039667.4991107.6178287.5004987.4149127.6980237.8294977.9919207.8361317.6642597.6340037.6456787.7412017.7980147.8525777.7912407.7034847.7794047.882568PAX8
1255_g_at3.3624683.6761633.4827113.3835313.6186273.5734363.5424743.6251133.5735453.4805563.3905143.4362803.4541463.4931983.6176793.5439973.4939073.5441903.442363GUCA1A
1294_at8.4943448.9063778.8663848.5400898.5805148.4951938.4079888.5406468.5638968.0836148.2178248.0983908.3935867.9368628.0864278.0577577.9615708.0205548.361202NA
 
Then we will remove all probes for which we do not have a gene symbol, and ensure that the gene symbol column contains only strings:

Then we will remove all probes for which we do not have a gene symbol, and ensure that the gene symbol column contains only strings:

In [18]:
 
probe.counts.genesymbol = probe.counts.genesymbol[complete.cases(probe.counts.genesymbol),]
probe.counts.genesymbol$gene.symbols <- as.character(probe.counts.genesymbol$gene.symbols)
 
Now, we have multiple probes per gene. There are many opinions on how to best deal with this. Differing values may have biological meaning (splice variants) or may be noise. To keep things simple we will take the median expression here.
To group the probes per gene, we will use a function from the excellent reshape2 package.

Now, we have multiple probes per gene. There are many opinions on how to best deal with this. Differing values may have biological meaning (splice variants) or may be noise. To keep things simple we will take the median expression here. To group the probes per gene, we will use a function from the excellent reshape2 package.

In [19]:
 
library(reshape2)
 
We will now `melt` and `dcast` the probe expression table into a gene count table. 

We will now melt and dcast the probe expression table into a gene count table.

In [20]:
 
m <- melt(probe.counts.genesymbol, id.vars = c("gene.symbols"))
 
We can check the contents of m, not how the data is now in "long" form:

We can check the contents of m, not how the data is now in "long" form:

In [21]:
 
head(m)
gene.symbolsvariablevalue
RFC2 RA_1 7.150950
HSPA6 RA_1 8.380236
PAX8 RA_1 7.603966
GUCA1A RA_1 3.362468
THRA RA_1 5.283923
PTPN21 RA_1 4.045119
 
And now we aggregate into a count table:

And now we aggregate into a count table:

In [22]:
 
counts <- dcast(m, gene.symbols ~ variable, fun.aggregate=median)
 
If you check, there is a column called `gene.symbols`. We're turning these into the row names now:

If you check, there is a column called gene.symbols. We're turning these into the row names now:

In [23]:
 
rownames(counts) <- counts$gene.symbols
counts$gene.symbols <- NULL
 
Check the contents of the first five columns and rows:

Check the contents of the first five columns and rows:

In [24]:
 
counts[1:5,1:5]
RA_1RA_2RA_3RA_4RA_5
A1BG5.5614285.2855585.6668055.8542435.803750
A1BG-AS15.4878335.2432665.0737375.2196695.202499
A1CF4.0274403.7789943.8310843.6912383.749375
A2M5.6160815.2080485.8490085.6319415.597519
A2M-AS14.3204415.1952804.2662075.4305944.581357
 
Now we save this count table and analyse this in MeV (multiple array viewer).

Now we save this count table and analyse this in MeV (multiple array viewer).

In [25]:
 
write.table(counts, 'GSE27390.counts.tsv', sep="\t", quote=FALSE, col.names=NA)
 
We uploaded the 'GSE27390.counts.tsv' file into MeV and normalized the data. Subsequently we uploaded a gene cluster of genes that are known to be upregulated in rheumatoid arthritis (based on the literature). We see that the genes that are known to be upregulated are also upregulated (AREG,CXCR4,FKBP5,TPST1) in our microarray dataset, which means that our dataset is probably a good dataset.
​

We uploaded the 'GSE27390.counts.tsv' file into MeV and normalized the data. Subsequently we uploaded a gene cluster of genes that are known to be upregulated in rheumatoid arthritis (based on the literature). We see that the genes that are known to be upregulated are also upregulated (AREG,CXCR4,FKBP5,TPST1) in our microarray dataset, which means that our dataset is probably a good dataset.

 
<img width="50%" src="/user/r0368280/files/Examenopdracht/Pictures/PrintscreenE.png">
​
​

 
### 1.5 Quality control
​
It is very important to check the quality of your data. This can be done by the MDS tool. Basically, if two samples are similar, they are close together. In an ideal situation there is a lot of variaton between the conditions and little variation between the samples of each condition (replicates should be close together). 

1.5 Quality control

It is very important to check the quality of your data. This can be done by the MDS tool. Basically, if two samples are similar, they are close together. In an ideal situation there is a lot of variaton between the conditions and little variation between the samples of each condition (replicates should be close together).

In [26]:
 
plotMDS(eset)
 
Samples RA_7, RA_6 and RA_2 lie further away from the other RA samples (RA_1, RA_3, RA_4, RA_5, RA_8 and RA_9, which form more or less a cluster). OA_4 lies further away from the other OA samples.
Taken together there is only little variation between samples of the same condition and there is big variation between OA and RA as seen by the fact that OA and RA form two different clusters. This means that the quality of our data is good.

Samples RA_7, RA_6 and RA_2 lie further away from the other RA samples (RA_1, RA_3, RA_4, RA_5, RA_8 and RA_9, which form more or less a cluster). OA_4 lies further away from the other OA samples. Taken together there is only little variation between samples of the same condition and there is big variation between OA and RA as seen by the fact that OA and RA form two different clusters. This means that the quality of our data is good.

 
We now look at the genes that are already known to be upregulated in RA (same genes as checked in MeV) and genes of interest

We now look at the genes that are already known to be upregulated in RA (same genes as checked in MeV) and genes of interest

In [27]:
 
goi <- c("AREG", "CXCR4", "FKBP5", "TPST1", "CXCL8", "IFNG", "CCL20")
counts[goi,]
RA_1RA_2RA_3RA_4RA_5RA_6RA_7RA_8RA_9OA_1OA_2OA_3OA_4OA_5OA_6OA_7OA_8OA_9OA_10
AREG 6.012298 6.014188 3.157876 4.340333 5.296133 7.273613 6.404100 3.233314 4.008865 4.367112 3.472517 3.231536 3.099827 3.346644 3.245220 3.568286 3.325901 3.024948 3.426250
CXCR412.39004812.63180311.18534712.07118712.18254312.92027212.75879711.95626712.30995111.46004810.81232010.84012911.91166610.59883610.90565710.83475910.97052211.29897811.385186
FKBP511.65790611.985766 9.63134811.408960 9.57938510.77139111.684850 8.95645611.474190 8.995163 9.183178 9.425089 8.748021 9.587113 9.118400 9.344335 8.984238 9.010353 9.244093
TPST1 7.483627 8.570241 6.756177 6.503897 5.894087 7.213414 8.078765 6.135477 7.417966 6.068505 5.647897 5.891746 5.483007 5.445842 5.517210 5.542351 5.518507 5.938561 6.780837
CXCL812.16776811.93014210.46407710.65723611.91794813.37736112.38617511.94342210.66353410.487566 7.771105 9.44699411.18786610.087953 8.444779 7.077445 9.64770311.19586910.549962
IFNG 7.081807 7.559429 6.375571 7.605922 8.165165 7.711508 7.929697 6.287000 6.439768 4.220584 5.369844 4.785136 4.261414 6.026928 4.153632 4.936343 4.305266 5.082310 4.295397
CCL20 6.230405 6.071133 3.988199 4.953617 6.43283410.079633 7.528415 4.802137 4.916153 4.420851 4.122349 4.099074 4.025288 4.466877 4.223816 4.013906 4.145265 4.186245 3.925251
 
We chose to look at AREG, CXCR4, FKBP5 and TPST1 because these genes are already known to be upregulated in RA. CXCL8, IFNG and CCL20 are associated with inflammation and could therefore also be upregulated in RA. You see that IFNG has higher values in RA compared to OA. The same with CCL20 but there is alot of variation in the RA samples for this gene. For CXCL8 it is hard to tell.

We chose to look at AREG, CXCR4, FKBP5 and TPST1 because these genes are already known to be upregulated in RA. CXCL8, IFNG and CCL20 are associated with inflammation and could therefore also be upregulated in RA. You see that IFNG has higher values in RA compared to OA. The same with CCL20 but there is alot of variation in the RA samples for this gene. For CXCL8 it is hard to tell.

 
Another nice way to look at your data is by creating a scatterplot of each gene comparing all samples against each other:

Another nice way to look at your data is by creating a scatterplot of each gene comparing all samples against each other:

In [28]:
 
plot(data.frame(counts), cex=0.1)
​
 
Gene expression levels of the different samples are compared. Depending on the samples you compare with each other, the variation differs as seen by the black diagonal line. The wider the diagnonal, the more variation there is.

Gene expression levels of the different samples are compared. Depending on the samples you compare with each other, the variation differs as seen by the black diagonal line. The wider the diagnonal, the more variation there is.

 
### 1.6 Differential expression
​
We use limma for differential expression analysis, but we already loaded the library.
​
The first step is to define the experimental conditions along which we want to do differential expression analaysis:

1.6 Differential expression

We use limma for differential expression analysis, but we already loaded the library.

The first step is to define the experimental conditions along which we want to do differential expression analaysis:

In [29]:
 
disease <- factor(c('RA', 'RA', 'RA', 'RA','RA','RA','RA','RA','RA','OA','OA','OA','OA','OA','OA','OA','OA','OA','OA'),
                levels=c('RA', 'OA'))
disease
  1. RA
  2. RA
  3. RA
  4. RA
  5. RA
  6. RA
  7. RA
  8. RA
  9. RA
  10. OA
  11. OA
  12. OA
  13. OA
  14. OA
  15. OA
  16. OA
  17. OA
  18. OA
  19. OA
 
Limma uses a linear model in the background, to this end we'll build a model matrix:

Limma uses a linear model in the background, to this end we'll build a model matrix:

In [30]:
 
design <- model.matrix(~disease)
design
(Intercept)diseaseOA
110
210
310
410
510
610
710
810
910
1011
1111
1211
1311
1411
1511
1611
1711
1811
1911
In [31]:
 
fit <- eBayes(lmFit(counts, design))
 
lmFit is a `limma` function that fits a linear model and `eBayes` calculates probabilities.

lmFit is a limma function that fits a linear model and eBayes calculates probabilities.

 
### 1.7 MA plot
​
An MA plot is a very common plot in differential expression analysis for the visualisation of genomic data. It shows the log ratio change of expression (M) vs. the average expression (A). It quickly gives you insight into the spread of differential expression. 

1.7 MA plot

An MA plot is a very common plot in differential expression analysis for the visualisation of genomic data. It shows the log ratio change of expression (M) vs. the average expression (A). It quickly gives you insight into the spread of differential expression.

In [32]:
 
limma::plotMA(fit, 2)
abline(0,0,col='blue')
 
On this MA plot you can see the differential expression of the genes in OA versus RA. The dots on the blue line represent genes that have a similar expression level in RA and in OA. Genes that are located above the blue line, are upregulated in OA compared to RA. Genes that are located under the blue line are downregulated in OA compared to RA.
​
The spread of differential expression is acceptable.

On this MA plot you can see the differential expression of the genes in OA versus RA. The dots on the blue line represent genes that have a similar expression level in RA and in OA. Genes that are located above the blue line, are upregulated in OA compared to RA. Genes that are located under the blue line are downregulated in OA compared to RA.

The spread of differential expression is acceptable.

 
Now we extract the top differentially expressed genes using the `topTable` function. We choose coef=2 because we want the results from the disease (RA or OA) and not from the intercept.

Now we extract the top differentially expressed genes using the topTable function. We choose coef=2 because we want the results from the disease (RA or OA) and not from the intercept.

In [33]:
 
topTable(fit, coef=2)
logFCAveExprtP.Valueadj.P.ValB
GADD45B-2.0389968 8.791497 -12.687179 4.488586e-119.151777e-0715.057639
RABGEF1-1.3627221 6.251218 -11.351747 3.251167e-103.314402e-0613.303176
LOC728445-1.4636083 5.456161 -10.619482 1.038041e-097.054876e-0612.253016
ZFAND5-3.0618375 6.573636 -9.658854 5.204406e-092.652816e-0510.771714
SLC51A-1.0991059 5.381464 -9.516096 6.674131e-092.712161e-0510.541019
CH25H-4.9774415 6.238996 -9.383309 8.430055e-092.712161e-0510.323907
DDX50-1.5468734 6.245126 -9.272378 1.026325e-082.712161e-0510.140643
PLK2-2.7439326 5.552549 -9.252057 1.064167e-082.712161e-0510.106885
ZFAS1-0.6359515 10.384643 -9.127480 1.330135e-082.876434e-05 9.898655
CCNL1-1.5773230 8.996707 -9.038366 1.562120e-082.876434e-05 9.748350
 
NOTE: in the used commands we compared OA versus RA, so if the logFC (log fold change) is negative the gene is downregulated in OA compared to RA. This also means that the gene is upregulated in RA compared to OA.
​
In this table, all 10 genes are downregulated in OA compared to RA, which means that these genes are upregulated in RA. This upregulation is significant because the adjusted pvalue is less than 0.05 (which is an arbitrary chosen value).

NOTE: in the used commands we compared OA versus RA, so if the logFC (log fold change) is negative the gene is downregulated in OA compared to RA. This also means that the gene is upregulated in RA compared to OA.

In this table, all 10 genes are downregulated in OA compared to RA, which means that these genes are upregulated in RA. This upregulation is significant because the adjusted pvalue is less than 0.05 (which is an arbitrary chosen value).

 
### 1.8 Correct for multiple testing
​
Because we have so many genes we have to correct for multiple testing and this can be done through the Benjamin Hochberg (BH) method. We select again the second colum, because we are interested in the type of disease (RA or OA) and we select all the genes for which there is less than 5 % chance of false discovery. 

1.8 Correct for multiple testing

Because we have so many genes we have to correct for multiple testing and this can be done through the Benjamin Hochberg (BH) method. We select again the second colum, because we are interested in the type of disease (RA or OA) and we select all the genes for which there is less than 5 % chance of false discovery.

In [34]:
 
select = p.adjust(fit[,2]$p.value, method="BH") < 0.05
 
To test if this command works we randomly select some genes:

To test if this command works we randomly select some genes:

In [35]:
 
select[20:30]
  1. TRUE
  2. FALSE
  3. TRUE
  4. FALSE
  5. FALSE
  6. TRUE
  7. FALSE
  8. FALSE
  9. FALSE
  10. FALSE
  11. FALSE
In [36]:
 
summary(select)
   Mode   FALSE    TRUE    NA's 
logical   15556    4833       0 
 
`Summary(select)` gives us an overview of how many genes are signficant genes. In our case, 4833 are significant if you take a significance cutt-off (adjusted p-value) of 0.05 and correct for multiple testing.

Summary(select) gives us an overview of how many genes are signficant genes. In our case, 4833 are significant if you take a significance cutt-off (adjusted p-value) of 0.05 and correct for multiple testing.

 
In the article they used q < 0.001 as the criterion for statistical significance. So, we will also use this criterion as FDR (false discovery rate) cutoff.

In the article they used q < 0.001 as the criterion for statistical significance. So, we will also use this criterion as FDR (false discovery rate) cutoff.

In [37]:
 
select0001 = p.adjust(fit[,2]$p.value, method="BH") < 0.001
In [38]:
 
summary(select0001)
   Mode   FALSE    TRUE    NA's 
logical   19582     807       0 
 
If we take a significance cut-off of 0.001 and correct for multiple testing by the BH method we find 807 differentially expressed genes. In the article they found 2674 differentially expressed genes. 

If we take a significance cut-off of 0.001 and correct for multiple testing by the BH method we find 807 differentially expressed genes. In the article they found 2674 differentially expressed genes.

 
### 1.9 Output data

1.9 Output data

 
We now convert the output data generated by the topTable function in a file named "GSE27390.tophits.tsv" for further analysis. 100000 is chosen as the number of genes to ensure all genes are included. Note that the topTable function also calculates an adjusted p value and uses the BH method.

We now convert the output data generated by the topTable function in a file named "GSE27390.tophits.tsv" for further analysis. 100000 is chosen as the number of genes to ensure all genes are included. Note that the topTable function also calculates an adjusted p value and uses the BH method.

In [39]:
 
top = topTable(fit, coef=2, number=100000)
In [40]:
 
write.table(top, "GSE27390.tophits.tsv", sep="\t", quote=FALSE, col.names=NA)
 
We check the output data by the head function to check if the output file looks as expected (you can also upload the tsv in excell to look at the data)

We check the output data by the head function to check if the output file looks as expected (you can also upload the tsv in excell to look at the data)

In [41]:
 
head(top)
logFCAveExprtP.Valueadj.P.ValB
GADD45B-2.038997 8.791497 -12.687179 4.488586e-119.151777e-0715.05764
RABGEF1-1.362722 6.251218 -11.351747 3.251167e-103.314402e-0613.30318
LOC728445-1.463608 5.456161 -10.619482 1.038041e-097.054876e-0612.25302
ZFAND5-3.061838 6.573636 -9.658854 5.204406e-092.652816e-0510.77171
SLC51A-1.099106 5.381464 -9.516096 6.674131e-092.712161e-0510.54102
CH25H-4.977441 6.238996 -9.383309 8.430055e-092.712161e-0510.32391
 
## 2. Ranking-based analysis with GORilla
​
We now have a file named "GSE27390.tophits.tsv" which is a list of the most differentially expressed genes. Subsequently we are going to rank these genes in two different ways, one time on most upregulated genes in RA and the other time on most downregulated in RA. To do this, we upload the tsv file in excel and rank the genes from most upregulated genes to less upregulated by ranking genes that have a logFoldchange of less than -1 and an adjusted p-value of less than 0.05 (logFC<-1 && p.adj<0.05).
​
For ranking the genes from most downregulated genes to less downregulated, the genes that have a logFoldchange of more than 1 and an adjusted p-value of less than 0.05 (logFC>1 && p.adj<0.05) are ranked.
​
The used formulas in excel are:
​
Upregulated: =ALS(EN(B2<-1; F2<0.05);1;0)
​
Downregulated: =ALS(EN(B2>1; F2<0.05);1;0)
​
In this formulas F2 stands for the adjusted p-value and B2 stands for the fold change (logFC). 
​
!! Notice again that the used commands of our microarray analysis are a comparison of OA versus RA so if the logFoldchange is negative the gene is downregulated in OA compared to RA which means that the gene is upregulated in RA compared to OA.

2. Ranking-based analysis with GORilla

We now have a file named "GSE27390.tophits.tsv" which is a list of the most differentially expressed genes. Subsequently we are going to rank these genes in two different ways, one time on most upregulated genes in RA and the other time on most downregulated in RA. To do this, we upload the tsv file in excel and rank the genes from most upregulated genes to less upregulated by ranking genes that have a logFoldchange of less than -1 and an adjusted p-value of less than 0.05 (logFC<-1 && p.adj<0.05).

For ranking the genes from most downregulated genes to less downregulated, the genes that have a logFoldchange of more than 1 and an adjusted p-value of less than 0.05 (logFC>1 && p.adj<0.05) are ranked.

The used formulas in excel are:

Upregulated: =ALS(EN(B2<-1; F2<0.05);1;0)

Downregulated: =ALS(EN(B2>1; F2<0.05);1;0)

In this formulas F2 stands for the adjusted p-value and B2 stands for the fold change (logFC).

!! Notice again that the used commands of our microarray analysis are a comparison of OA versus RA so if the logFoldchange is negative the gene is downregulated in OA compared to RA which means that the gene is upregulated in RA compared to OA.

 
Subsequently the ranked list of most upregulated genes in RA and the ranked list of most downregulated in RA were uploaded in GORilla to obtain a gene signature.
​
Interpretation of the 2 pictures below: From the ranked list of most upregulated genes in RA that was uploaded in GORilla we see that the upregulated genes are involved in the regulation of immune system processes, regulation of response to stimuli, regulation of cytokine production, leukocyte activation, IL-8 production, T-cell activation etc. These are all processes involved in inflammation, which is expected in an inflammatory disease as rheumatoid arthritis.
​

Subsequently the ranked list of most upregulated genes in RA and the ranked list of most downregulated in RA were uploaded in GORilla to obtain a gene signature.

Interpretation of the 2 pictures below: From the ranked list of most upregulated genes in RA that was uploaded in GORilla we see that the upregulated genes are involved in the regulation of immune system processes, regulation of response to stimuli, regulation of cytokine production, leukocyte activation, IL-8 production, T-cell activation etc. These are all processes involved in inflammation, which is expected in an inflammatory disease as rheumatoid arthritis.

 
<img width="50%" src="/user/r0368280/files/Examenopdracht/Pictures/GORILLA2.jpg">

 
<img width="50%" src="/user/r0368280/files/Examenopdracht/Pictures/GORILLA1.jpg">

 
Interpreation of the picture below: From the ranked list of most downregulated genes in RA that was uploaded in GORilla we see that the downregulated genes are involved in cell cycle processes more specifically cell division, DNA replication, chromosome organisation, G1/S transition, etc.

Interpreation of the picture below: From the ranked list of most downregulated genes in RA that was uploaded in GORilla we see that the downregulated genes are involved in cell cycle processes more specifically cell division, DNA replication, chromosome organisation, G1/S transition, etc.

 
<img width="50%" src="/user/r0368280/files/Examenopdracht/Pictures/GORILLA3.jpg">

 
## 3. iRegulon analysis 
​
The next step is to upload the ranked list of downregulated genes as well as upregulated genes in iRegulon. Are these downregulated and upregulated genes co-expressed by chance or because they are regulated by the same transcription factor (TF)? iRegulon detects the TFs, the targets and the motifs/tracks from a set of genes. The aim is to find the regulator of either the down or upgeregulated genes in RA, i.e. the transcription factor that regulates either the down or upregulated genes. Ideally, we would try to find the masterregulator of the genes and the additional regulators to establish a regulatory network but this is overreaching.
​
iRegulon analysis was done with the parameters left on standard settings.
As a result we get a list with enriched motifs, together with a list of candidate transcription factors that can bind the motif. We obtain these results for the downregulated genes and for the upregulated genes. 
​

3. iRegulon analysis

The next step is to upload the ranked list of downregulated genes as well as upregulated genes in iRegulon. Are these downregulated and upregulated genes co-expressed by chance or because they are regulated by the same transcription factor (TF)? iRegulon detects the TFs, the targets and the motifs/tracks from a set of genes. The aim is to find the regulator of either the down or upgeregulated genes in RA, i.e. the transcription factor that regulates either the down or upregulated genes. Ideally, we would try to find the masterregulator of the genes and the additional regulators to establish a regulatory network but this is overreaching.

iRegulon analysis was done with the parameters left on standard settings. As a result we get a list with enriched motifs, together with a list of candidate transcription factors that can bind the motif. We obtain these results for the downregulated genes and for the upregulated genes.

 
### 3.1 Upregulated genes
​
In the picture below you see the transcription factors detected by iRegulon analysis on the ranked list of upregulated genes. The top table shows the enriched TFs ranked by the maximal enrichment score of the motif or the maximal enrichment score for a given TF (=NES), presented with the number of merged targets (#Targets) found by numerous motifs (#Motifs). 
​
CEBPE is the transcription factor with the highest NES score. It regulates 186 targets and these genes are detected by 26 motifs. The transcription factor with the fifth highest NES corresponds to NFKB1. It has 131 targets found by 6 motifs.

3.1 Upregulated genes

In the picture below you see the transcription factors detected by iRegulon analysis on the ranked list of upregulated genes. The top table shows the enriched TFs ranked by the maximal enrichment score of the motif or the maximal enrichment score for a given TF (=NES), presented with the number of merged targets (#Targets) found by numerous motifs (#Motifs).

CEBPE is the transcription factor with the highest NES score. It regulates 186 targets and these genes are detected by 26 motifs. The transcription factor with the fifth highest NES corresponds to NFKB1. It has 131 targets found by 6 motifs.

 
<img width="50%" src="/user/r0368280/files/Examenopdracht/Pictures/CYTOSCAPE_UP.jpg">

 
### 3.2 Downregulated genes
​
In the picture below you see the transcription factors detected by iRegulon analysis on the ranked list of downregulated genes. Several transcription factors are GATA1 (which has the highest NES), E2F4 and FOXM1.

3.2 Downregulated genes

In the picture below you see the transcription factors detected by iRegulon analysis on the ranked list of downregulated genes. Several transcription factors are GATA1 (which has the highest NES), E2F4 and FOXM1.

 
<img width="50%" src="/user/r0368280/files/Examenopdracht/Pictures/CYTOSCAPE_DOWN.jpg">

 
From these two lists we have to choose a transcription factor that could be the regulator of the differentially expressed genes in rheumatoid arthritis. Based on the literature and the known association of NFKB1 with inflammation we chose NFKB1 as a possible regulator of the upregulated genes in RA.
​
We visualised the connection of NFKB1 with its target genes in the picture below. This is a network from the co-expressed genes (i.e. upregulated genes) with the transcription factor NFKB1.
​

From these two lists we have to choose a transcription factor that could be the regulator of the differentially expressed genes in rheumatoid arthritis. Based on the literature and the known association of NFKB1 with inflammation we chose NFKB1 as a possible regulator of the upregulated genes in RA.

We visualised the connection of NFKB1 with its target genes in the picture below. This is a network from the co-expressed genes (i.e. upregulated genes) with the transcription factor NFKB1.

 
<img width="50%" src="/user/r0368280/files/Examenopdracht/Pictures/PrintscreenA.png">

 
Another tool we can use for motif discovery is DIRE (identification of distant regulatory elements of co-regulated genes). We uploaded the upregulated genes in DIRE and we saw that NFKB1 is among the top TFs. This means that the NFKB1 recognition sequence is enriched in the promotors of the input genes; the input is enriched for direct targets of NFKB1.
​

Another tool we can use for motif discovery is DIRE (identification of distant regulatory elements of co-regulated genes). We uploaded the upregulated genes in DIRE and we saw that NFKB1 is among the top TFs. This means that the NFKB1 recognition sequence is enriched in the promotors of the input genes; the input is enriched for direct targets of NFKB1.

 
<img width="50%" src="/user/r0368280/files/Examenopdracht/Pictures/PrintscreenB.png">

 
## 4. GeneMANIA
​
We now have the NFKB1 network that is solely based on co-expressed genes. We can also connect transcription factors with genes based on physical interactions, co-localization, genetic interactions etc. This can be done by GeneMANIA (max resultant gene was set on 100). We retrieved an association network for NFKB1 from GeneMANIA (picture below). 
​

4. GeneMANIA

We now have the NFKB1 network that is solely based on co-expressed genes. We can also connect transcription factors with genes based on physical interactions, co-localization, genetic interactions etc. This can be done by GeneMANIA (max resultant gene was set on 100). We retrieved an association network for NFKB1 from GeneMANIA (picture below).

 
<img width="50%" src="/user/r0368280/files/Examenopdracht/Pictures/PrintscreenC.png">

 
We now upload the list of genes generated by GeneMANIA in cytoscape and perform iRegulon analysis. 

We now upload the list of genes generated by GeneMANIA in cytoscape and perform iRegulon analysis.

 
##### iRegulon analysis
​
We see that NFKB1 is still detected as a transcription factor. The direct targets are significantly enriched in the association network.
iRegulon analysis

We see that NFKB1 is still detected as a transcription factor. The direct targets are significantly enriched in the association network.

 
<img width="50%" src="/user/r0368280/files/Examenopdracht/Pictures/PrintscreenD.png">

 
## 5. Chipseq analysis  (other notebook: Examenopdracht_GROUP12_PART2_BASH)
​
The next question is if the transcription factor NFKB1 directly regulates the target genes. Does NFKB1 bind to the target genes (i.e. the upregulated genes in RA)? This can be investigated by use of Chipseq analysis. Because chipseq analysis is performed in Bash and microarray analysis in R we make a new notebook and continue working in that one. 

5. Chipseq analysis (other notebook: Examenopdracht_GROUP12_PART2_BASH)

The next question is if the transcription factor NFKB1 directly regulates the target genes. Does NFKB1 bind to the target genes (i.e. the upregulated genes in RA)? This can be investigated by use of Chipseq analysis. Because chipseq analysis is performed in Bash and microarray analysis in R we make a new notebook and continue working in that one.