Last data update: 2014.03.03

R: Bhattacharyya matrix
bhattacharyyaMatrixR Documentation

Bhattacharyya matrix

Description

Calculates the Bhattacharyya coefficient of all pairwise comparison from a list of data frames.

Usage

bhattacharyyaMatrix(productive.seqs)

Arguments

productive.seqs

A list data frames of productive sequences generated by the LymphoSeq function productiveSeq. "frequencyCount" and "aminoAcid" are a required columns.

Value

A data frame of Bhattacharyya coefficients calculated from all pairwise comparisons from a list of sample data frames. The Bhattacharyya coefficient is 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

pairwisePlot for plotting results as a heat map.

Examples

file.path <- system.file("extdata", "TCRB_sequencing", package = "LymphoSeq")

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

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

bhattacharyyaMatrix(productive.seqs = productive.aa)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(LymphoSeq)
Loading required package: LymphoSeqDB
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/LymphoSeq/bhattacharyyaMatrix.Rd_%03d_medium.png", width=480, height=480)
> ### Name: bhattacharyyaMatrix
> ### Title: Bhattacharyya matrix
> ### Aliases: bhattacharyyaMatrix
> 
> ### ** Examples
> 
> file.path <- system.file("extdata", "TCRB_sequencing", package = "LymphoSeq")
> 
> file.list <- readImmunoSeq(path = file.path)
   |                                                                               |                                                                      |   0%   |                                                                               |======                                                                |   9%   |                                                                               |=============                                                         |  18%   |                                                                               |===================                                                   |  27%   |                                                                               |=========================                                             |  36%   |                                                                               |================================                                      |  45%   |                                                                               |======================================                                |  55%   |                                                                               |=============================================                         |  64%   |                                                                               |===================================================                   |  73%   |                                                                               |=========================================================             |  82%   |                                                                               |================================================================      |  91%   |                                                                               |======================================================================| 100%
> 
> productive.aa <- productiveSeq(file.list, aggregate = "aminoAcid")
   |                                                                               |                                                                      |   0%   |                                                                               |======                                                                |   9%   |                                                                               |=============                                                         |  18%   |                                                                               |===================                                                   |  27%   |                                                                               |=========================                                             |  36%   |                                                                               |================================                                      |  45%   |                                                                               |======================================                                |  55%   |                                                                               |=============================================                         |  64%   |                                                                               |===================================================                   |  73%   |                                                                               |=========================================================             |  82%   |                                                                               |================================================================      |  91%   |                                                                               |======================================================================| 100%
> 
> bhattacharyyaMatrix(productive.seqs = productive.aa)
                      TCRB_Day1320_Unsorted TCRB_Day949_Unsorted
TCRB_Day1320_Unsorted            1.00000000           0.88013589
TCRB_Day949_Unsorted             0.88013589           1.00000000
TCRB_Day369_Unsorted             0.84210238           0.77225070
TCRB_Day1320_CD8_CMV             0.46204244           0.39421126
TCRB_Day83_Unsorted              0.62582845           0.58334619
TCRB_Day369_CD8_CMV              0.79605192           0.72972153
TCRB_Day32_Unsorted              0.32118959           0.27850843
TCRB_Day83_CD8_CMV               0.42168018           0.40854427
TCRB_Day0_Unsorted               0.01700697           0.01416233
TCRB_Day949_CD8                  0.81836252           0.81470456
TCRB_Day949_CD4                  0.44279429           0.42687836
                      TCRB_Day369_Unsorted TCRB_Day1320_CD8_CMV
TCRB_Day1320_Unsorted           0.84210238          0.462042437
TCRB_Day949_Unsorted            0.77225070          0.394211257
TCRB_Day369_Unsorted            1.00000000          0.435165772
TCRB_Day1320_CD8_CMV            0.43516577          1.000000000
TCRB_Day83_Unsorted             0.67953684          0.295356983
TCRB_Day369_CD8_CMV             0.82116105          0.482124408
TCRB_Day32_Unsorted             0.29995125          0.082152082
TCRB_Day83_CD8_CMV              0.44969014          0.113824462
TCRB_Day0_Unsorted              0.02196738          0.005328006
TCRB_Day949_CD8                 0.78877245          0.473735619
TCRB_Day949_CD4                 0.25231726          0.000000000
                      TCRB_Day83_Unsorted TCRB_Day369_CD8_CMV
TCRB_Day1320_Unsorted          0.62582845        0.7960519242
TCRB_Day949_Unsorted           0.58334619        0.7297215291
TCRB_Day369_Unsorted           0.67953684        0.8211610507
TCRB_Day1320_CD8_CMV           0.29535698        0.4821244077
TCRB_Day83_Unsorted            1.00000000        0.7060852420
TCRB_Day369_CD8_CMV            0.70608524        1.0000000000
TCRB_Day32_Unsorted            0.34304097        0.2754388006
TCRB_Day83_CD8_CMV             0.50422265        0.5072677597
TCRB_Day0_Unsorted             0.01058337        0.0088291544
TCRB_Day949_CD8                0.70092154        0.8841136749
TCRB_Day949_CD4                0.06984370        0.0007011302
                      TCRB_Day32_Unsorted TCRB_Day83_CD8_CMV TCRB_Day0_Unsorted
TCRB_Day1320_Unsorted         0.321189585         0.42168018        0.017006967
TCRB_Day949_Unsorted          0.278508431         0.40854427        0.014162333
TCRB_Day369_Unsorted          0.299951246         0.44969014        0.021967375
TCRB_Day1320_CD8_CMV          0.082152082         0.11382446        0.005328006
TCRB_Day83_Unsorted           0.343040971         0.50422265        0.010583367
TCRB_Day369_CD8_CMV           0.275438801         0.50726776        0.008829154
TCRB_Day32_Unsorted           1.000000000         0.14433344        0.008706795
TCRB_Day83_CD8_CMV            0.144333442         1.00000000        0.034586943
TCRB_Day0_Unsorted            0.008706795         0.03458694        1.000000000
TCRB_Day949_CD8               0.350076032         0.49596590        0.042637306
TCRB_Day949_CD4               0.024451859         0.00000000        0.006903870
                      TCRB_Day949_CD8 TCRB_Day949_CD4
TCRB_Day1320_Unsorted      0.81836252    0.4427942871
TCRB_Day949_Unsorted       0.81470456    0.4268783551
TCRB_Day369_Unsorted       0.78877245    0.2523172648
TCRB_Day1320_CD8_CMV       0.47373562    0.0000000000
TCRB_Day83_Unsorted        0.70092154    0.0698437032
TCRB_Day369_CD8_CMV        0.88411367    0.0007011302
TCRB_Day32_Unsorted        0.35007603    0.0244518587
TCRB_Day83_CD8_CMV         0.49596590    0.0000000000
TCRB_Day0_Unsorted         0.04263731    0.0069038699
TCRB_Day949_CD8            1.00000000    0.0000000000
TCRB_Day949_CD4            0.00000000    1.0000000000
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>