Skip to contents

This function assesses pairwise repertoire dissimilarities using a specific dissimilarity method.

It calculates a list of dissimilarity indices, each taking into account different parameters. The proposed methods include:

The Jaccard similarity: a measure of similarity between sample sets defined as the size of the intersection divided by the size of the union of the sample sets.

The Morisita-Horn similarity: a measure of similarity that tends to be over-sensitive to abundant species.

Usage

CalcDissimilarity(
  x,
  level = c("aaClone", "ntClone", "V", "J", "VJ", "ntCDR3", "aaCDR3"),
  method = c("manhattan", "euclidean", "canberra", "clark", "bray", "kulczynski",
    "jaccard", "gower", "altGower", "morisita", "horn", "mountford", "raup", "binomial",
    "chao", "cao", "mahalanobis"),
  binary = FALSE
)

Arguments

x

an object of class RepSeqExperiment

level

a character specifying the level of the repertoire on which the indices are computed. Should be one of "aaClone","ntClone", "V", "J", "VJ", "ntCDR3" or "aaCDR3".

method

a character specifying the distance method to be computed. Should be one of the following: "manhattan", "euclidean", "canberra", "clark", "bray", "kulczynski", "jaccard", "gower", "altGower", "morisita", "horn", "mountford", "raup", "binomial", "chao", "cao", "mahalanobis."

binary

a boolean indicating whether or not to transform the data into a presence/absence data. Default is FALSE

Details

Details on the calculated indices can be found in the vegan package: https://www.rdocumentation.org/packages/vegan/versions/2.4-2/topics/vegdist

Examples



CalcDissimilarity(x = RepSeqData, 
                  level = "V", method = "jaccard" )
#>                tripod-30-813 tripod-30-815 tripod-31-846 tripod-31-848
#> tripod-30-813      0.0000000    0.33363625     0.5463870    0.35924955
#> tripod-30-815      0.3336363    0.00000000     0.3250372    0.07883753
#> tripod-31-846      0.5463870    0.32503723     0.0000000    0.30055411
#> tripod-31-848      0.3592496    0.07883753     0.3005541    0.00000000
#> tripod-35-970      0.5862839    0.38544553     0.1678604    0.36615773
#> tripod-35-972      0.5933492    0.39541961     0.2107167    0.37323187
#> tripod-36-1003     0.4719296    0.21541907     0.1899473    0.19943418
#> tripod-36-1005     0.6597488    0.49391196     0.2687513    0.47486503
#>                tripod-35-970 tripod-35-972 tripod-36-1003 tripod-36-1005
#> tripod-30-813      0.5862839     0.5933492      0.4719296      0.6597488
#> tripod-30-815      0.3854455     0.3954196      0.2154191      0.4939120
#> tripod-31-846      0.1678604     0.2107167      0.1899473      0.2687513
#> tripod-31-848      0.3661577     0.3732319      0.1994342      0.4748650
#> tripod-35-970      0.0000000     0.2432651      0.2628019      0.2191123
#> tripod-35-972      0.2432651     0.0000000      0.2485693      0.2585902
#> tripod-36-1003     0.2628019     0.2485693      0.0000000      0.3601864
#> tripod-36-1005     0.2191123     0.2585902      0.3601864      0.0000000