commonSeqsPlot: Common sequences plot

Description Usage Arguments Details Value See Also Examples

View source: R/commonSeqsPlot.R

Description

Creates a scatter plot of just the sequences in common between two samples.

Usage

1
commonSeqsPlot(sample1, sample2, productive.aa, show = "common")

Arguments

sample1

A name of a sample in a list of data frames generated by the LymphoSeq function productiveSeq.

sample2

A name of a sample in a list of data frames generated by the LymphoSeq function productiveSeq.

productive.aa

A list of data frames of productive amino acid sequences produced by the LymphoSeq function productiveSeq containing the samples to be compared.

show

A character vector specifying whether only the common sequences should be shown or all sequences. Available options are "common" or "all".

Details

The plot is made using the package ggplot2 and can be reformatted using ggplot2 functions. See examples below.

Value

Returns a frequency scatter plot of two samples showing only the shared sequences.

See Also

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/).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
file.path <- system.file("extdata", "TCRB_sequencing", package = "LymphoSeq")

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

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

commonSeqsPlot("TRB_Unsorted_32", "TRB_Unsorted_83", 
   productive.aa = productive.aa)

# Change the X and Y axises to log-10 scale
commonSeqsPlot("TRB_Unsorted_32", "TRB_Unsorted_83", 
   productive.aa = productive.aa) +
   ggplot2::scale_x_log10() + 
   ggplot2::scale_y_log10() + 
   ggplot2::annotation_logticks(sides = "bl")

Example output

Loading required package: LymphoSeqDB

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

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

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