-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
83 lines (61 loc) · 2.68 KB
/
README.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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
fig.dev = "grDevices::png",
dpi = 300L,
dev.args = list(),
fig.ext = "png",
fig.height=8,
fig.width=12,
fig.retina = 2L,
fig.align = "center"
)
```
# stana
<!-- badges: start -->
[![R-CMD-check](https://github.com/noriakis/stana/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/noriakis/stana/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
Metagenotyping analysis in R. Import and analyse, visualize the metagenotyping output of the software like [MIDAS](https://github.com/snayfach/MIDAS), [MIDAS2](https://github.com/czbiohub/MIDAS2), [metaSNV and metaSNV v2](https://github.com/metasnv-tool/metaSNV), and [inStrain](https://github.com/MrOlm/inStrain). In general the metagenotyping software produces the allelic count information and gene copy number tables and the package utilizes these information to analyze the intra-species diversity.
The detailed usage is available at [https://noriakis.github.io/software/stana](https://noriakis.github.io/software/stana), using `bookdown`.
## Installation
Using `devtools`:
```{r, eval=FALSE}
devtools::install_github("noriakis/stana")
```
## Pipeline
<img src="https://github.com/noriakis/software/blob/main/images/stana_pipeline.png?raw=true" width="800px">
## Examples
```{r message=FALSE, warning=FALSE, fig.width=6, fig.height=6}
## Using example data
library(stana)
library(phangorn)
load(system.file("extdata", "sysdata.rda", package = "stana"))
stana
getID(stana)
## Make example metadata
samples <- getSlot(stana, "snps")[[1]] |> colnames()
metadata <- data.frame(
row.names=samples,
treatment=factor(sample(1:3, length(samples), replace=TRUE)),
marker=runif(length(samples))
)
## Set metadata
stana <- setMetadata(stana, metadata)
## Call consensus sequence
## Infer and plot tree based on metadata
stana <- stana |>
consensusSeq(argList=list(site_prev=0.95)) |>
inferAndPlotTree(meta=c("treatment","marker"))
getFasta(stana)[[1]]
getTree(stana)[[1]]
getTreePlot(stana)[[1]]
```
If the gene copy number table is available like in `MIDAS` series and `inStrain`, one can compare the functional implications of these gene contents. The details are described in the [documentation](https://noriakis.github.io/software/stana).
## Interactive inspection
The users can inspect metagenotyping results interactively using Shiny based on the variables such as disease conditions (`exportInteractive()`). One can publish the results in the hosting services for sharing the research findings.