build.plotter {QoRTs} | R Documentation |
Generating QC_Plotter objects, which can be used in many of the QoRT utilities to organize samples in various ways to allow for easy comparison and detection of consistent biases and artifacts.
build.plotter.basic(res, plotter.params = list()) build.plotter.colorByGroup(res, plotter.params = list()) build.plotter.colorByLane(res, plotter.params = list()) build.plotter.colorBySample(res, plotter.params = list()) build.plotter.highlightSample(curr.sample, res, plotter.params = list(), merge.offset.outgroup = TRUE) build.plotter.highlightSample.colorByLane(curr.sample, res, plotter.params = list(), merge.offset.outgroup = TRUE, lane.column.name = "lane.ID") build.plotter.colorByX(res, color.by.name, color.by.title.name = color.by.name, plotter.params = list()) build.plotter.advanced(res, colorBy = NULL, color.title = "?", highlightBy = NULL, highlight = "CURR", highlightTitle.singular = NULL, highlightTitle.plural = highlightTitle.singular, outgroup.title = "Other", plotter.params = list())
res |
A |
curr.sample |
A character string. For the sample highlight summary plots, this should be the sample.ID of the sample that is to be highlighted. |
merge.offset.outgroup |
(For advanced users) A logical value. For the sample highlight plots, determines whether the all lanes that do not include the current sample should be treated as a single "outgroup". |
plotter.params |
(For advanced users) A named list. Allows you to specify colors, offsets, and other similar patterns. By default these will all be set to reasonable values, however, if you want more control over colors, line-transparency, point plotting characters, or similar, then you can specify a named list. Any parameters that are not specified in the
Legal parameters are:
|
color.by.name |
(For advanced users) A character string. (TODO: document functionality) |
color.by.title.name |
(For advanced users) A character string. (TODO: document functionality) |
lane.column.name |
The name of the column in the decoder containing the "lane" names. |
colorBy |
A named character vector. Each unique colorBy string will be assigned a unique color. The names of colorBy must match |
color.title |
A character string. This is the title of the colorby category, used in the titles and figure legends. |
highlightBy |
A named character vector. Used to determine which replicates to highlight. The names of colorBy must match |
highlight |
A character string. Replicates where highlight equals highlightBy will be highlighted. |
highlightTitle.singular |
A character string. The singular form of the name of the category highlighted. |
highlightTitle.plural |
A character string. The plural form of the name of the category highlighted. |
outgroup.title |
A character string. The description of the non-highlighted category. Used in the figure legends. |
A QoRT_Plotter reference object used to create QC summary plots. Depending on which plotter is used, samples/lane-bams can be organized by group, sample, lane, or any arbitrary variable found in the decoder.
data(res,package="QoRTsExampleData");
plotter.basic <- build.plotter.basic(res);
makePlot.insert.size(plotter.basic);
## Starting: Insert Size plot.
## Finished: Insert Size plot.[time: 2018-09-25 13:11:45],[elapsed: 0.25 secs]
plotter.colorByGroup <- build.plotter.colorByGroup(res);
makePlot.insert.size(plotter.colorByGroup);
## Starting: Insert Size plot.
## Finished: Insert Size plot.[time: 2018-09-25 13:11:45],[elapsed: 0.28 secs]
makePlot.legend.over("topright",plotter.colorByGroup);
plotter.colorByLane <- build.plotter.colorByLane(res);
makePlot.insert.size(plotter.colorByLane);
## Starting: Insert Size plot.
## Finished: Insert Size plot.[time: 2018-09-25 13:11:46],[elapsed: 0.25 secs]
makePlot.legend.over("topright",plotter.colorByLane);
plotter.colorBySample <- build.plotter.colorBySample(res);
makePlot.insert.size(plotter.colorBySample);
## Starting: Insert Size plot.
## Finished: Insert Size plot.[time: 2018-09-25 13:11:46],[elapsed: 0.27 secs]
makePlot.legend.over("topright",plotter.colorBySample);
plotter.HS <- build.plotter.highlightSample("SAMP1",
res);
makePlot.insert.size(plotter.HS);
## Starting: Insert Size plot.
## Finished: Insert Size plot.[time: 2018-09-25 13:11:46],[elapsed: 0.28 secs]
makePlot.legend.over("topright",plotter.HS);
plotter.HSCBL <- build.plotter.highlightSample.colorByLane("SAMP1",
res);
## list()
makePlot.insert.size(plotter.HSCBL);
## Starting: Insert Size plot.
## Finished: Insert Size plot.[time: 2018-09-25 13:11:47],[elapsed: 0.29 secs]
makePlot.legend.over("topright",plotter.HSCBL);
#FOR ADVANCED USERS:
# With the build.plotter.advanced function, you can
# set coloring and highlighting to match anything you
# want.
# The parameters are a little more complex...
#In order to control color, you must create a named
# vector with names equal to the unique.ID's
# in the decoder, and in the same order:
# (this requirement is purely to prevent mistakes)
#For example: to color each sample differently:
colorBy <- res@decoder$sample.ID
names(colorBy) <- res@decoder$unique.ID;
plotter <- build.plotter.advanced(res, colorBy = colorBy);
makePlot.insert.size(plotter);
## Starting: Insert Size plot.
## Finished: Insert Size plot.[time: 2018-09-25 13:11:47],[elapsed: 0.26 secs]
makePlot.legend.over("topright",plotter);
#Now, to highlight a subgroup of the dataset, you
# must set the "highlightBy" parameter to a
# named vector with names equal to the decoder
# unique.ID's, and in the same order.
# (this requirement is purely to prevent mistakes)
#Then you must tell the plotter which subgroup
# you want to highlight using the "highlight"
# parameter.
#For example, to highlight all lanebams in lane L1:
highlightBy <- res@decoder$lane.ID
names(highlightBy) <- res@decoder$unique.ID;
plotter <- build.plotter.advanced(res,
highlightBy = highlightBy,
highlight = "L1");
makePlot.insert.size(plotter);
## Starting: Insert Size plot.
## Finished: Insert Size plot.[time: 2018-09-25 13:11:47],[elapsed: 0.28 secs]
makePlot.legend.over("topright",plotter);
#Other parameters are available to change the title
# and legends:
plotter <- build.plotter.advanced(res,
highlightBy = highlightBy,
highlight = "L1",
highlightTitle.singular = "Lane",
highlightTitle.plural = "Lanes",
outgroup.title = "Other");
makePlot.insert.size(plotter);
## Starting: Insert Size plot.
## Finished: Insert Size plot.[time: 2018-09-25 13:11:48],[elapsed: 0.43 secs]
makePlot.legend.over("topright",plotter);
#You can also color and highlight together.
# If you do this, only the "highlighted" group will be
# colored, all the others will be colored gray and will be
# drawn in the background. This can be useful for finding
# biases that are restricted to a subset of the data.
plotter <- build.plotter.advanced(res,
colorBy = colorBy,
highlightBy = highlightBy,
highlight = "L1",
color.title = "sample",
highlightTitle.singular = "Lane",
highlightTitle.plural = "Lanes",
outgroup.title = "Other"
);
makePlot.insert.size(plotter);
## Starting: Insert Size plot.
## Finished: Insert Size plot.[time: 2018-09-25 13:11:48],[elapsed: 0.28 secs]
makePlot.legend.over("topright",plotter);
#You can make multiplots using a given plotter object by
# using the "makeMultiPlot.withPlotter" function:
#makeMultiPlot.withPlotter(plotter);