Description Usage Arguments Value Examples
View source: R/msc.similarity.R
The msc.similarity function allows you to check the absolute and relative frequency of shared and unique MSC between different groups across different percent identities.
1 | 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. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 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.