msc.similarity: Minicircle Sequence Cluster similarity

Description Usage Arguments Value Examples

View source: R/msc.similarity.R

Description

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.

Usage

1
msc.similarity(clustmatrices, samples, groups)

Arguments

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.

Value

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.

Examples

 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)

rKOMICS documentation built on July 21, 2021, 5:07 p.m.