Sample: `r basename(qc.path)`

#Knitr settings
knitr::opts_chunk$set(
  warning=FALSE, message=FALSE, echo=TRUE, tidy=FALSE, error=FALSE,
  fig.show='hold', fig.width=3.5, fig.height = 3.5
)
options(width=150)
if(is.null(experiment)) experiment <- "Sequencing data"

Required R packages

library(fastqcr)
library(dplyr)

Reading the file

# Read all modules
qc <- qc_read(qc.path)
# Elements contained in the qc object
names(qc)

Plotting and Interpreting

Summary

Summary shows a summary of the modules which were tested, and the status of the test resuls:

Some experiments may be expected to produce libraries which are biased in particular ways. You should treat the summary evaluations therefore as pointers to where you should concentrate your attention and understand why your library may not look normal.

qc_plot(qc, "summary")

Basic Statistics

Basic statistics shows basic data metrics such as:

qc_plot(qc, "Basic statistics")

Per base sequence quality

qc_plot(qc, "Per base sequence quality")

Problems:

```{block, type = "warning"} - warning if the median for any base is less than 25. - failure if the median for any base is less than 20.

Common reasons for problems:

```{block, type = "block"}
- Degradation of (sequencing chemestry) quality over the duration of long runs. Remedy: Quality trimming.

- Short loss of quality earlier in the run, which then recovers to produce later good quality sequence. Can be explained by a transient problem with the run (bubbles in the flowcell for example). In these cases trimming is not advisable as it will remove later good sequence, but you might want to consider masking bases during subsequent mapping or assembly. 

- Library with reads of varying length. Warning or error is generated because of very low coverage for a given base range. Before committing to any action, check how many sequences were responsible for triggering an error by looking at the sequence length distribution module results. 

Per sequence quality scores

qc_plot(qc, "Per sequence quality scores")

Problems:

```{block, type = "warning"} - warning if the most frequently observed mean quality is below 27 - this equates to a 0.2% error rate. - failure if the most frequently observed mean quality is below 20 - this equates to a 1% error rate.

Common reasons for problems:

```{block, type = "block"}
General loss of quality within a run. Remedy: For long runs this may be alleviated through quality trimming.

Per base sequence content

qc_plot(qc, "Per base sequence content")

```{block, type = "notice"} It's worth noting that some types of library will always produce biased sequence composition, normally at the start of the read. For example, in RNA-Seq data, it is common to have bias at the beginning of the reads. This occurs during RNA-Seq library preparation, when "random" primers are annealed to the start of sequences. These primers are not truly random, and it leads to a variation at the beginning of the reads. We can remove these primers using a trim adaptors tool.

Problems:

```{block, type = "warning"}
- **warning** if the difference between A and T, or G and C is greater than 10% in any position.  
- **failure** if the difference between A and T, or G and C is greater than 20% in any position.

Common reasons for problems:

```{block, type = "block"} - Overrepresented sequences: adapter dimers or rRNA

### Per sequence GC content

- **Per sequence GC content** plot displays GC distribution over all sequences. In a random library you expect a roughly normal GC content distribution. An unusually sharped or shifted distribution could indicate a contamination or some systematic biase:


```r
qc_plot(qc, "Per sequence GC content")

```{block, type = "success"} You can generate the theoretical GC content curves files using an R package called fastqcTheoreticalGC written by Mike Love.

### Per base N content

- **Per base N content**. If a sequencer is unable to make a base call with sufficient confidence then it will normally substitute an N rather than a conventional base call. This module plots out the percentage of base calls at each position for which an N was called. 


```r
qc_plot(qc, "Per base N content")

Problems:

```{block, type = "warning"} - warning if any position shows an N content of >5%. - failure if any position shows an N content of >20%.

Common reasons for problems:

```{block, type = "block"}
- General loss of quality.
- Very biased sequence composition in the library.

Sequence length distribution

qc_plot(qc, "Sequence length distribution")

Sequence duplication levels

qc_plot(qc, "Sequence duplication levels")

Problems:

```{block, type = "warning"} - warning if non-unique sequences make up more than 20% of the total. - failure if non-unique sequences make up more than 50% of the total.

Common reasons for problems:

```{block, type = "block"}
- Technical duplicates arising from PCR artefacts

- Biological duplicates which are natural collisions where different copies of exactly the same sequence are randomly selected.

In RNA-seq data, duplication levels can reach even 40%. Nevertheless, while analysing transcriptome sequencing data, we should not remove these duplicates because we do not know whether they represent PCR duplicates or high gene expression of our samples.

Overrepresented sequences

qc_plot(qc, "Overrepresented sequences")

Problems:

```{block, type = "warning"} - warning if any sequence is found to represent more than 0.1% of the total. - failure if any sequence is found to represent more than 1% of the total.

Common reasons for problems:


```{block, type = "block"}
small RNA libraries where sequences are not subjected to random fragmentation, and the same sequence may natrually be present in a significant proportion of the library. 

Adapter content

qc_plot(qc, "Adapter content")

Problems:

```{block, type = "warning"} - warning if any sequence is present in more than 5% of all reads. - failure if any sequence is present in more than 10% of all reads.

```{block, type = "block"}
A warning or failure means that the sequences will need to be adapter trimmed before proceeding with any downstream analysis. 

Kmer content

qc_plot(qc, "Kmer content")

Useful Links



Try the fastqcr package in your browser

Any scripts or data that you put into this service are public.

fastqcr documentation built on March 7, 2023, 8:16 p.m.