Learn R Programming

LymphoSeq (version 1.0.2)

bhattacharyyaCoefficient: Bhattacharyya coefficient

Description

Calculates the Bhattacharyya coefficient of two samples.

Usage

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

Run this code
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[["TCRB_Day32_Unsorted"]], 
   productive.aa[["TCRB_Day83_Unsorted"]])

Run the code above in your browser using DataLab