Learn R Programming

⚠️There's a newer version (2.9.9.5) of this package.Take me there.

dartR (version 1.1.11)

Importing and Analysing SNP and Silicodart Data Generated by Genome-Wide Restriction Fragment Analysis

Description

Functions are provided that facilitate the import and analysis of SNP (single nucleotide polymorphism) and silicodart (presence/absence) data. The main focus is on data generated by DarT (Diversity Arrays Technology). However, once SNP or related fragment presence/absence data from any source is imported into a genlight object many of the functions can be used. Functions are available for input and output of SNP and silicodart data, for reporting on and filtering on various criteria (e.g. CallRate, Heterozygosity, Reproducibility, maximum allele frequency). Advanced filtering is based on Linkage Disequilibrium and HWE (Hardy-Weinberg equilibrium). Other functions are available for visualization after PCoA (Principle Coordinate Analysis), or to facilitate transfer of data between genlight/genind objects and newhybrids, related, phylip, structure, faststructure packages.

Copy Link

Version

Install

install.packages('dartR')

Monthly Downloads

2,264

Version

1.1.11

License

GPL-2

Maintainer

Bernd Gruber

Last Published

February 7th, 2019

Functions in dartR (1.1.11)

bandicoot.gl

A genlight object created via the read.dart functions
gl.costdistances

Calculates cost distances for a given landscape (resistance matrix)
gl.make.recode.ind

Create a proforma recode_ind file for reassigning individual (=specimen) names
gl.define.pop

Define a new population in a genelight {adegenet} object on the basis of specified individuals
gl.diversity

Calculate diversity indices for SNPs
gl.basic.stats

Calculates basic statistics for each loci (Hs, Ho, Fis etc.)
gl.make.recode.pop

Create a proforma recode_pop_table file for reassigning population names
gl.collapse

Collapse a distance matrix by amalgamating populations
gl.collapse.pval

Collapse a fixed distance matrix by amalgamating populations for which fixed differences are not significant
gl.collapse.recursive

Recursively collapse a distance matrix by amalgamating populations
gl.recode.pop

Recode population assignments in a genelight object {adegenet}
gl.drop.ind

Remove specified individuals from a genelight {adegenet} object
gl.filter.maf

Filter loci on the basis of minor allele frequency (MAF) in a genlight adegenet object
gl.report.bases

Summary of base pair frequencies
gl.report.pa.pop

Report private alleles (and fixed alleles) per pair of populations
gl.report.repavg

Report summary of RepAvg, reproducibility averaged over both alleles for each locus in a genlight adegenet object
gl2faststructure

Export DArT genlight object {adegenet} to faststructure format (to run faststructure elsewhere)
gl.amova

Performs and AMOVA using genlight data.
gl.edit.recode.ind

Create or edit a individual (=specimen) names and create an recode_ind file
gl.assign

Assign an individual of unknown provenance to population
gl.dist.heatmap

Represent a distance matrix as a heatmap
gl.dist.pop

Calculate a distance matrix for populations defined in an {adegenet} genlight object
gl2gds

Convert a genlight object to nexus format PAUP SVDquartets
gl.filter.callrate

Filter loci or specimens in a genlight {adegenet} object based on call rate
gl.filter.monomorphs

Remove monomorphic loci, including those with all NAs
gi2gl

Converts a genind object to genlight object
gl.edit.recode.pop

Create or edit a population re-assignment table
gl.fixed.diff

Generate a matrix of fixed differences from a genelight or genind object {adegenet}
gl.Ho

A very simple function to report observed Heterozygosity
gl.drop.pop

Remove specified populations from a genelight {adegenet} object
gl.drop.loc

Remove specified loci from a genelight {adegenet} object
gl.fst.pop

Calculate a pairwise fst values for populations in a genlight object
gl.filter.cloneid

Filter for CloneID to select only unique SNPs
gl.pcoa

PCoA ordination (glPca)
gl.hwe.pop

Filter function to facilitate analysing of dart data
gl.ibd

Isolation by distance
gl.pcoa.plot.3d

3D interactive plot of the results of a PCoA ordination
gl.filter.hamming

Filters loci in a genlight object based on pairwise Hamming distance between sequence tags
gl.gene.freq

Calculate a statistic for each locus by group An internal function essentially to convey readability to rather contorted R code. It takes as input a genlight {adegenet} object with an index variable (say, population) and calculates the selected statistic for each locus, broken down by the groups defined by the index variable.
gl.nhybrids

Create an input file for the program NewHybrids and run it if NewHybrids is installed
gl.filter.hwe

Filters loci that show significant departure from Hardy-Weinberg Equilibrium
gl.outflank

Function to identify loci under selection per population using the outflank method of Whitlock and Lotterhos (2015)
gl.plot

Plotting genlight object
gl.keep.ind

Remove all but the specified individuals from a genelight {adegenet} object
gl.keep.pop

Remove all but specified populations from a genelight {adegenet} object
gl.read.dart

Import DarT data into R and conver it to a genlight object
gl.genleastcost

Least-cost path analysis based on a friction matrix
gl.pcoa.scree

Produce a plot of eigenvalues, standardized as percentages, derived from a PCoA
gl.read.silicodart

Import presence/absence data from SilicoDArT and convert to genind {agegenet} format
gl.report.monomorphs

Report monomorphic loci, including those with all NAs
gl.report.pa

Report number of private alleles possessed by an individual of unknown provenance
gl.read.dart.2row

Import SNP data from DArT and convert to genlight {agegenet} format (gl)
gl.percent.freq

Generate percentage allele frequencies by locus and population
gl.report.secondaries

Report loci containing secondary SNPs in a genlight {adegenet} object
gl.utils.fdsim

Estimate the rate of false positives in a fixed difference analysis
gl.sexlinkage

Identify loci that are sex linked in specimens in a genlight {adegenet} object
gl2gi

Converts a genlight object to genind object
gl.pcoa.plot

Bivariate plot of the results of a PCoA ordination
gl.write.csv

gl2shp

Convert genlight objects to ESRI shapefiles or kml files
gl.report.ld

Calculates pairwise population based Linkage Disequilibirum across all loci using the specifyied number of cores
gl.Hs

A very simple function to report expected Heterozygosity
gl.pcoa.pop

PCoA ordination of populations
gl.report.callrate

Report summary of Call Rate for loci or individuals
gl.alf

Calculates allele frequency of the first and second allele for each loci #' A very simple function to report allele frequencies
gl.report.hamming

Calculates the pairwise Hamming distance between DArT trimmed DNA sequences
gl.report.maf

Report minor allele frequency (MAF) for each locus in a genlight adegenet object
gl2snapp

Convert a genlight object to nexus format suitable for phylogenetic analysis by SNAPP (via BEAUti)
gl2treemix

Convert a genlight object to a treemix input file
gl.filter.repavg

Filter loci in a genlight {adegenet} object based on average repeatability of alleles at a locus
gl.filter.secondaries

Filter loci that represent secondary SNPs in a genlight {adegenet} object
gl.subsample.loci

Subsample n loci from a genlight object and return as a genlight object
is.fixed

Test to see if two populations are fixed at a given locus
gl.tree.nj

Output an nj tree to summarize genetic similarity among populations
utils.hwe

Calculates departure from Hardy-Weinberg Equilibrium. Utility script not meant for end users.
utils.recalc.avgpic

A utility script to recalculate the OneRatioRef, OneRatioSnp, PICRef, PICSnp, and AvgPIC by locus after some populations have been deleted.
gl.sim.ind

Simulates individuals based on the allele frequencies provided via a genlight object.
gl2phylip

Create a Phylip input distance matrix from a genlight (SNP) or genind (SilicoDarT) {adegenet} object
gl.grm

Calculates the genomic relatedness matrix
platy

Example data set as text file to be imported into a genlight object
possums.gl

A simulated genlight object created to run a landscape genetic example
gl.grm.network

Represents a genomic relatedness matrix as a network
utils.recalc.freqhomref

A utility script to recalculate the the frequency of the homozygous reference SNP by locus after some populations have been deleted
gl2plink

Converts a genlight object to plink file format
utils.recalc.freqhomsnp

A utility script to recalculate the the frequency of the homozygous alternate SNP by locus after some populations have been deleted
gl.sim.offspring

Simulates a specified number of offsprings based on alleles provided by potential father(s) and mother(s)
gl2structure

Converts genlight objects to STRUCTURE formated files
gl2svdquartets

Convert a genlight object to nexus format PAUP SVDquartets
gl2sa

Convert genlight objects to the format used in the SNPassoc package
testset_SNPs_2Row

Testfile in DArT format (as provided by DArT)
testset.gl

A genlight object created via the read.dart functions
utils.recalc.callrate

A utility script to recalculate the callrate by locus after some populations have been deleted
gl.map.interactive

Creates an interactive map (based on latlong) from a genlight object
testset_metadata

Metadata file. Can be integrated via the dart2genlight function.
testset_pop_recode

Recode file to be used with the function.
util.outflank.MakeDiploidFSTMat

Creates OutFLANK input file from individual genotype info.
gl.merge.pop

Merge two or more populations in a genelight {adegenet} object into one population
util.outflank

OutFLANK: An Fst outlier approach by Mike Whitlock and Katie Lotterhos, University of British Columbia.
gl.recalc.metrics

Recalculate locus metrics when individuals or populations are deleted from a genlight {adegenet} object
gl.recode.ind

Recode individual (=specimen) labels in a genelight or genind object {adegenet}
utils.recalc.freqhets

A utility script to recalculate the the frequency of the heterozygous SNPs by locus after some populations have been deleted
gl.report.heterozygosity

Reports hetrozygosity
gl.report.hwe

Reports departure from Hardy-Weinberg Equilibrium
gl2demerelate

Create a dataframe suitable for input to package {Demerelate} from a genlight {adegenet} object
gl2fasta

Concatenates DArT trimmed sequences and outputs a fastA file.
prob.hwe

Exact SNP test of Hardy-Weinberg Equilibrium
read.dart

Import DarT data to R
util.outflank.plotter

Plotting functions for Fst distributions after OutFLANK This function takes the output of OutFLANK as input with the OFoutput parameter. It plots a histogram of the FST (by default, the uncorrected FSTs used by OutFLANK) of loci and overlays the inferred null histogram.
utils.hamming

Calculates the Hamming distance between two DArT trimmed DNA sequences
utils.recalc.maf

A utility script to recalculate the the minor allele frequency by locus, typically after some populations have been deleted
dart2genlight

Convert DarT to genlight