-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathClonalPositionalPlot.Rd
111 lines (95 loc) · 3.78 KB
/
ClonalPositionalPlot.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/clonalpositionalplot.R
\name{ClonalPositionalPlot}
\alias{ClonalPositionalPlot}
\title{ClonalPositionalPlot}
\usage{
ClonalPositionalPlot(
data,
chain = "TRB",
aa_length = 20,
group_by = "Sample",
group_by_sep = "_",
split_by = NULL,
method = c("AA", "shannon", "inv.simpson", "norm.entropy", "Atchley", "Kidera",
"stScales", "tScales", "VHSE"),
plot_type = c("bar", "line", "heatmap", "box", "violin"),
theme_args = list(),
xlab = NULL,
ylab = NULL,
facet_by = NULL,
facet_ncol = NULL,
facet_nrow = NULL,
aspect.ratio = NULL,
...
)
}
\arguments{
\item{data}{The product of \link[scRepertoire:combineTCR]{scRepertoire::combineTCR}, \link[scRepertoire:combineTCR]{scRepertoire::combineTCR}, or
\link[scRepertoire:combineExpression]{scRepertoire::combineExpression}.}
\item{chain}{The chain to be analyzed. Default is "TRB".}
\item{aa_length}{The length of the amino acid sequence. Default is 20.}
\item{group_by}{The variable to group the data by. Default is "Sample".}
\item{group_by_sep}{The separator to use when combining groupings. Default is "_".}
\item{split_by}{The variable to split the data by. Default is NULL.}
\item{method}{The method to calculate the positional entropy. Default is "AA".
\itemize{
\item "AA": Amino acid frequency.
\item "shannon": Shannon entropy.
\item "inv.simpson": Inverse Simpson index.
\item "norm.entropy": Normalized entropy.
\item "Atchley": Atchley factors.
\item "Kidera": Kidera factors.
\item "stScales": stScales factors.
\item "tScales": tScales factors.
\item "VHSE": Vectors of Hydrophobic, Steric, and Electronic properties.
See also \link[scRepertoire:percentAA]{scRepertoire::percentAA}, \link[scRepertoire:positionalEntropy]{scRepertoire::positionalEntropy} and
\link[scRepertoire:positionalProperty]{scRepertoire::positionalProperty}.
}}
\item{plot_type}{The type of plot to generate. Default is "bar".
\itemize{
\item "bar": Bar plot.
\item "line": Line plot.
\item "heatmap": Heatmap.
\item "box": Box plot.
\item "violin": Violin plot.
}}
\item{theme_args}{A list of arguments to be passed to the \link[ggplot2:theme]{ggplot2::theme} function.}
\item{xlab}{The x-axis label. Default is NULL.}
\item{ylab}{The y-axis label. Default is NULL.}
\item{facet_by}{A character vector of column names to facet the plots. Default is NULL.}
\item{facet_ncol}{The number of columns in the facet grid. Default is NULL.}
\item{facet_nrow}{The number of rows in the facet grid. Default is NULL.}
\item{aspect.ratio}{The aspect ratio of the plot. Default is NULL.}
\item{...}{Other arguments passed to the specific plot function.
\itemize{
\item For "bar", \code{\link[plotthis:barplot]{plotthis::BarPlot()}}.
\item For "line", \code{\link[plotthis:LinePlot]{plotthis::LinePlot()}}.
\item For "heatmap", \code{\link[plotthis:Heatmap]{plotthis::Heatmap()}}.
\item For "box", \code{\link[plotthis:boxviolinplot]{plotthis::BoxPlot()}}.
\item For "violin", \code{\link[plotthis:boxviolinplot]{plotthis::ViolinPlot()}}.
}}
}
\value{
A ggplot object or a list if \code{combine} is FALSE
}
\description{
Visualize the positional entropy, property or amino acid frequency of CDR3 sequences.
}
\examples{
\donttest{
set.seed(8525)
data(contig_list, package = "scRepertoire")
data <- scRepertoire::combineTCR(contig_list,
samples = c("P17B", "P17L", "P18B", "P18L", "P19B","P19L", "P20B", "P20L"))
data <- scRepertoire::addVariable(data,
variable.name = "Type",
variables = rep(c("B", "L"), 4)
)
ClonalPositionalPlot(data)
ClonalPositionalPlot(data, method = "shannon")
ClonalPositionalPlot(data, method = "norm.entropy", plot_type = "heatmap")
ClonalPositionalPlot(data, method = "Atchley", group_by = "Type", plot_type = "bar")
ClonalPositionalPlot(data, method = "Atchley", plot_type = "line")
}
}