Get a Data Frame of Sequence Lengths from a SequenceSummary object

Description

An object that inherits from class SequenceSummary contains sequence length data by position gathered by readSeqFile. getSeqlen is an accessor function that returns the sequence length data.

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

Usage

1

Arguments

x

an S4 object that inherits from SequenceSummary from readSeqFile.

Value

getSeqlen returns a data.frame with columns:

length

the sequence length.

count

the number of reads with this sequence length.

Methods

signature(x = "SequenceSummary")

getSeqlen is an accessor function that works on any object read in with readSeqFile; that is, objects that inherit from SequenceSummary.

Author(s)

Vince Buffalo <vsbuffalo@ucdavis.edu>

See Also

getGC, getBase, getBaseProp, getQual, getMCQual, seqlenPlot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
  library(ggplot2)

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

  # A custom plot - a bit contrived, but should show power
  d <- merge(getSeqlen(s.trimmed.fastq), getQual(s.trimmed.fastq),
    by.x="length", by.y="position")
  ggplot(d) + geom_linerange(aes(x=length, ymin=0, ymax=count),
    color="grey") + geom_linerange(aes(x=length, ymin=lower, ymax=upper),
    color="blue") + scale_y_continuous("quality/count") + theme_bw()

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.