This script calculates the frequencies of the four DNA nucleotide bases: adenine (A), cytosine (C), 'guanine (G) and thymine (T), and the frequency of transitions (Ts) and transversions (Tv) in a DArT genlight object.
gl.report.bases(
x,
plot.out = TRUE,
plot_theme = theme_dartR(),
plot_colors = two_colors,
save2tmp = FALSE,
verbose = NULL
)
Name of the genlight object containing the SNP or presence/absence (SilicoDArT) data [required].
If TRUE, histograms of base composition are produced [default TRUE].
Theme for the plot. See Details for options [default theme_dartR()].
List of two color names for the borders and fill of the plots [default two_colors].
If TRUE, saves any ggplots and listings to the session temporary directory (tempdir) [default FALSE]
Verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log; 3, progress and results summary; 5, full report [default NULL, unless specified using gl.set.verbosity]
The unchanged genlight object
The script checks first if trimmed sequences are included in the locus metadata (@other$loc.metrics$TrimmedSequence), 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 (Ts) and transversions (Tv) 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 transversions or transitions or transversions/transitions ratio because the SNP data is not available, only a single sequence tag.
Examples of other themes that can be used can be consulted in
Other reporting functions:
gl.diagnostics.hwe()
,
gl.report.diversity()
,
gl.report.heterozygosity()
,
gl.report.parent.offspring()
,
gl.report.pa()
,
gl.report.sexlinked()
# NOT RUN {
# SNP data
out <- gl.report.bases(testset.gl)
#' # Tag P/A data
out <- gl.report.bases(testset.gs)
# }
Run the code above in your browser using DataLab