basePlot-methods: Plot Base Frequency or Proportion by Position

Description Usage Arguments Methods Author(s) See Also Examples

Description

basePlot plots the frequency or proportion of bases by position in the read.

Specific bases (such as "N") can be plot alone with this function too.

Usage

1
2
3
  basePlot(x, geom=c("line", "bar", "dodge"),
    type=c("frequency", "proportion"), bases=DNA_BASES_N,
    colorvalues=getBioColor("DNA_BASES_N"))

Arguments

x

an S4 object that inherits from SequenceSummary from readSeqFile.

geom

Either "line", "bar", or "dodge" indicating the geom to use when plotting the bases. "line" will plot base proportion of frequency with lines. "bar" and "dodge" will use bars; "bar" defaults to filling the bars with different colors to distinguish bases, "dodge" lays the bars side by side.

type

Either "frequency" or "proportion" indicating whether to use count data or the proportion per base.

bases

a character vector indicating which bases to include. By default, all bases in DNA_BASES_N. Another good option would be IUPAC_CODE_MAP, which is included in the Biostrings package.

colorvalues

a character vectors of colors to use; the names of the elements must map to the bases.

Methods

signature(x = "FASTQSummary")

basePlot will plot the base frequencies or proportions for a single object that inherits from SequenceSummary.

signature(x = "list")

basePlot will plot the base frequencies or proportions for each of the SequenceSummary items in the list and display them in a series of panels.

Author(s)

Vince Buffalo <vsbuffalo@ucdavis.edu>

See Also

getBase, getBaseProp

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  ## Load a FASTQ file, with sequence hashing.
  s.fastq <- readSeqFile(system.file('extdata', 'test.fastq', package='qrqc'))

  ## Plot bases
  basePlot(s.fastq)

  ## Plot bases with filled bars
  basePlot(s.fastq, geom="bar")

  ## Plot bases with dodged bars
  basePlot(s.fastq, geom="dodge")

  ## Plot bases with dodged bars
  basePlot(s.fastq, geom="bar", bases=c("G", "T"))

  ## Plot multiple base plots
  s.trimmed.fastq <- readSeqFile(system.file('extdata',
    'test-trimmed.fastq', package='qrqc'))
  basePlot(list("not trimmed"=s.fastq, "trimmed"=s.trimmed.fastq))


  ## Graphical features can be added
  basePlot(s.trimmed.fastq, type="proportion") +
    geom_hline(yintercept=0.25, color="purple")

vsbuffalo/qrqc documentation built on May 3, 2019, 7:07 p.m.