-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Write first draft of metagenomic tutorial
- Loading branch information
Showing
4 changed files
with
96 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Package: iSEEtree | ||
Version: 0.99.6 | ||
Version: 0.99.7 | ||
Authors@R: | ||
c(person(given = "Giulio", family = "Benedetti", role = c("aut", "cre"), | ||
email = "[email protected]", | ||
|
@@ -38,6 +38,7 @@ Imports: | |
Suggests: | ||
BiocStyle, | ||
knitr, | ||
MGnifyR, | ||
RefManageR, | ||
remotes, | ||
rmarkdown, | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
--- | ||
title: "Metagenomic Data" | ||
author: | ||
- name: Giulio Benedetti | ||
affiliation: University of Turku | ||
email: [email protected] | ||
date: "`r BiocStyle::doc_date()`" | ||
package: "`r BiocStyle::pkg_ver('iSEEtree')`" | ||
output: | ||
BiocStyle::html_document: | ||
toc_float: true | ||
vignette: > | ||
%\VignetteIndexEntry{Metagenomic Data} | ||
%\VignetteEncoding{UTF-8} | ||
%\VignetteEngine{knitr::rmarkdown} | ||
bibliography: references.bib | ||
runtime: shiny | ||
--- | ||
|
||
```{r} | ||
# Import packages | ||
library(iSEEtree) | ||
library(mia) | ||
library(MGnifyR) | ||
library(scater) | ||
``` | ||
|
||
```{r} | ||
# Instantiate mgnify client | ||
mg <- MgnifyClient(useCache = TRUE) | ||
``` | ||
|
||
```{r} | ||
# Fetch sample accession numbers | ||
samples <- searchAnalysis(mg, | ||
accession = "MGYS00002504", | ||
type = "studies") | ||
``` | ||
|
||
|
||
```{r} | ||
# Fetch samples as TreeSE | ||
tse <- getResult(mg, samples, | ||
get.taxa = TRUE, | ||
get.func = FALSE) | ||
``` | ||
|
||
```{r} | ||
# Transform counts to relabundance | ||
tse <- transformAssay(tse, | ||
method = "relabundance", | ||
assay.type = "counts") | ||
# Transform relabundance to CLR | ||
tse <- transformAssay(tse, | ||
method = "clr", | ||
assay.type = "relabundance", | ||
pseudocount = TRUE) | ||
# Standardise CLR | ||
tse <- transformAssay(tse, | ||
method = "standardize", | ||
assay.type = "clr", | ||
MARGIN = "features", | ||
name = "clr-z") | ||
``` | ||
|
||
```{r} | ||
# Estimate alpha diversity | ||
tse <- addAlpha(tse, | ||
index = c("coverage_diversity", "shannon_diversity"), | ||
assay.type = "relabundance") | ||
# Estimate beta diversity | ||
tse <- runMDS(tse, | ||
FUN = vegan::vegdist, | ||
method = "bray", | ||
assay.type = "relabundance") | ||
``` | ||
|
||
```{r} | ||
# Remove long variables | ||
colData(tse)$study_attributes.study.abstract <- NULL | ||
colData(tse)$sample_sample.desc <- NULL | ||
``` | ||
|
||
```{r} | ||
# Launch app | ||
if (interactive()) { | ||
iSEE(tse) | ||
} | ||
``` | ||
|
Empty file.