View source: R/msc.similarity.R
msc.similarity | R Documentation |
The function msc.similarity returns a measure of minicircle sequence composition within and between groups of samples. Specifically, it estimates the absolute and relative number of Minicircle Sequence Classes (MSCs) that are unique to each group or shared between two or more groups. The function returns tables and barplots that summarize the number of unique or shared MSCs for each minimum percent identity (MPI) separately or combined over all MPIs.
msc.similarity(clustmatrices, samples, groups)
clustmatrices |
a list of cluster matrices. |
samples |
a vector containing the names of the samples. This can include all samples or it can be a subset. |
groups |
a vector, of equal length as samples, specifying to which group (e.g. species) the samples belong to. |
absfreq |
a list per percent identity containing absolute frequency values of shared and unique MSCs. |
absfreq.plot |
a list of barplots visualizing previous results. |
relfreq |
a list per percent identity containing relative frequency values of shared and unique MSCs. |
relfreq.plot |
one barplot visualizing previous results. |
require(viridis)
data(matrices)
data(exData)
### run function
sim <- msc.similarity(matrices, samples = exData$samples,
groups = exData$species)
### visualize results (absolute frequencies)
barplot(sim$absfreq$id93)
### adjust plot (relative frequencies)
sim$relfreq.plot + scale_fill_viridis(discrete = TRUE)
sim$relfreq$id97["2"]*100
sim$relfreq$id97["3"]*100
### reduce number of groups
groups <- exData$species
levels(groups)[levels(groups)!='hybrid'] <- "non-hybrid"
sim.red <- msc.similarity(matrices, samples = exData$samples, groups = groups)
sim.red$relfreq.plot + scale_fill_viridis(discrete = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.