| basePlot-methods {qrqc} | R Documentation |
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.
basePlot(x, geom=c("line", "bar", "dodge"),
type=c("frequency", "proportion"), bases=DNA_BASES_N,
colorvalues=getBioColor("DNA_BASES_N"))
x |
an S4 object that inherits from |
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 |
colorvalues |
a character vectors of colors to use; the names of the elements must map to the bases. |
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.
Vince Buffalo <vsbuffalo@ucdavis.edu>
## 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")