bhattacharyyaCoefficient: Bhattacharyya coefficient

Description Usage Arguments Value See Also Examples

View source: R/bhattacharyyaCoefficient.R

Description

Calculates the Bhattacharyya coefficient of two samples.

Usage

1
bhattacharyyaCoefficient(sample1, sample2)

Arguments

sample1

A data frame consisting of frequencies of antigen receptor sequences. "frequencyCount" is a required column.

sample2

A data frame consisting of frequencies of antigen receptor sequences. "frequencyCount" is a required column.

Value

Returns the Bhattacharyya coefficient, a measure of the amount of overlap between two samples. The value ranges from 0 to 1 where 1 indicates the sequence frequencies are identical in the two samples and 0 indicates no shared frequencies.

See Also

bhattacharyyaMatrix

Examples

1
2
3
4
5
6
7
8
file.path <- system.file("extdata", "TCRB_sequencing", package = "LymphoSeq")

file.list <- readImmunoSeq(path = file.path)

productive.aa <- productiveSeq(file.list, aggregate = "aminoAcid")

bhattacharyyaCoefficient(productive.aa[["TRB_Unsorted_32"]], 
   productive.aa[["TRB_Unsorted_83"]])

Example output

Loading required package: LymphoSeqDB
sh: 1: wc: Permission denied
sh: 1: cannot create /dev/null: Permission denied
Could not detect number of cores, defaulting to 1.

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |=====================                                                 |  30%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |=================================================                     |  70%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |======================================================================| 100%

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |=====================                                                 |  30%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |=================================================                     |  70%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |======================================================================| 100%
[1] 0.2978656

LymphoSeq documentation built on Nov. 8, 2020, 8:09 p.m.