Date: 2026-04-28

# Rqc - Quality Control Tool for High-Throughput Sequencing Data

Welliton Souza1* and Benilton Carvalho1

1University of Campinas, Campinas, Brazil

*well309@gmail.com

#### 28 April 2026

#### Package

Rqc 1.46.0

# 1 Introduction

Rqc is an optimized tool designed for quality control and assessment of high-throughput sequencing data. It performs parallel processing of entire files and produces a report which contains a set of high-resolution graphics that can be used for quality assessment.

This version of Rqc produces high-quality images for the following statistics:

- Average Quality: this plot describes the average quality pattern by showing on the X-axis quality thresholds and on the Y-axis the percentage of reads that exceed that quality level.
- Cycle-specific Average Quality: this describes the average quality scores for each cycle of sequencing.
- Read Length Distribution: this is a barplot that presents the distribuition of the lengths of the reads available in the FASTQ file.
- Cycle-specific GC Content: a line plot showing the average GC content for every cycle of sequencing.
- Cycle-specific Quality Distribution: a bar plot showing the proportion of quality calls per cycle. Colors are presented in a gradient Red-Blue, where red identifies calls of lower quality. This visualization is preferred as it is cleaner than the boxplots described below.
- Cycle-specific Quality Distribution - Boxplots: boxplots describing empirical patterns of quality distribution on each cycle of sequencing.
- Cycle-specific Base Call Proportion: this bar plot describes the proportion of each nucleotide called for every cycle of sequencing.

## 1.1 Basic Workflow

The main goal of Rqc is to provide graphical tools for quality assessment of reads contained in FASTQ files. This package is designed focusing on simplicity of use. Therefore, the Rqc package allows the user to call one single function called `rqc`. The `rqc` method processes a set of input files and generates an HTML report containing several plots that can be used for quality assessment.

To access this functionality, the user needs to load Rqc package.

    library(Rqc)

The next step is to determine the location of the FASTQ files that should be analyzed. The example below, uses sample files provided by the ShortRead package, but the user must modify this location accordingly, in order to reflect the actual location of the files that need QA.

    folder <- system.file(package="ShortRead", "extdata/E-MTAB-1147")

The basic usage of the `rqc` function requires the definition of 2 arguments. One, `path`, is the location where the files of interest are saved at (this was defined on the step above). The other argument, `pattern`, is a regular expression that identifies all files of interest. Below, we use `.fastq.gz` to specify that all files containing that string are to be processed.

    rqc(path = folder, pattern = ".fastq.gz")

At this point, the user’s default Internet browser will open an HTML file. This file is the report generated by Rqc, which, by default, is stored in a temporary directory. A sample report is shown below:

# 2 Quality control report

## 2.1 File Information

This table describes input files. `reads` column can be total number of reads (`sample=FALSE`) or sample size.

    knitr::kable(perFileInformation(qa))

filename | pair | format | group | reads | total.reads | path
--- | --- | --- | --- | --- | --- | ---
ERR127302_1_subset.fastq.gz | 1 | FASTQ | None | 20000 | 20000 | /Library/Frameworks/R.framework/Versions/4.6/Resources/library/ShortRead/extdata/E-MTAB-1147
ERR127302_2_subset.fastq.gz | 2 | FASTQ | None | 20000 | 20000 | /Library/Frameworks/R.framework/Versions/4.6/Resources/library/ShortRead/extdata/E-MTAB-1147

## 2.2 Per Read Mean Quality Distribution of Files

This plot describe an overview of per read mean quality distribution of all files

    rqcReadQualityBoxPlot(qa)

    ## Warning: `aes_string()` was deprecated in ggplot2 3.0.0.
    ## ℹ Please use tidy evaluation idioms with `aes()`.
    ## ℹ See also `vignette("ggplot2-in-packages")` for more information.
    ## ℹ The deprecated feature was likely used in the Rqc package.
    ##   Please report the issue at <https://github.com/labbcb/Rqc/issues>.
    ## This warning is displayed once per session.
    ## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
    ## generated.

## 2.3 Average Quality

This plot describes the average quality pattern by showing on the X-axis quality thresholds and on the Y-axis the percentage of reads that exceed that quality level.

    rqcReadQualityPlot(qa)

## 2.4 Cycle-specific Average Quality

This describes the average quality scores for each cycle of sequencing.

    rqcCycleAverageQualityPlot(qa)

## 2.5 Read Frequency

This plot shows the proportion of reads that appeared many times.

    rqcReadFrequencyPlot(qa)

## 2.6 Heatmap of top represented reads

This heatmap plot shows dstance matrix between top represented reads. This functon only works with one result file (and not a list).

    rqcFileHeatmap(qa[[1]])

## 2.7 Read Length Distribution

Barplot that presents the distribuition of the lengths of the reads available in the FASTQ file.

    rqcReadWidthPlot(qa)

## 2.8 Cycle-specific GC Content

Line plot showing the average GC content for every cycle of sequencing.

    rqcCycleGCPlot(qa)

## 2.9 Cycle-specific Quality Distribution

Bar plot showing the proportion of quality calls per cycle. Colors are presented in a gradient Red-Blue, where red identifies calls of lower quality. This visualization is preferred as it is cleaner than the boxplots described below.

    rqcCycleQualityPlot(qa)

## 2.10 PCA Biplot (cycle-specific read average quality)

Biplot from Principal Component Analysis (PCA) of cycle-specific read average quality.

    rqcCycleAverageQualityPcaPlot(qa)

    ## Warning: `geom_hline()`: Ignoring `mapping` because `yintercept` was provided.

    ## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
    ## ℹ Please use `linewidth` instead.
    ## ℹ The deprecated feature was likely used in the Rqc package.
    ##   Please report the issue at <https://github.com/labbcb/Rqc/issues>.
    ## This warning is displayed once per session.
    ## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
    ## generated.

    ## Warning: `geom_vline()`: Ignoring `mapping` because `xintercept` was provided.

## 2.11 Cycle-specific Quality Distribution - Boxplot

Boxplots describing empirical patterns of quality distribution on each cycle of sequencing.

    rqcCycleQualityBoxPlot(qa)

## 2.12 Cycle-specific Base Call Proportion

This bar plot describes the proportion of each nucleotide called for every cycle of sequencing.

    rqcCycleBaseCallsPlot(qa)

The line plot shows a more detailed view.

    rqcCycleBaseCallsLinePlot(qa)

It is important to note that the `rqc` function samples 1 million records from the FASTQ files. This can be set by adjusting the `n` argument for this function. If the user desires to have the file processed as a whole (rather than sampling records from it), (s)he must set the argument `sample` to `FALSE`.

# 3 Advanced Workflow

The `rqc` function wraps a set of functions to generate a quick report that can be used for quality assessment. However, users can perform a step-by-step analysis by using the information described below.

## 3.1 Defining input files

If one wants to process a set of files that are not located at the same directory, the users needs to create a vector containing the absolute path of files. The `list.files` function can be useful.

    fastqDir <- system.file(package="ShortRead", "extdata/E-MTAB-1147")
    files <- list.files(fastqDir, "fastq.gz", full.names=TRUE)

The example input files are samples from a public data set. These samples are available through the ShortRead package. More information regarding these data can be found on the vignette of that package.

## 3.2 Processing files

To process the files without generating an HTML report, the user should use `rqcQA` function instead `rqc`. This function receives a vector containing the paths of the input files.

    qa <- rqcQA(files, workers=1)

The `rqcQA` function returns a list that contains the required information to create the plots present on the standard HTML report. Actually, both `rqc` and `rqcQA` return a named list of `RqcResultSet` objects. This output can be used directly as input to other Rqc package functions. Examples of functions that can use these objects are `rqcReport` and `plot`. `RqcResultSet` is a class that extends `.QA` class of ShortRead package. An `RqcResultSet` object contains information in two different perspectives: read-specific data and cycle-specific data. They can be accessed using `[[` brackets.

## 3.3 Generating report

To create a final HTML report, the user can apply the `rqcReport` function to the `qa` object.

    reportFile <- rqcReport(qa)
    browseURL(reportFile)

The report generated by `rqcReport` contains the all plots described on the beginning of this document. By default, it is written to a temporary directory. This behavior can by modified by setting the `outdir` argument.

# 4 Parallel processing

The Rqc package performs parallel processing of the samples by interfacing with the BiocParallel package. By default, Rqc calls `multicoreWorkers` function that returns the maximum number of workers available. You can change the number of cores setting `workers` parameter on `rqc` and `rqcQA` functions. It is possible to process the input files serially by setting `workers=1`.

# 5 Graphics

For each plot generated by Rqc, there is a function that shapes the data appropriately. The shaped information is then used to produce the final plot. The example below shows how the user can access these data to generate plots using other tools.

    df <- rqcCycleAverageQualityCalc(qa)
    cycle <- as.numeric(levels(df$cycle))[df$cycle]
    plot(cycle, df$quality, col = df$filename, xlab='Cycle', ylab='Quality Score')

One can also process a subset of result data using subsets of a list.

    sublist <- qa[1]
    rqcCycleQualityPlot(sublist)

# 6 Writing personalized quality control reports

Rqc package accepts R Markdown file format as template file for generating custom reports. Markdown is a markup language for web development. R Markdown files are regular Markdown files with R codes. Every chunk of code is executed during compilation done by knitr package. Knitr takes R Markdown file and generates Markdown file merged with R codes and their outputs such as text, tables and figures. Result Markdown file is used by Rqc for generating final report in HTML or PDF formats. The source file of Rqc’s default report is a good reference for writing new template reports. Run code below returns the system file path to this source file.

    system.file(package = "Rqc", "templates", "rqc_report.Rmd")

Basic concepts for writing Markdown documents with R code are available at http://rmarkdown.rstudio.com/. Advanced concepts about the compilation process of R Markdown files are available at http://yihui.name/knitr/. The Bioconductor project provides style guidelines for HTML documents at http://www.bioconductor.org/packages/release/bioc/vignettes/BiocStyle/inst/doc/HtmlStyle.html.

Rqc result data is available inside template files through `rqcResultSet` object. This object is a list of summarized statistics about input files and it is used by all accessor functions and plots provided by Rqc package. The `rqcReport` function takes template file path as argument and generates personalized reports.

    rqcReport(qa, templateFile = "custom_report.Rmd")

# 7 Final Considerations

The Rqc package provides a simple interface to generate plots often used for quality assessment of high-throughput sequencing data. It uses the standard Bioconductor parallelization framework to add efficiency to data processing. The images produced by the package are high-quality figures that can be directly used on publications.

# 8 Session Information

    ## R version 4.6.0 Patched (2026-04-24 r89963)
    ## Platform: aarch64-apple-darwin23
    ## Running under: macOS Tahoe 26.3.1
    ##
    ## Matrix products: default
    ## BLAS:   /Library/Frameworks/R.framework/Versions/4.6/Resources/lib/libRblas.0.dylib
    ## LAPACK: /Library/Frameworks/R.framework/Versions/4.6/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.1
    ##
    ## locale:
    ## [1] C/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
    ##
    ## time zone: America/New_York
    ## tzcode source: internal
    ##
    ## attached base packages:
    ## [1] stats4    stats     graphics  grDevices utils     datasets  methods
    ## [8] base
    ##
    ## other attached packages:
    ##  [1] Rqc_1.46.0                  ggplot2_4.0.3
    ##  [3] ShortRead_1.70.0            GenomicAlignments_1.48.0
    ##  [5] SummarizedExperiment_1.42.0 Biobase_2.72.0
    ##  [7] MatrixGenerics_1.24.0       matrixStats_1.5.0
    ##  [9] Rsamtools_2.28.0            GenomicRanges_1.64.0
    ## [11] Biostrings_2.80.0           Seqinfo_1.2.0
    ## [13] XVector_0.52.0              IRanges_2.46.0
    ## [15] S4Vectors_0.50.0            BiocGenerics_0.58.0
    ## [17] generics_0.1.4              BiocParallel_1.46.0
    ## [19] BiocStyle_2.40.0
    ##
    ## loaded via a namespace (and not attached):
    ##   [1] RColorBrewer_1.1-3       rstudioapi_0.18.0        jsonlite_2.0.0
    ##   [4] magrittr_2.0.5           magick_2.9.1             GenomicFeatures_1.64.0
    ##   [7] farver_2.1.2             rmarkdown_2.31           BiocIO_1.22.0
    ##  [10] vctrs_0.7.3              memoise_2.0.1            RCurl_1.98-1.18
    ##  [13] base64enc_0.1-6          tinytex_0.59             htmltools_0.5.9
    ##  [16] S4Arrays_1.12.0          curl_7.1.0               SparseArray_1.12.0
    ##  [19] Formula_1.2-5            sass_0.4.10              bslib_0.10.0
    ##  [22] htmlwidgets_1.6.4        plyr_1.8.9               cachem_1.1.0
    ##  [25] mime_0.13                lifecycle_1.0.5          pkgconfig_2.0.3
    ##  [28] Matrix_1.7-5             R6_2.6.1                 fastmap_1.2.0
    ##  [31] shiny_1.13.0             digest_0.6.39            colorspace_2.1-2
    ##  [34] AnnotationDbi_1.74.0     Hmisc_5.2-5              RSQLite_2.4.6
    ##  [37] hwriter_1.3.2.1          labeling_0.4.3           httr_1.4.8
    ##  [40] abind_1.4-8              compiler_4.6.0           bit64_4.8.0
    ##  [43] withr_3.0.2              htmlTable_2.5.0          S7_0.2.2
    ##  [46] backports_1.5.1          DBI_1.3.0                DelayedArray_0.38.0
    ##  [49] rjson_0.2.23             tools_4.6.0              foreign_0.8-91
    ##  [52] otel_0.2.0               httpuv_1.6.17            nnet_7.3-20
    ##  [55] glue_1.8.1               restfulr_0.0.16          promises_1.5.0
    ##  [58] grid_4.6.0               checkmate_2.3.4          cluster_2.1.8.2
    ##  [61] reshape2_1.4.5           gtable_0.3.6             BSgenome_1.80.0
    ##  [64] ensembldb_2.36.0         data.table_1.18.2.1      pillar_1.11.1
    ##  [67] markdown_2.0             stringr_1.6.0            later_1.4.8
    ##  [70] dplyr_1.2.1              lattice_0.22-9           rtracklayer_1.72.0
    ##  [73] bit_4.6.0                deldir_2.0-4             biovizBase_1.60.0
    ##  [76] tidyselect_1.2.1         knitr_1.51               gridExtra_2.3
    ##  [79] bookdown_0.46            ProtGenerics_1.44.0      xfun_0.57
    ##  [82] stringi_1.8.7            UCSC.utils_1.8.0         lazyeval_0.2.3
    ##  [85] yaml_2.3.12              evaluate_1.0.5           codetools_0.2-20
    ##  [88] cigarillo_1.2.0          interp_1.1-6             GenomicFiles_1.48.0
    ##  [91] tibble_3.3.1             BiocManager_1.30.27      cli_3.6.6
    ##  [94] rpart_4.1.27             xtable_1.8-8             jquerylib_0.1.4
    ##  [97] dichromat_2.0-0.1        Rcpp_1.1.1-1.1           GenomeInfoDb_1.48.0
    ## [100] png_0.1-9                XML_3.99-0.23            parallel_4.6.0
    ## [103] blob_1.3.0               latticeExtra_0.6-31      jpeg_0.1-11
    ## [106] AnnotationFilter_1.36.0  bitops_1.0-9             pwalign_1.8.0
    ## [109] VariantAnnotation_1.58.0 scales_1.4.0             crayon_1.5.3
    ## [112] rlang_1.2.0              KEGGREST_1.52.0