Learn R Programming

qrqc (version 1.26.0)

getQual-methods: Get a Data Frame of Quality Data from a FASTQSummary object

Description

An object of class FASTQSummary contains quality data (binned by readSeqFile). getQual is an accessor function that reshapes the data into a data frame.

This accessor function is useful if you want to map variables to custom ggplot2 aesthetics.

Usage

getQual(x)

Arguments

x
an S4 object of class FASTQSummary from readSeqFile.

Value

getQual returns a data.frame with columns:
position
the position in the read.
ymin
the minimum quality found per a position in the read.
alt.lower
the 10% quantile found per a position in the read.
lower
the 25% quartile found per a position in the read.
middle
the median found per a position in the read.
upper
the 75% quartile found per a position in the read.
alt.upper
the 90% quantile found per a position in the read.
ymax
the maximum quality found per a position in the read.
mean
the mean quality (calculated from the binned data by using a weighted mean function) per the position in the read.

Methods

signature(x="FASTQSummary")
getQual is an accessor function that only works if there is quality data, thus it only works with objects of class FASTQSummary.

See Also

getGC, getSeqlen, getBase, getBaseProp, getMCQual, qualPlot

Examples

Run this code
  ## Load a FASTQ file, with sequence hashing.
  s.fastq <- readSeqFile(system.file('extdata', 'test.fastq', package='qrqc'))

  ## Mean quality by position
  p <- ggplot(getQual(s.fastq)) + geom_line(aes(x=position, y=mean), color="blue")
  p <- p + scale_y_continuous(limits=c(0, 42))
  p

  ## A different type of quality plot
  p <- ggplot(getQual(s.fastq)) + geom_linerange(aes(x=position,
    ymin=lower, ymax=upper, color=mean))
  p <- p +  scale_color_gradient("mean quality", low="red", high="green")
  p + scale_y_continuous("quality")

Run the code above in your browser using DataLab