pairwisePlot | R Documentation |
Creates a heat map from a Bhattacharyya, Similarity, Sorensen, or PSI matrix.
pairwisePlot(matrix)
matrix |
A Bhattacharyya, Similarity, Sorensen, or PSI matrix produced by the LymphoSeq2 scoringMatrix function. |
The plot is made using the package ggplot2 and can be reformatted using ggplot2 functions. See examples below.
A pairwise comparison heat map.
An excellent resource for examples on how to reformat a ggplot can
be found in the R Graphics Cookbook online (http://www.cookbook-r.com/Graphs/).
The functions to create the similarity or Bhattacharyya matrix can be found
here: similarityMatrix
and bhattacharyyaMatrix
file_path <- system.file("extdata", "TCRB_sequencing", package = "LymphoSeq2") stable <- readImmunoSeq(path = file_path) atable <- productiveSeq(stable, aggregate = "junction_aa") similarity_matrix <- scoringMatrix(productive_table = atable, mode="Similarity") pairwisePlot(matrix = similarity_matrix) bhattacharyya_matrix <- scoringMatrix(productive_table = atable, mode="Bhattacharyya") pairwisePlot(matrix = bhattacharyya_matrix) # Change plot color, title legend, and add title pairwisePlot(matrix = similarity_matrix) + ggplot2::scale_fill_gradient(low = "#deebf7", high = "#3182bd") + ggplot2::labs(fill = "Similarity score") + ggplot2::ggtitle("Figure Title")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.