Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
122 lines (81 sloc) 3.04 KB
---
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()
```