Summary of base pair frequencies
This script calculates the frequencies of the four bases, and the frequency of transitions and transversions in a DArT genlight object.
gl.report.bases(x, plot = TRUE, verbose = NULL)
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] |
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.
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.
Arthur Georges (Post to https://groups.google.com/d/forum/dartr)
# 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
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.