-
Notifications
You must be signed in to change notification settings - Fork 0
/
07-summary.Rmd
89 lines (70 loc) · 2.01 KB
/
07-summary.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
author: V. Keith Hughitt
date: "`r format(Sys.time(), '%d %B, %Y')`"
title: "Host-parasite consensus network analysis results"
params:
version: ""
output:
html_document:
theme: cosmo
toc: true
toc_float: true
number_sections: true
code_folding: hide
pdf_document:
toc: true
latex_engine: xelatex
---
Overview
========
```{r load_libraries, message=FALSE}
library(dplyr)
library(igraph)
library(knitr)
library(readr)
library(rJava)
library(printr)
output_tabledir <- 'output/1.0/07-summary/table'
if (!dir.exists(output_tabledir)) {
dir.create(output_tabledir, recursive=TRUE)
}
options(stringsAsFactors=FALSE)
set.seed(1)
# knitr options
opts_chunk$set(dev=c('png', 'pdf'),
fig.width=6,
fig.height=6,
fig.retina=1,
dpi=600)
```
```{r setup}
datasets <- data.frame(
short=c('HsLm-inf', 'HsLm-uninf', 'HsTc-inf', 'HsTc-uninf', 'Lmajor', 'Tcruzi'),
long =c('Human infected with L. major', 'Human infected with L. major (uninfected samples)',
'Human infected with T. cruzi', 'Human infected with T. cruzi (uninfected samples)',
'L. major (all samples)', 'T. cruzi (all samples)')
)
```
Results
=======
### Consensus network vs. Individual networks
```{r consensus_network_vs_indiv_nets, results='asis', message=FALSE}
# load tables for each dataset
#for (x in Sys.glob('output/1.0/01-network-comparison/table/table_01_*')) {
table_01 <- data.frame(type=c("GO Terms", "KEGG Pathways", "CPDB Pathways", "Marbach TF Genes"))
for (ds in datasets$short) {
infile <- sprintf("output/1.0/01-network-comparison/table/table_01_%s.csv", tolower(ds))
# skip if file doesn't exist
if (!file.exists(infile)) {
next
}
#long <- datasets$long[match(ds, datasets$short)]
dat <- read_csv(infile) %>%
select(-score)
colnames(dat) <- c('type', ds)
table_01 <- merge(table_01, dat, by='type', all=TRUE)
}
kable(table_01, digits=2)
```
```{r child='child/00-save-tables.Rmd'}
```