-
Notifications
You must be signed in to change notification settings - Fork 50
/
TEMPLATE.Rmd
121 lines (81 loc) · 3.04 KB
/
TEMPLATE.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
---
title: "Template Vignette"
---
# Research Question
A short sentence describing the question central to the analysis.
# Introduction
Explain the purpose of the vignette. Give a brief explanation of the questions
that will be answered and some background information. These vignettes are
written in [Rmarkdown](http://rmarkdown.rstudio.com). You can find [details
about markdown here](http://rmarkdown.rstudio.com/authoring_basics.html) and
[details about code chunks
here](http://rmarkdown.rstudio.com/authoring_rcodechunks.html).
This template document in Rmarkdown format is located at
https://github.com/nescent/popgenInfo/tree/master/TEMPLATE.Rmd.
# Assumptions
All biological analyses have assumptions.
- Assumption 1
- Assumption 2
# Resources
## Data
Links to information about the data if needed e.g. package vignettes. You can
use an [external
link](https://github.com/cran/adegenet/blob/master/inst/files/nancycats.gtx) or
you can place the data [in the `data/` folder](https://github.com/nescent/popgenInfo/blob/master/data/nancycats.gtx)
(please keep this < 200kb).
## Packages
Packages required. Say where these can be found, can link to the list of
packages on our repository page here also.
Loading the required packages:
```{r, packages, message=FALSE}
library("hierfstat")
library("adegenet")
```
# Analysis (divided into sections)
Example Sections
## Section 1: Load the data
We will import "nancycats.gtx" to a "genind" object (from the package
*adegenet*) called `nancycats`.
```{r load_data_show, eval=FALSE}
nancycats <- import2genind("nancycats.gtx")
nancycats
```
```{r load_data_evaluate, echo=FALSE}
# Note: the code chunk above will be shown to the reader, but it will not run.
# This code chunk will run, but will not be shown to the reader.
nancycats <- import2genind("../data/nancycats.gtx")
nancycats
```
## Section 2: Exploratory Data analysis/Checking assumptions
## Section 3: Summary statistics
Sometimes packages contain their own useful summary statistics, such as expected
heterozygosity.
```{r summary_cats}
nan_summary <- summary(nancycats)
nan_summary
```
## Section 4: Visualizing the results
Often, it's useful to plot these results.
```{r visual_summary}
plot(nan_summary$Hexp, nan_summary$Hobs,
xlab = "Expected Heterozygosity", ylab = "Observed Heterozygosity")
abline(0, 1, lty = 2) # adding a 1:1 line
```
This plot shows us that the observed heterozygosity of these cat colonies is lower
than the expected heterozygosity.
# Conclusions
## What's next
Information on further analysis that could be done, other workflows [can be
linked as well](DifferentiationSNP.html) (note the HTML as opposed to Rmd link).
# Contributors
- Author 1 (Author)
- Author 2 (Author)
- Contributor 1 (role)
# Session Information
This shows us useful information for reproducibility. Of particular importance
are the versions of R and the packages used to create this workflow. It is
considered good practice to record this information with every analysis.
```{r, sessioninfo}
options(width = 100)
devtools::session_info()
```