Draw an N Content Plot across one or more FastQC reports
plotNContent(x, usePlotly = FALSE, labels, pattern = ".(fast|fq|bam).*", ...)
# S4 method for class 'ANY'
plotNContent(x, usePlotly = FALSE, labels, pattern = ".(fast|fq|bam).*", ...)
# S4 method for class 'FastqcData'
plotNContent(
x,
usePlotly = FALSE,
labels,
pattern = ".(fast|fq|bam).*",
pwfCols,
warn = 5,
fail = 20,
showPwf = TRUE,
...,
lineCol = "red"
)
# S4 method for class 'FastqcDataList'
plotNContent(
x,
usePlotly = FALSE,
labels,
pattern = ".(fast|fq|bam).*",
pwfCols,
warn = 5,
fail = 20,
showPwf = TRUE,
cluster = FALSE,
dendrogram = FALSE,
heat_w = 8,
scaleFill = NULL,
...
)
# S4 method for class 'FastpData'
plotNContent(
x,
usePlotly = FALSE,
labels,
pattern = ".(fast|fq|bam).*",
module = c("Before_filtering", "After_filtering"),
moduleBy = c("facet", "colour", "linetype"),
reads = c("read1", "read2"),
readsBy = c("facet", "colour", "linetype"),
scaleColour = NULL,
scaleLine = NULL,
plotTheme = theme_get(),
plotlyLegend = FALSE,
...
)
# S4 method for class 'FastpDataList'
plotNContent(
x,
usePlotly = FALSE,
labels,
pattern = ".(fast|fq|bam).*",
module = c("Before_filtering", "After_filtering"),
reads = c("read1", "read2"),
scaleFill = NULL,
plotTheme = theme_get(),
cluster = FALSE,
dendrogram = FALSE,
heat_w = 8,
...
)
Can be a FastqcData
, FastqcDataList
or file paths
logical
. Output as ggplot2 (default) or plotly
object.
An optional named vector of labels for the file names. All filenames must be present in the names.
Regex used to trim the end of filenames
Used to pass additional attributes to theme() for FastqcData objects and to geom* calls for FastpData-based objects
Object of class PwfCols()
containing the colours
for PASS/WARN/FAIL
The default values for warn and fail are 5 and 10 respectively (i.e. percentages)
logical(1) Show the PASS/WARN/FAIL status
Line colours
logical
default FALSE
. If set to TRUE
,
fastqc data will be clustered using hierarchical clustering
logical
redundant if cluster
is FALSE
if both cluster
and dendrogram
are specified as TRUE
then the dendrogram will be displayed.
Relative width of any heatmap plot components
ggplot2 scale objects
Used for Fastp* structures to show results before or after filtering
How to show each module or set of reads on the plot
Show plots for read1, read2 or both.
theme object
logical(1) Show legend on interactive plots
A standard ggplot2 object, or an interactive plotly object
This extracts the N_Content from the supplied object and generates a ggplot2 object, with a set of minimal defaults. The output of this function can be further modified using the standard ggplot2 methods.
When x
is a single FastqcData object line plots will always be drawn
for all Ns.
Otherwise, users can select line plots or heatmaps.
## Using a Fastp Data object
fl <- system.file("extdata/fastp.json.gz", package = "ngsReports")
fp <- FastpData(fl)
plotNContent(fp)
plotNContent(
fp, pattern = "_001.+",
moduleBy = "colour", scaleColour = scale_colour_brewer(palette = "Set1"),
plotTheme = theme(
legend.position = 'inside', legend.position.inside = c(0.99, 0.99),
legend.justification = c(1, 1), plot.title = element_text(hjust = 0.5)
)
)