Plot the insert size distribution from one of Fastp reports
plotInsertSize(x, usePlotly = FALSE, labels, pattern = ".(fast|fq|bam).*", ...)
# S4 method for class 'FastpData'
plotInsertSize(
x,
usePlotly = FALSE,
labels,
pattern = ".(fast|fq|bam).*",
plotType = c("histogram", "cumulative"),
counts = FALSE,
plotTheme = theme_get(),
expand.x = 0.01,
expand.y = c(0, 0.05),
...
)
# S4 method for class 'FastpDataList'
plotInsertSize(
x,
usePlotly = FALSE,
labels,
pattern = ".(fast|fq|bam).*",
plotType = c("heatmap", "line", "cumulative"),
plotTheme = theme_get(),
scaleFill = NULL,
scaleColour = NULL,
cluster = FALSE,
dendrogram = FALSE,
heat_w = 8,
...
)
A FastpData or FastpDataList object
logical
. Generate an interactive plot using plotly
An optional named vector of labels for the file names. All file names must be present in the names of the vector.
Regex to remove from the end of any filenames
Passed to geom*
functions during plotting
Determine the plot type. Options vary with the input structure
logical(1) Plot read counts, or percentages (default)
a theme object
Axis expansions
Continuous scale used to fill heatmap cells. Defaults to the "inferno" palette
Discrete scale for adding line colours
logical
default FALSE
. If set to TRUE
, data will be
clustered using hierarchical clustering
logical
redundant if cluster
is FALSE
if both cluster
and dendrogram
are specified as TRUE
the dendrogram
will be displayed.
Width of the heatmap relative to other plot components
A ggplot or plotly object
Takes a Fastp os a set of Fastp reports and plot insert size distributions. Plots can be drawn as cumulative totals or the default histograms for a single report, and as boxplots or heatmaps for a set of reports
# Get the files included with the package
packageDir <- system.file("extdata", package = "ngsReports")
fl <- list.files(packageDir, pattern = "fastp.json.gz", full.names = TRUE)
fp <- FastpData(fl)
plotInsertSize(
fp, counts = TRUE, fill = "steelblue4",
plotTheme = theme(plot.title = element_text(hjust = 0.5))
)
plotInsertSize(fp, plotType = "cumulative")