Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

gl.report.bases

Summary of base pair frequencies


Description

This script calculates the frequencies of the four bases, and the frequency of transitions and transversions in a DArT genlight object.

Usage

gl.report.bases(x, plot = TRUE, verbose = NULL)

Arguments

x

– name of the genlight object containing the SNP or presence/absence data [required]

plot

– if TRUE, histograms of base composition are produced [default TRUE]

verbose

– verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log ; 3, progress and results summary; 5, full report [default 2 or as specified using gl.set.verbosity]

Details

The script checks if trimmed sequences are included in the locus metadata, and if so, tallies up the numbers of A,T,G and C bases. Only the reference state at the SNP locus is counted. Counts of transitions and transversions assume that there is no directionality, that is C>T is the same as T>C, because the reference state is arbitrary.

For presence/absence data (SilicoDArT), it is not possible to count transitions and tranversions or tv/ts ratio because the SNP data is not available, only a single sequence tag.

Value

returns a matrix containing the percent frequencies of each base (A,C,T,G) and the transition and transversion frequencies.

returns a named vector of base frequencies and the transversion and transitions. I also returns the plot as an ggplot object, which can be further customised. See example.

Author(s)

Arthur Georges (Post to https://groups.google.com/d/forum/dartr)

Examples

# SNP data
  out <- gl.report.bases(testset.gl)
  out$freq
  out$plotbases
  out$plottvts
# Tag P/A data
  out <- gl.report.bases(testset.gs)
  out

dartR

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

v1.9.6
GPL-2
Authors
Bernd Gruber [aut, cre], Arthur Georges [aut], Jose L. Mijangos [aut], Peter J. Unmack [ctb], Oliver Berry [ctb], Lindsay V. Clark [ctb], Floriaan Devloo-Delva [ctb]
Initial release
2021-04-29

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.