Skip to content
Snippets Groups Projects
Commit 31fd9e1d authored by Claudia  CHICA's avatar Claudia CHICA
Browse files

Update...

Update Tuesday/methylGSA_Functional_analysis/data/NonAgedVSAged_Manova_DMRs.txt, Tuesday/methylGSA_Functional_analysis/FuncAnalysis_methylGSA.html, Tuesday/methylGSA_Functional_analysis/FuncAnalysis_methylGSA.Rmd, Tuesday/methylGSA_Functional_analysis/results/methyGSA_GSEA_GO_hypohypermethylated_table.txt
parent 8b274caf
No related branches found
No related tags found
No related merge requests found
---
title: 'Functional Analysis of differentially methylated regions - NonAged vs Aged'
subtitle: 'methylGSA - FCS approach'
author: "Claudia Chica"
date: "`r Sys.Date()`"
output:
html_document:
keep_md: yes
number_sections: yes
smart: no
toc: yes
toc_float: yes
editor_options:
chunk_output_type: console
---
```{r setup, include=FALSE, message=FALSE, warning=FALSE, echo=FALSE}
knitr::opts_chunk$set(echo = TRUE)
# working directory
workdir="/Volumes/bioit-1/PHINDAcces_HandsOn/Tuesday/methylGSA_Functional_analysis"
library(methylGSA)
library(IlluminaHumanMethylation450kanno.ilmn12.hg19)
```
# Methylated regions analysis
Gene Set Enrichment Analysis (GSEA) is a computational method that determines whether an a priori defined set of genes shows statistically significant concordant differences between two biological states. In this case aged (CSI_A & CSI_B) and non aged (WT + UVSS).
MethylGSA (https://doi.org/10.1093/bioinformatics/bty892) proposes and implementation of GSEA specific for methylation datasets. MethylGSA adapts the robust rank aggregation (RRA) approach to adjust for number of CpGs in DNA methylation gene set testing.
```{r uploadData_MR, message=FALSE, warning=FALSE, echo=FALSE}
dataset='allMRs' ; method="GSEA"
# Data and result folders
outdir=paste0(workdir,"/results/")
datadir=paste0(workdir,"/data/")
data_file='NonAgedVSAged_Manova_DMRs.txt'
count.data <- read.table(paste0(datadir,data_file),header = T)
```
## methylGSA GSEA on gene sets
```{r methylGSA_GO, message=FALSE, warning=FALSE, echo=FALSE}
# Perform GSEA with GO
cpg.pval=count.data$NonAgedVSAged_Manova_minAdj_BH
names(cpg.pval)=count.data$ID_REF
hist(cpg.pval)
mGSAres_GO = methylRRA(cpg.pval = cpg.pval, method = method,
GS.type = "GO", GS.idtype = "SYMBOL", minsize = 100, maxsize = 500)
# Print results
## Print first 15 enriched terms
print(head(mGSAres_GO,15)[,c(1,2,3,5,7)])
## Print table with enriched terms
fileOut=paste0(outdir,"/methyGSA_",method,"_GO_hypohypermethylated_table.txt")
write.table(mGSAres_GO[,-8],fileOut,row.names = F, sep="\t",quote = F)
```
<details>
<summary>**Now try:**</summary>
How would you try to do the same analysis but using pathways, instead of GO terms?
```{r methylGSA_PW, message=FALSE, warning=FALSE, echo=FALSE, include=FALSE, eval=FALSE}
# Perform GSEA with GO
mGSAres_PW = methylRRA(...)
# Print results
## Print first 15 enriched terms
print(head(mGSAres_PW,15)[,c(1,2,3,5,7)])
## Print table with enriched term
fileOut=paste0(outdir,"/methyGSA_",method,"_PW_hypohypermethylated_table.txt")
write.table(mGSAres_PW[,-8],fileOut,row.names = F, sep="\t",quote = F)
```
What's the meaning of the following parameters? How do they change the results?
`minsize = 100` and `maxsize = 500`
```{r, include=FALSE, eval=FALSE}
mGSAres = methylRRA(cpg.pval = cpg.pval, method = method,
GS.type = "GO", GS.idtype = "SYMBOL", minsize = 10, maxsize = 100)
print(head(mGSAres,15)[,c(1,2,3,5,7)])
```
</details>
# Visualization with REVIGO
From the GO enriched terms, select the most significant and try to summarize them using the REVIGO tool.
http://revigo.irb.hr
R session information
---------------------
In the reproducible research framework, an important step is to save all the versions of the softwares used to perform the statistical analysis. They must be provided when submitting a paper.
```{r}
sessionInfo()
```
source diff could not be displayed: it is too large. Options to address this: view the blob.
source diff could not be displayed: it is too large. Options to address this: view the blob.
source diff could not be displayed: it is too large. Options to address this: view the blob.
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment