Learn R Programming

qrqc (version 1.26.0)

kmerEntropyPlot-methods: Plot Entropy of k-mers by Position

Description

kmerEntropyPlot plots the Shannon entropy per position of k-mers. Lower Shannon entropy implies that the distribution of k-mers is non-random and could indicate bias.

Usage

kmerEntropyPlot(x)

Arguments

x
an S4 object a class that inherits from SequenceSummary from readSeqFile or a list of objects that inherit from SequenceSummary with names.

Methods

signature(x = "SequenceSummary")
kmerEntropyPlot will plot Shannon entropy per position for an object that inherits from SequenceSummary.
signature(x = "list")
kmerEntropyPlot will plot the Shannon entropy per position for each of the objects that inherit from SequenceSummary in the list and display them in a series of panels.

See Also

getKmer, calcKL, kmerKLPlot

Examples

Run this code
  ## Load a somewhat contaminated FASTQ file
  s.fastq <- readSeqFile(system.file('extdata', 'test.fastq',
    package='qrqc'), hash.prop=1)

  ## Load a really contaminated FASTQ file
  s.contam.fastq <- readSeqFile(system.file('extdata',
    'test-contam.fastq', package='qrqc'), hash.prop=1)

  ## Load a random (equal base frequency) FASTA file
  s.random.fasta <- readSeqFile(system.file('extdata',
    'random.fasta', package='qrqc'), type="fasta", hash.prop=1)

  ## Plot the Shannon entropy for a single file
  kmerEntropyPlot(s.fastq)

  ## Plot the Shannon entropy for many files
  kmerEntropyPlot(list("highly contaminated"=s.contam.fastq, "less
    contaminated"=s.fastq, "random"=s.random.fasta))

Run the code above in your browser using DataLab