Package: dartR 2.9.7

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

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, data from other sequencing platforms can be used once 'SNP' or related fragment presence/absence data from any source is imported. Genetic datasets are stored in a derived 'genlight' format (package 'adegenet'), that allows for a very compact storage of data and metadata. Functions are available for importing and exporting of 'SNP' and 'silicodart' data, for reporting on and filtering on various criteria (e.g. 'CallRate', heterozygosity, reproducibility, maximum allele frequency). Additional functions are available for visualization (e.g. Principle Coordinate Analysis) and creating a spatial representation using maps. 'dartR' supports also the analysis of 3rd party software package such as 'newhybrid', 'structure', 'NeEstimator' and 'blast'. Since version 2.0.3 we also implemented simulation functions, that allow to forward simulate 'SNP' dynamics under different population and evolutionary dynamics. Comprehensive tutorials and support can be found at our 'github' repository: github.com/green-striped-gecko/dartR/. If you want to cite 'dartR', you find the information by typing citation('dartR') in the console.

Authors:Bernd Gruber [aut, cre], Arthur Georges [aut], Jose L. Mijangos [aut], Carlo Pacioni [aut], Diana Robledo [aut], Peter J. Unmack [ctb], Oliver Berry [ctb], Lindsay V. Clark [ctb], Floriaan Devloo-Delva [ctb], Eric Archer [ctb]

dartR_2.9.7.tar.gz
dartR_2.9.7.zip(r-4.5)dartR_2.9.7.zip(r-4.4)dartR_2.9.7.zip(r-4.3)
dartR_2.9.7.tgz(r-4.4-any)dartR_2.9.7.tgz(r-4.3-any)
dartR_2.9.7.tar.gz(r-4.5-noble)dartR_2.9.7.tar.gz(r-4.4-noble)
dartR_2.9.7.tgz(r-4.4-emscripten)dartR_2.9.7.tgz(r-4.3-emscripten)
dartR.pdf |dartR.html
dartR/json (API)

# Install 'dartR' in R:
install.packages('dartR', repos = c('https://green-striped-gecko.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/green-striped-gecko/dartr/issues

Datasets:
  • bandicoot.gl - A genlight object created via the read.dart functions
  • possums.gl - A simulated genlight object created to run a landscape genetic example
  • testset.gl - A genlight object created via the gl.read.dart function
  • testset.gs - A genlight object created via the gl.read.silicodart function

On CRAN:

8.76 score 31 stars 282 scripts 1.3k downloads 48 mentions 173 exports 133 dependencies

Last updated 3 months agofrom:253115dc4b. Checks:OK: 1 WARNING: 6. Indexed: yes.

TargetResultDate
Doc / VignettesOKOct 28 2024
R-4.5-winWARNINGOct 28 2024
R-4.5-linuxWARNINGOct 28 2024
R-4.4-winWARNINGOct 28 2024
R-4.4-macWARNINGOct 28 2024
R-4.3-winWARNINGOct 28 2024
R-4.3-macWARNINGOct 28 2024

Exports:gi2glgl.alfgl.amovagl.assign.grmgl.assign.mahalanobisgl.assign.pagl.assign.pcagl.basic.statsgl.blastgl.check.verbositygl.collapsegl.compliance.checkgl.costdistancesgl.define.popgl.diagnostics.hwegl.diagnostics.simgl.dist.indgl.dist.popgl.drop.indgl.drop.locgl.drop.popgl.edit.recode.indgl.edit.recode.popgl.evannogl.fdsimgl.filter.allnagl.filter.callrategl.filter.hamminggl.filter.heterozygositygl.filter.hwegl.filter.ldgl.filter.locmetricgl.filter.mafgl.filter.monomorphsgl.filter.overshootgl.filter.pagl.filter.parent.offspringgl.filter.rdepthgl.filter.reproducibilitygl.filter.secondariesgl.filter.sexlinkedgl.filter.taglengthgl.fixed.diffgl.fst.popgl.genleastcostgl.grmgl.grm.networkgl.Hegl.Hogl.hwe.popgl.ibdgl.imputegl.install.vanilla.dartRgl.joingl.keep.indgl.keep.locgl.keep.popgl.ld.distancegl.ld.haplotypegl.LDNegl.list.reportsgl.loadgl.make.recode.indgl.make.recode.popgl.map.interactivegl.map.structuregl.merge.popgl.nhybridsgl.outflankgl.pcoagl.pcoa.plotgl.percent.freqgl.play.historygl.plot.heatmapgl.plot.networkgl.plot.structuregl.print.historygl.print.reportsgl.propSharedgl.random.snpgl.read.csvgl.read.dartgl.read.fastagl.read.silicodartgl.read.vcfgl.reassign.popgl.recalc.metricsgl.recode.indgl.recode.popgl.rename.popgl.report.basesgl.report.callrategl.report.diversitygl.report.hamminggl.report.heterozygositygl.report.hwegl.report.ldgl.report.ld.mapgl.report.locmetricgl.report.mafgl.report.monomorphsgl.report.overshootgl.report.pagl.report.parent.offspringgl.report.rdepthgl.report.reproducibilitygl.report.secondariesgl.report.sexlinkedgl.report.taglengthgl.run.structuregl.samplegl.savegl.select.colorsgl.select.shapesgl.set.verbositygl.sfsgl.sim.create_dispersalgl.sim.emigrationgl.sim.indgl.sim.mutategl.sim.offspringgl.sim.WF.rungl.sim.WF.tablegl.smearplotgl.sortgl.spatial.autoCorrgl.subsample.locigl.test.heterozygositygl.tree.njgl.write.csvgl2bayescangl2bppgl2demerelategl2eigenstratgl2fastagl2faststructuregl2gdsgl2genalexgl2genepopgl2genogl2gigl2hiphopgl2phylipgl2plinkgl2relatedgl2sagl2sfsgl2shpgl2snappgl2structuregl2svdquartetsgl2treemixgl2vcfis.fixedutils.assignmentutils.assignment_2utils.assignment_3utils.assignment_4utils.basic.statsutils.check.datatypeutils.dist.binaryutils.dist.ind.snputils.hammingutils.het.poputils.jackknifeutils.n.var.invariantutils.outflankutils.outflank.MakeDiploidFSTMatutils.outflank.plotterutils.spautocorutils.structure.evannoutils.structure.genind2gtypesutils.structure.run

Dependencies:ade4adegenetapeaskpassbase64encbootbslibcachemcalibratecliclustercodetoolscolorspacecombinatcommonmarkcpp11crayoncrosstalkcurldartR.datadata.tabledigestdismodoParalleldotCall64dplyrevaluatefansifarverfastmapfieldsfontawesomeforcatsforeachfsgapgap.datasetsgdatagdistancegdsfmtgenericsgeneticsGGallyggplot2ggstatsgluegridExtragtablegtoolshighrhmshtmltoolshtmlwidgetshttpuvhttrigraphisobanditeratorsjquerylibjsonliteknitrlabelinglaterlatticelazyevallifecyclemagrittrmapsMASSMatrixmemoisemgcvmimemmodmunsellmvtnormnlmeopensslpatchworkpegaspermutepillarpixmappkgconfigplotlyplyrpngPopGenReportprettyunitsprogresspromisespurrrR.methodsS3R.ooR.utilsR6rappdirsrasterrbibutilsRColorBrewerRcppRcppArmadilloRdpackreshape2RgoogleMapsrlangrmarkdownsassscalessegmentedseqinrshinySNPRelatesourcetoolsspspamStAMPPstringistringrsysterratibbletidyrtidyselecttinytexutf8vctrsveganviridisLitewithrxfunxtableyaml

dartR Tutorials

Rendered fromdartRTutorials.Rmdusingknitr::rmarkdownon Oct 28 2024.

Last update: 2021-04-08
Started: 2021-04-08

Readme and manuals

Help Manual

Help pageTopics
indexing dartR objects correctly...[,dartR,ANY,ANY,ANY-method
A genlight object created via the read.dart functionsbandicoot.gl
adjust cbind for dartRcbind.dartR
Converts a genind object into a genlight objectgi2gl
Calculates allele frequency of the first and second allele for each loci A very simple function to report allele frequenciesgl.alf
Performs AMOVA using genlight datagl.amova
Population assignment using grmgl.assign.grm
Assign an individual of unknown provenance to population based on Mahalanobis Distancegl.assign.mahalanobis
Eliminates populations as possible source populations for an individual of unknown provenance, using private allelesgl.assign.pa
Assign an individual of unknown provenance to population based on PCAgl.assign.pca
Calculates basic statistics for each loci (Hs, Ho, Fis etc.)gl.basic.stats
Aligns nucleotides sequences against those present in a target database using blastngl.blast
Checks the current global verbositygl.check.verbosity
Collapses a distance matrix by amalgamating populations with pairwise fixed difference count less that a thresholdgl.collapse
Checks a genlight object to see if it complies with dartR expectations and amends it to comply if necessarygl.compliance.check
Calculates cost distances for a given landscape (resistance matrix)gl.costdistances
Defines a new population in a genlight object for specified individualsgl.define.pop
Provides descriptive stats and plots to diagnose potential problems with Hardy-Weinberg proportionsgl.diagnostics.hwe
Comparing simulations against theoretical expectationsgl.diagnostics.sim
Calculates a distance matrix for individuals defined in a genlight objectgl.dist.ind
Calculates a distance matrix for populations with SNP genotypes in a genlight objectgl.dist.pop
Removes specified individuals from a genlight objectgl.drop.ind
Removes specified loci from a genlight objectgl.drop.loc
Removes specified populations from a genlight objectgl.drop.pop
Creates or edits individual (=specimen) names, creates a recode_ind file and applies the changes to a genlight objectgl.edit.recode.ind
Creates or edits a population re-assignment tablegl.edit.recode.pop
Creates an Evanno plot from a STRUCTURE run objectgl.evanno
Estimates the rate of false positives in a fixed difference analysisgl.fdsim
Filters loci that are all NA across individuals and/or populations with all NA across locigl.filter.allna
Filters loci or specimens in a genlight {adegenet} object based on call rategl.filter.callrate
Filters loci based on pairwise Hamming distance between sequence tagsgl.filter.hamming
Filters individuals with average heterozygosity greater than a specified upper threshold or less than a specified lower thresholdgl.filter.heterozygosity
Filters loci that show significant departure from Hardy-Weinberg Equilibriumgl.filter.hwe
Filters loci based on linkage disequilibrium (LD)gl.filter.ld
Filters loci on the basis of numeric information stored in other$loc.metrics in a genlight {adegenet} objectgl.filter.locmetric
Filters loci on the basis of minor allele frequency (MAF) in a genlight adegenet objectgl.filter.maf
Filters monomorphic loci, including those with all NAsgl.filter.monomorphs
Filters loci for which the SNP has been trimmed from the sequence tag along with the adaptorgl.filter.overshoot
Filters loci that contain private (and fixed alleles) between two populationsgl.filter.pa
Filters putative parent offspring within a populationgl.filter.parent.offspring
Filters loci based on counts of sequence tags scored at a locus (read depth)gl.filter.rdepth
Filters loci in a genlight {adegenet} object based on average repeatability of alleles at a locusgl.filter.reproducibility
Filters loci that represent secondary SNPs in a genlight objectgl.filter.secondaries
Filters loci that are sex linkedgl.filter.sexlinked
Filters loci in a genlight {adegenet} object based on sequence tag lengthgl.filter.taglength
Generates a matrix of fixed differences and associated statistics for populations taken pairwisegl.fixed.diff
Calculates a pairwise Fst values for populations in a genlight objectgl.fst.pop
Performs least-cost path analysis based on a friction matrixgl.genleastcost
Calculates an identity by descent matrixgl.grm
Represents a genomic relationship matrix (GRM) as a networkgl.grm.network
Estimates expected Heterozygositygl.He
Estimates observed Heterozygositygl.Ho
Performs Hardy-Weinberg tests over loci and populationsgl.hwe.pop
Performs isolation by distance analysisgl.ibd
Imputates missing datagl.impute
Installs all required packages for using all functions available in dartRgl.install.vanilla.dartR
Combines two genlight objectsgl.join
Removes all but the specified individuals from a genlight objectgl.keep.ind
Removes all but the specified loci from a genlight objectgl.keep.loc
Removes all but the specified populations from a genlight objectgl.keep.pop
Plots linkage disequilibrium against distance by population disequilibrium patternsgl.ld.distance
Visualize patterns of linkage disequilibrium and identification of haplotypesgl.ld.haplotype
Estimates effective population size using the Linkage Disequilibrium method based on NeEstimator (V2)gl.LDNe
Prints dartR reports saved in tempdirgl.list.reports
Loads an object from compressed binary format produced by gl.save()gl.load
Creates a proforma recode_ind file for reassigning individual (=specimen) namesgl.make.recode.ind
Creates a proforma recode_pop_table file for reassigning population namesgl.make.recode.pop
Creates an interactive map (based on latlon) from a genlight objectgl.map.interactive
Maps a STRUCTURE plot using a genlight objectgl.map.structure
Merges two or more populations in a genlight object into one populationgl.merge.pop
Creates an input file for the program NewHybrids and runs it if NewHybrids is installedgl.nhybrids
Identifies loci under selection per population using the outflank method of Whitlock and Lotterhos (2015)gl.outflank
Ordination applied to genotypes in a genlight object (PCA), in an fd object, or to a distance matrix (PCoA)gl.pcoa
Bivariate or trivariate plot of the results of an ordination generated using gl.pcoa()gl.pcoa.plot
Generates percentage allele frequencies by locus and populationgl.percent.freq
Replays the history and applies it to a genlight objectgl.play.history
Represents a distance matrix as a heatmapgl.plot.heatmap
Represents a distance or dissimilarity matrix as a networkgl.plot.network
Plots STRUCTURE analysis results (Q-matrix)gl.plot.structure
Prints history of a genlight objectgl.print.history
Prints dartR reports saved in tempdirgl.print.reports
Calculates a similarity (distance) matrix for individuals on the proportion of shared allelesgl.propShared
Randomly changes the allocation of 0's and 2's in a genlight objectgl.random.snp
Reads SNP data from a csv file into a genlight objectgl.read.csv
Imports DArT data into dartR and converts it into a genlight objectgl.read.dart
Reads FASTA files and converts them to genlight objectgl.read.fasta
Imports presence/absence data from SilicoDArT to genlight {agegenet} format (ploidy=1)gl.read.silicodart
Converts a vcf file into a genlight objectgl.read.vcf
Assigns an individual metric as pop in a genlight {adegenet} objectgl.reassign.pop
Recalculates locus metrics when individuals or populations are deleted from a genlight {adegenet} objectgl.recalc.metrics
Recodes individual (=specimen = sample) labels in a genlight objectgl.recode.ind
Recodes population assignments in a genlight objectgl.recode.pop
Renames a population in a genlight objectgl.rename.pop
Reports summary of base pair frequenciesgl.report.bases
Reports summary of Call Rate for loci or individualsgl.report.callrate
Calculates diversity indexes for SNPsgl.report.diversity
Calculates the pairwise Hamming distance between DArT trimmed DNA sequencesgl.report.hamming
Reports observed, expected and unbiased heterozygosities and FIS (inbreeding coefficient) by population or by individual from SNP datagl.report.heterozygosity
Reports departure from Hardy-Weinberg proportionsgl.report.hwe
Calculates pairwise population based Linkage Disequilibrium across all loci using the specified number of coresgl.report.ld
Calculates pairwise linkage disequilibrium by populationgl.report.ld.map
Reports summary of the slot $other$loc.metricsgl.report.locmetric
Reports minor allele frequency (MAF) for each locus in a SNP datasetgl.report.maf
Reports monomorphic locigl.report.monomorphs
Reports loci for which the SNP has been trimmed from the sequence tag along with the adaptorgl.report.overshoot
Reports private alleles (and fixed alleles) per pair of populationsgl.report.pa
Identifies putative parent offspring within a populationgl.report.parent.offspring
Reports summary of Read Depth for each locusgl.report.rdepth
Reports summary of RepAvg (repeatability averaged over both alleles for each locus) or reproducibility (repeatability of the scores for fragment presence/absence)gl.report.reproducibility
Reports loci containing secondary SNPs in sequence tags and calculates number of invariant sitesgl.report.secondaries
Identifies loci that are sex linkedgl.report.sexlinked
Reports summary of sequence tag length across locigl.report.taglength
Runs a STRUCTURE analysis using a genlight objectgl.run.structure
Samples individuals from populationsgl.sample
Saves an object in compressed binary format for later rapid retrievalgl.save
Selects colors from one of several palettes and output as a vectorgl.select.colors
Selects shapes from the base R shape palette and outputs as a vectorgl.select.shapes
Sets the default verbosity levelgl.set.verbosity
Creates a site frequency spectrum based on a dartR or genlight objectgl.sfs
Creates a dispersal file as input for the function gl.sim.WF.rungl.sim.create_dispersal
Simulates emigration between populationsgl.sim.emigration
Simulates individuals based on the allele frequencies provided via a genlight object.gl.sim.ind
Simulates mutations within a genlight objectgl.sim.mutate
Simulates a specified number of offspring based on alleles provided by potential father(s) and mother(s)gl.sim.offspring
Runs Wright-Fisher simulationsgl.sim.WF.run
Creates the reference table for running gl.sim.WF.rungl.sim.WF.table
Smear plot of SNP or presence/absence (SilicoDArT) datagl.smearplot
re-sorts genlight objectsgl.sort
Spatial autocorrelation following Smouse and Peakall 1999gl.spatial.autoCorr
Subsamples n loci from a genlight object and return it as a genlight objectgl.subsample.loci
Tests the difference in heterozygosity between populations taken pairwisegl.test.heterozygosity
Outputs an nj tree to summarize genetic similarity among populationsgl.tree.nj
Writes out data from a genlight object to csv filegl.write.csv
Converts a genlight object into a format suitable for input to Bayescangl2bayescan
Converts a genlight object into a format suitable for input to the BPP programgl2bpp
Creates a dataframe suitable for input to package {Demerelate} from a genlight {adegenet} objectgl2demerelate
Converts a genlight object into eigenstrat formatgl2eigenstrat
Concatenates DArT trimmed sequences and outputs a FASTA filegl2fasta
Converts a genlight object into faststructure format (to run faststructure elsewhere)gl2faststructure
Converts a genlight object into gds formatgl2gds
Converts a genlight object into a format suitable for input to genalexgl2genalex
Converts a genlight object into genepop format (and file)gl2genepop
Converts a genlight object to geno format from package LEAgl2geno
Converts a genlight object to genind objectgl2gi
Converts a genlight objects into hiphop formatgl2hiphop
Creates a Phylip input distance matrix from a genlight (SNP) {adegenet} objectgl2phylip
Converts a genlight object into PLINK formatgl2plink
Converts a genlight object to format suitable to be run with Coancestrygl2related
Converts genlight objects to the format used in the SNPassoc packagegl2sa
Converts a genlight object into a sfs input filegl2sfs
Converts a genlight object to ESRI shapefiles or kml filesgl2shp
Converts a genlight object to nexus format suitable for phylogenetic analysis by SNAPP (via BEAUti)gl2snapp
Converts a genlight object to STRUCTURE formatted filesgl2structure
Converts a genlight object to nexus format PAUP SVDquartetsgl2svdquartets
Converts a genlight object to a treemix input filegl2treemix
Converts a genlight object into vcf formatgl2vcf
Shiny app for the input of the reference table for the simulationsinteractive_reference
Shiny app for the input of the simulations variablesinteractive_sim_run
Tests if two populations are fixed at a given locusis.fixed
Example data set as text file to be imported into a genlight objectplaty
A simulated genlight object created to run a landscape genetic examplepossums.gl
adjust rbind for dartRrbind.dartR
Metadata file. Can be integrated via the dart2genlight function.testset_metadata
Recode file to be used with the function.testset_pop_recode
Testfile in DArT format (as provided by DArT)testset_SNPs_2Row
A genlight object created via the gl.read.dart functiontestset.gl
A genlight object created via the gl.read.silicodart functiontestset.gs
dartR themetheme_dartR
Population assignment probabilitiesutils.assignment
Population assignment probabilitiesutils.assignment_2
Population assignment probabilitiesutils.assignment_3
Population assignment probabilitiesutils.assignment_4
Calculates mean observed heterozygosity, mean expected heterozygosity and Fis per locus, per population and various population differentiation measuresutils.basic.stats
Utility function to check the class of an object passed to a functionutils.check.datatype
Converts DarT to genlightutils.dart2genlight
Calculates a distance matrix for individuals defined in a dartR genlight object using binary P/A data (SilicoDArT)utils.dist.binary
Calculates a distance matrix for individuals defined in a dartR genlight object using SNP data (DArTseq)utils.dist.ind.snp
A utility script to flag the start of a scriptutils.flag.start
Calculates the Hamming distance between two DArT trimmed DNA sequencesutils.hamming
Calculates expected mean expected heterozygosity per populationutils.het.pop
Conducts jackknife resampling using a genlight objectutils.jackknife
A utility script to calculate the number of variant and invariant sites by locusutils.n.var.invariant
OutFLANK: An Fst outlier approach by Mike Whitlock and Katie Lotterhos, University of British Columbia.utils.outflank
Creates OutFLANK input file from individual genotype info.utils.outflank.MakeDiploidFSTMat
Plotting functions for Fst distributions after OutFLANKutils.outflank.plotter
Imports DarT data to Rutils.read.dart
A utility script to recalculate the OneRatioRef, OneRatioSnp, PICRef, PICSnp, and AvgPIC by locus after some individuals or populations have been deleted.utils.recalc.avgpic
A utility script to recalculate the callrate by locus after some populations have been deletedutils.recalc.callrate
A utility script to recalculate the frequency of the heterozygous SNPs by locus after some populations have been deletedutils.recalc.freqhets
A utility script to recalculate the frequency of the homozygous reference SNP by locus after some populations have been deletedutils.recalc.freqhomref
A utility script to recalculate the frequency of the homozygous alternate SNP by locus after some populations have been deletedutils.recalc.freqhomsnp
A utility script to recalculate the minor allele frequency by locus, typically after some populations have been deletedutils.recalc.maf
A utility script to reset to FALSE (or TRUE) the locus metric flags after some individuals or populations have been deleted.utils.reset.flags
Spatial autocorrelation coefficient calculationsutils.spautocor
Util function for evanno plotsutils.structure.evanno
structure util functionsutils.structure.genind2gtypes
Utility function to run Structureutils.structure.run
Setting up the packagezzz