Newer
Older
---
title: "Matching Footprint-based analysis results to Covid-19 Disease Maps content"
author: "Alberto Valdeolivas: alvadeolivas@gmail.com; Date:"
date: "03/04/2022"
Alberto Valdeolivas
committed
always_allow_html: true
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
### License Info
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Please check http://www.gnu.org/licenses/.
Alberto Valdeolivas
committed
The code included in the present notebook is based on this [script](https://git-r3lab.uni.lu/computational-modelling-and-simulation/generegulationanalysis/-/blob/master/5_SBMLSearch/SourceCode/grep_disease_map.R) developed by Yusuke Hiki
# Introduction
The present script takes the output of our Footprint-based analysis and matches
Alberto Valdeolivas
committed
the results againts the content of [the Covid-19 Disease Maps](https://covid.pages.uni.lu/map_contents)
```{r, warning=FALSE, message=FALSE}
library(kableExtra)
Alberto Valdeolivas
committed
library(stringr)
```
# Results
## Reading Input files
Alberto Valdeolivas
committed
We first read the content ofthe Covid-19 Disease Maps which can be found in this [file](https://gitlab.lcsb.uni.lu/covid/models/-/blob/master/Resources/Expand%20the%20diagrams/COVID19_Disease_Map_bipartite_crosslinked.tsv):
Alberto Valdeolivas
committed
disease_map <- read.delim("https://gitlab.lcsb.uni.lu/covid/models/-/raw/master/Resources/Expand%20the%20diagrams/COVID19_Disease_Map_bipartite_crosslinked.tsv")
```
We then read the output of our Footprint-based analyisis, namely CARNIVAL's output network.
Alberto Valdeolivas
committed
This file can be found [here](https://gitlab.lcsb.uni.lu/computational-modelling-and-simulation/footprint-based-analysis-and-causal-network-contextualisation-in-sars-cov-2-infected-a549-cell-line/-/tree/master/Carnival_Results).
```{r, warning=FALSE, message=FALSE}
carnival_results <- readRDS("InputFiles/carnival_results_withprogeny.rds")
carnival_nodes_hgnc <- unique(c(carnival_results$weightedSIF[,"Node1"], carnival_results$weightedSIF[,"Node2"]))
```
## Matching the results
We finally match all our genes from the carnival network with all the genes from the different pathways
included in the COVID19 Disease maps.
```{r, warning=FALSE, message=FALSE}
Alberto Valdeolivas
committed
matching_genes <- character()
matching_pathways <- character()
Alberto Valdeolivas
committed
for (i in 1:nrow(disease_map)){
Alberto Valdeolivas
committed
if (!(is.na(disease_map$source_hgnc[i]))) {
source_nodes <-
str_replace(unlist(strsplit(disease_map$source_hgnc[i], split = ";")), "HGNC_SYMBOL:", "")
} else {
source_nodes <- c()
}
Alberto Valdeolivas
committed
if (!(is.na(disease_map$target_hgnc[i]))) {
target_nodes <-
str_replace(unlist(strsplit(disease_map$target_hgnc[i], split = ";")), "HGNC_SYMBOL:", "")
} else {
target_nodes <- c()
Alberto Valdeolivas
committed
all_nodes <- unique(c(source_nodes, target_nodes))
if (length(all_nodes)!= 0){
current_matching_genes <- intersect(carnival_nodes_hgnc, all_nodes)
if (length(current_matching_genes) != 0){
current_matching_pathways <- rep(disease_map$source_diagram[i], length(current_matching_genes))
matching_genes <- c(matching_genes, current_matching_genes)
matching_pathways <- c(matching_pathways, current_matching_pathways)
}
}
Alberto Valdeolivas
committed
disease_map_hgnc_carnival_detected <-
data.frame(source_diagram = matching_pathways, hgnc_carnival=matching_genes) %>%
dplyr::distinct()
```
and We visualize the results.
```{r}
disease_map_hgnc_carnival_detected %>%
kbl(col.names = c("Covid19 DM Diagram", "Carnival nodes")) %>%
kable_styling()
```
Alberto Valdeolivas
committed
```{r, warning=FALSE, message=FALSE}
write.table(x=disease_map_hgnc_carnival_detected,
file = "MatchingGenes/carnival_diagrams.tsv", sep = "\t",
row.names = FALSE, quote = FALSE)
```
# Session Info Details
```{r, echo=FALSE, eval=TRUE}
sessionInfo()
```