Spectratype plot.

Share:

Description

General function for making a spectratyping plots.

Usage

1
2
3
4
spectratyping(.data, .column = "VD.insertions", .by.alphabet = "Vb",
  .do.legend = T, .draw.only.legend = F, .legend.ncol = -1, .nrow = 2,
  .by.col = "", .sum.col = "Percentage", .other = F, .log = F,
  .verbose = T)

Arguments

.data

mitcr List with data frames.

.column

Character vector with name of the column with numeric characteristic.

.by.alphabet

Either 'Va/b', 'Ja/b' or an alphabet.

.do.legend

if T then plot a legend.

.draw.only.legend

if T then plot only a legend without plots.

.legend.ncol

Number of columns in the legend. If -1 than function will try to predict number of columns.

.nrow

Rows of grid of plots.

.by.col

Character vector with name of the column by which divide the given data frames.

.sum.col

Which column use for sum.

.other

if T then include in the result plot values which isn't in the given alphabet.

.log

if T then scale y-axis by log10.

.verbose

if T then print messages about state of the process.

Details

For each element in .data do: for each factor in .by.col which is in .by.alphabet, compute histogram of .column and then plot stacked histogram of distributions of .by.col for each factor.

Value

ggplot object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
# Spectratyping of distribution of length of CDR3 nucleotide sequences
# by V-beta-segments.
immdata <- lapply(immdata, function (x) { 
             x$Length <- nchar(x$CDR3.nucleotide.sequence)
             x
           } )
spectratyping(immdata, 'Length', 'Vb')
# Spectratyping of distribution of Total insertions
# by J-beta-segments.
spectratyping(immdata, 'Total.insertions', 'Jb')

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.