-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathFunction_Glossary.Rmd
130 lines (108 loc) · 5.01 KB
/
Function_Glossary.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
119
120
121
122
123
124
125
126
127
128
129
130
```{r,message=FALSE,echo=FALSE}
library("knitcitations")
library("knitr")
cite_options(citation_format = "pandoc", max.names = 3, style = "html", hyperlink = "to.doc")
bib <- read.bibtex("bibtexlib.bib")
opts_chunk$set(tidy = FALSE)
```
---
title: "A2: Function glossary"
---
<!---To quit R you can either use the Rstudio>Quit Rstudio pulldown menu command or execute ⌘+Q (OS X) or CTRL+Q (PC).
Navigation in R
----
---->
<!--```{r, eval=FALSE}
getwd() # this command will print the current working directory
ls() # list objects in the current workspace
help(options) # learn about available options
history() # viewing your command history
data(*dsname*) # access builtin database *dsname*; must have pacakge loaded containing it
q() # quit your R session
# default for saving history is ".Rhistory"
savehistory(file="myfile") # save your command history for whole session
loadhistory(file= "myfile") # recall command history save
# Package specific information
installed.packages()[,c("Package","Version")] #list packages & versions installed
browseVignettes() # see vignettes from all packages
#Help on functions
help(functionname) # Display documentation for a function
args(functionname) # What are the arguments for a given function
example(functionname) # see examples of function calls
```
-->
Navigation in R
----
Our primer is heavily based on the *poppr* and *adegenet* packages. To get help
on any of their functions type a question mark before the empty function call as
in:
```{r, eval=FALSE}
?mlg # open the R documentiaon of the function mlg
```
Other information can be obtained with the following commands.
```{r, eval = FALSE}
browseVignettes(package = 'poppr') # see vignettes for poppr
vignette('poppr_manual') # see manual for poppr
help(package="poppr") # shows all functions contained in poppr package
```
*Poppr* functions
----
### Import/Export
Function | Description
----|----
`getfile` | Provides a quick GUI to grab files for import
`read.genalex` | Read *GenAlEx* formatted csv files to a genind object
`genind2genalex` | Converts genind objects to *GenAlEx* formatted csv files
### Manipulation
Function | Description
----|----
`as.genclone` | Converts genind objects to genclone objects
`setPop` | Set the population using defined strata
`splitStrata` | Split concatenated strata imported as a population
`strata` | Define or extract population strata of a genind object
`addStrata` | Add a vector or data frame to an existing strata
`nameStrata` | Rename a population strata
`missingno` | Handles missing data
`clonecorrect` | Clone censor at a specified population stratum
`informloci` | Detects and removes phylogenetically uninformative loci
`popsub` | Subsets genind objects by population
`shufflepop` | Shuffles genotypes at each locus using four different shuffling algorithms
`recode_polyploids` | Recodes an imported polyploid data set to observed allelic frequencies
### Distances
Function | Description
----|----
`bruvo.dist` | Bruvo’s distance
`diss.dist` | Absolute genetic distance (see `provesti.dist`)
`nei.dist` | Nei’s 1978 genetic distance
`rogers.dist` | Rogers’ euclidean distance
`reynolds.dist` | Reynolds’ coancestry distance
`edwards.dist` | Edwards’ angular distance
`provesti.dist` | Provesti’s absolute genetic distance
### Bootstrapping
Function | Description
----|----
`aboot` | Creates a bootstrapped dendrogram for any distance measure
`bruvo.boot` | Produces dendrograms with bootstrap support based on Bruvo’s distance
### Analysis
Function | Description
----|----
`poppr.amova` | Analysis of Molecular Variance (as implemented in ade4)
`ia` | Calculates the index of association
`mlg` | Calculates the number of multilocus genotypes
`mlg.crosspop` | Finds all multilocus genotypes that cross populations
`mlg.table` | Returns a table of populations by multilocus genotypes
`mlg.vector` | Returns a vector of a numeric multilocus genotype assignment for each individual
`mlg.id` | Finds all individuals associated with each multilocus genotype
`poppr` | Returns a diversity table by population
`poppr.all` | Returns a diversity table by population for all compatible files specified
`private_alleles` | Tabulates the occurences of alleles that only occur in one population
`locus_table` | Create a table of summary statistics per locus
### Visualization
Function | Description
----|----
`plot_poppr_msn` | Plots minimum spanning networks produced in poppr with scale bar and legend
`greycurve` | Helper to determine the appropriate parameters for adjusting the grey level for msn functions
`bruvo.msn` | Produces minimum spanning networks based off Bruvo’s distance colored by population
`poppr.msn` | Produces a minimum spanning network for any pairwise distance matrix related to the data
`info_table` | Creates a heatmap representing missing data or observed ploidy
`genotype_curve` | Creates a series of boxplots to demonstrate how many markers are needed to represent the diversity of your data