plotDensityThreshold - Plot findThreshold results for the density method
Description¶
plotDensityThreshold plots the results from "density" method of
findThreshold, including the smoothed density estimate, input nearest neighbor
distance histogram, and threshold selected.
Usage¶
plotDensityThreshold(
data,
cross = NULL,
xmin = NULL,
xmax = NULL,
breaks = NULL,
binwidth = NULL,
title = NULL,
size = 1,
silent = FALSE,
...
)
Arguments¶
- data
- DensityThreshold object output by the
"density"method of findThreshold. - cross
- numeric vector of distances from distToNearest to draw as a
histogram below the
datahistogram for comparison purposes. - xmin
- minimum limit for plotting the x-axis. If
NULLthe limit will be set automatically. - xmax
- maximum limit for plotting the x-axis. If
NULLthe limit will be set automatically. - breaks
- number of breaks to show on the x-axis. If
NULLthe breaks will be set automatically. - binwidth
- binwidth for the histogram. If
NULLthe binwidth will be set automatically to the bandwidth parameter determined by findThreshold. - title
- string defining the plot title.
- size
- numeric value for the plot line sizes.
- silent
- if
TRUEdo not draw the plot and just return the ggplot2 object; ifFALSEdraw the plot. - …
- additional arguments to pass to ggplot2::theme.
Value¶
A ggplot object defining the plot.
Examples¶
# Subset example data to one sample as a demo
data(ExampleDb, package="alakazam")
db <- subset(ExampleDb, sample_id == "-1h")
# Use nucleotide Hamming distance and normalize by junction length
db <- distToNearest(db, sequenceColumn="junction", vCallColumn="v_call_genotyped",
jCallColumn="j_call", model="ham", normalize="len", nproc=1)
Running in non-single-cell mode.
# To find the threshold cut, call findThreshold function for "gmm" method.
output <- findThreshold(db$dist_nearest, method="density")
print(output)
[1] NA
# Plot
plotDensityThreshold(output)

See also¶
See DensityThreshold for the the input object definition and findThreshold for generating the input object. See distToNearest calculating nearest neighbor distances.