Transcription of An introduction to adegenet 2.0
1 An introduction Jombart Imperial College LondonMRC Centre for Outbreak Analysis and ModellingJuly 29, 2015 AbstractThis vignette provides an introductory tutorial to theadegenetpackage [4] forthe R software [12]. This package implements tools to handle, analyse and simulategenetic data. Originally developped for multiallelic, codominant markers such asmicrosatellites,adegenetnow also handles dominant markers, allows for any ploidy inthe data, handles SNPs and sequence data, and implements a memory-efficient storagefor genome-wide SNP data.
2 This tutorial provides an overview ofadegenet s basicfunctionalities. , this tutorial is no longer distributed as a packagevignette. Also note thatadegenethas undergone substantial changes with , including a reform of the data structure and new accessors, all documented inthis tutorial. Introduction32 Getting Installing the package - stable version .. Installing the package - devel version .. Getting help in R .. Asking help on a forum .. Bug report, feature requests, contributions: we are all one!
3 63 Object genind objects .. genpop objects .. Using accessors ..124 Importing/exporting Importing data from GENETIX, STRUCTURE, FSTAT, Genepop .. Importing data from other software .. Handling presence/absence data .. SNPs data .. Extracting polymorphism from DNA sequences .. Extracting polymorphism from proteic sequences .. Usinggenind/genpopconstructors .. Exporting data ..315 Basics of data Manipulating the data .. Using summaries.
4 Testing for Hardy-Weinberg equilibrium .. Measuring and testing population structure ( ) .. Estimating inbreeding ..456 Multivariate General overview .. Performing a Principal Component Analysis ongenindobjects .. Performing a Correspondance Analysis ongenpopobjects ..587 Spatial Isolation by distance .. isolation by distance .. or distant patches? .. Using Monmonier s algorithm to define genetic boundaries ..678 Simulating hybridization7721 IntroductionThis tutorial introduces some basic functionalities of theadegenetpackage for R [12].
5 Thepurpose of this package is to provide tools for handling, analysing and simulating geneticdata, with an emphasis on multivariate approaches and exploratory methods. Standardmultivariate analyses are implemented in theade4package [2], of whichadegenetwasoriginally an extension. However, the package has since grown methods of its own suchas the Discriminant Analysis of Principal Components (DAPC, [8]), the spatial PrincipalComponents Analysis (sPCA, [5]), or theSeqTrackalgorithm [6].
6 In this tutorial, weintroduce the main data structures, show how to import data intoadegenet, and cover somebasic population genetics and multivariate tutorials are available via the commandadegenetTutorial: adegenetTutorial("spca"): tutorial on the sPCA adegenetTutorial("dapc"): tutorial on the DAPC adegenetTutorial("genomics"): tutorial on handling large SNP datasets usinggenlightobjects32 Getting Installing the package - stable versionBefore going further, we shall make sure thatadegenetis well installed on the computer.
7 Thecurrent version of the package is Make sure you have a recent version of R ( )by ## [1] "R Under development (unstable) (2015-06-18 r68542)"Then, installadegenetwith dependencies (" adegenet ", dep=TRUE)We can now load the package alongside other useful packages:library("ape")library("pegas")l ibrary("seqinr")library("ggplot2")librar y(" adegenet ")If at some point you are unsure about the version of the package, you can check it using:packageDescription(" adegenet ", fields = "Version")## [1] " "adegenetversion should read Installing the package - devel versionThe development ofadegenetis hosted on github: can install this version using the packagedevtoolsand the following commands:library("devtools")install_gith ub("thibautjombart/ adegenet ")library("ad egenet")The development version may implement new features and fix known issues.
8 However, itmay also occasionally be broken, as this is our working copy of the project. Usual disclaimersapply here: this package is provided with no warranty, etc. If unsure, use the stable Getting help in RThere are several ways of getting information about R in general, and aboutadegenetinparticular. The used to look for help on a given topic. For ("Hardy-Weinberg")replies that there is a theadegenetpackage, and othersimilar functions ingeneticsandpegas. To get help for a given function, use?
9 Foowherefoois the function of interest. For instance (quotes and parentheses can be removed):?spcawill open up the manpage of the spatial principal component analysis [5]. At the endof a manpage, an example section often shows how to use a function. This can be copiedand pasted to the console, or directly executed from the console usingexample. For furtherquestions concerning R, the functionRSiteSearchis a powerful tool for making onlineresearches using keywords in R s archives (mailing lists and manpages).
10 Adegenethas a few extra documentation can be found fromthe website ( ), in the documents section,including several tutorials and a manual which compiles all manpages of the package, and adedicated mailing list with searchable archives. To open the website from R, use:adegenetWeb()The same can be done for tutorials, usingadegenetTutorial(see manpage to choose thetutorial to open). You will also find an overview of the main functionalities of the packagetyping:?adegenetNote that you can also browse help pages as html pages, ()To go to theadegenetpage, click packages , adegenet , and adegenet -package.