Skip to content

Commit 9cd5c18

Browse files
committed
Updated 05_Microb-networks_tutorial, clean-up, rendering md and html
1 parent 9adf839 commit 9cd5c18

7 files changed

Lines changed: 449 additions & 61 deletions

File tree

index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,6 @@ tutorial/01_Alpha-diversity_tutorial
6868
tutorial/02_Beta-diversity_tutorial
6969
tutorial/03_Abundance-overview_tutorial
7070
tutorial/04_Group-comparison_tutorial
71+
tutorial/05_Microb-networks_tutorial
7172
```
7273

tutorial/05_Microb-networks_tutorial.Rmd

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,25 @@ output:
1919
css: "assets/report.css"
2020
includes:
2121
in_header: "assets/copy-button.html"
22-
staff_web: "https://www.biosustain.dtu.dk/technologies/informatics/data-science-platform"
22+
staff_web: "https://bright.dtu.dk/technologies/biofoundry/informatics"
23+
always_allow_html: true
2324
---
2425

2526
```{r,echo=FALSE,include=FALSE}
2627
# variables
27-
rep_org <- "Data Science Platform"
28-
rep_core3 <- "Alberto Pallejà Caro"
29-
rep_core_email3 <- "apca@biosustain.dtu.dk"
30-
rep_core2 <- "Sebastian Ayala Ruano"
31-
rep_core_email2 <- "asaru@dtu.dk"
28+
rep_org <- "Data Science Platform"
29+
rep_core4 <- "Albert Pallejà Caro"
30+
rep_core_email4 <- "apca@dtu.dk"
31+
rep_core3 <- "Alexander Zubov"
32+
rep_core_email3 <- "alzub@dtu.dk"
33+
rep_core2 <- "Edir Sebastian Vidal Casto"
34+
rep_core_email2 <- "s243564@student.dtu.dk"
3235
rep_core <- "Juliana Assis"
3336
rep_core_email <- "jasge@dtu.dk"
3437
3538
# Combine all responsibles into a single string
3639
rep_all <- paste0(
40+
rep_core4, " (", rep_core_email4, ")<br>",
3741
rep_core3, " (", rep_core_email3, ")<br>",
3842
rep_core2, " (", rep_core_email2, ")<br>",
3943
rep_core, " (", rep_core_email, ")"
@@ -52,6 +56,8 @@ __Responsibles:__ `r paste0(rep_all," ")`
5256

5357
<!-- ----------------------- Do not edit above this ----------------------- -->
5458

59+
# Microbial association networks tutorial
60+
5561
This markdown is to create microbial association networks (MANs) based on the abundance data using [pearson correlation](https://en.wikipedia.org/wiki/Pearson_correlation_coefficient)
5662
as association measure.
5763

@@ -70,16 +76,16 @@ library(dplyr)
7076
## Load data
7177
```{r, warning=FALSE}
7278
# Abundance table
73-
abundance <- readRDS(file = "data/MetaphlanAbundance_Species.rds")
79+
abundance <- readRDS(file = "../data/MetaphlanAbundance_Species.rds")
7480
rownames(abundance) <- gsub("_SRR_db1.metaphlan", "", rownames(abundance))
7581
dim(abundance)
7682
7783
# Taxonomical annotation
78-
annotation <- readRDS(file = "data/MetaphlanAnnotations_Species.rds")
84+
annotation <- readRDS(file = "../data/MetaphlanAnnotations_Species.rds")
7985
dim(annotation)
8086
8187
# Metadata
82-
metadata <- read.table(file = "data/metadata.tsv",
88+
metadata <- read.table(file = "../data/metadata.tsv",
8389
header = TRUE, sep = "\t",
8490
quote = "",
8591
row.names = NULL)
@@ -94,7 +100,7 @@ dim(abundance)
94100
## Create a directory to store the results
95101

96102
```{r, warning=FALSE}
97-
results_dir <- "results/report/05_Microbial-association-networks"
103+
results_dir <- "../results/report/05_Microbial-association-networks"
98104
99105
dir.create(results_dir, recursive = TRUE, showWarnings = FALSE)
100106
```
@@ -340,7 +346,8 @@ net_viz <- plot(
340346
)
341347
342348
# Open and close PNG device
343-
png(file.path(results_dir, "5_pearson_network_igraph_plot.png"), width = 2500, height = 2300, res = 150)
349+
png(file.path(results_dir, "5_pearson_network_igraph_plot.png"),
350+
width = 2500, height = 2300, res = 150)
344351
dev.off()
345352
```
346353

@@ -365,7 +372,7 @@ to demonstrate how to use this package using the same dataset from this course.
365372

366373
```{r,eval=FALSE,echo=FALSE}
367374
# manually run this to render this document to HTML
368-
rmarkdown::render("Group-Comparison.Rmd")
375+
rmarkdown::render("05_Microbial-association-networks.Rmd")
369376
# then run this to convert HTML to PDF (if needed)
370377
#pagedown::chrome_print("core-report.html",output="core-report.pdf")
371378
```

tutorial/05_Microb-networks_tutorial.html

Lines changed: 51 additions & 49 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)