View source: R/plot.density.profile.R
plot.density.profile | R Documentation |
Plots the density profile of NGS data signals, using as input a score matrix computed by deeptools's computeMatrix function or by computeMatrix.deeptools and density.matrix functions from this package.
## S3 method for class 'density.profile'
plot(
matrix.file,
plot.by.group = T,
missing.data.as.zero = NULL,
sample.names = NULL,
region.names = NULL,
signal.type = "mean",
error.type = "sem",
plot.error = T,
error.transparency = 0.125,
title = NULL,
x.lab = NULL,
y.lab = NULL,
line.type = "solid",
line.width = 0.5,
x.lim = NULL,
y.lim = NULL,
y.identical.auto = T,
y.ticks.interval = NULL,
y.digits = 1,
axis.line.width = 0.5,
text.size = 12,
legend.position = c(0.2, 0.85),
plot.vertical.lines = T,
write.reference.points = T,
colors = c("#00A5CF", "#F8766D", "#AC88FF", "#E08B00", "#00BA38", "#BB9D00", "#FF61C9",
"gray30"),
n.row.multiplot = 1,
multiplot.export.file = NULL,
real.width.single.plot = 2.9,
real.height.single.plot = 3.5,
by.row = TRUE,
print.multiplot = F
)
matrix.file |
A single string indicating a full path to a matrix.gz file generated by |
plot.by.group |
Logical value to define whether plot by group of regions or by sample. By default |
missing.data.as.zero |
Logical value to define whether treat missing data as 0. If set as |
sample.names |
Samples names could be defined by a string vector. If set as |
region.names |
Region names could be defined by a string vector. If set as |
signal.type |
String indicating the signal to be computed and plotted. Available parameters are "mean", "median" and "sum". By default "mean". |
error.type |
String indicating the type of error to be computed and plotted. Available parameters are "sem" and "sd", standard error mean and standard deviation respectively. By default "sem". Parameter considered only when |
plot.error |
Logical value to define whether to plot the error around the signal. By default |
error.transparency |
Numeric value to define the alpha/transparency of the error. By default 0.125. Parameter considered only when |
title |
Title of each plot could be defined by a string vector. If set as |
x.lab |
Single string or string vector to define the X-axis label for all the plots. By default |
y.lab |
Single string or string vector to define the Y-axis label for all the plots. By default |
line.type |
Vector to define each line type. Both numeric and string codes are accepted. If only one element is given this will be applied to all the lines. By default "solid". |
line.width |
Numeric value to define the line width for all the plots. By default |
x.lim |
List of numeric vectors with two elements each to define the range of the X-axis. To set only one side use NA for the side to leave automatic. If only one range is given this one will be applied to all the plots. By default |
y.lim |
List of numeric vectors with two elements each to define the range of the Y-axis. To set only one side use NA for the side to leave automatic. If only one range is given this one will be applied to all the plots. By default |
y.identical.auto |
Logical value to define whether use the same Y-axis range for all the plots automatically depending on the values. Not used when |
y.ticks.interval |
A number indicating the interval/bin spacing two ticks on the Y-axis. By default |
y.digits |
A numeric value to define the number of digits to use for the y.axis values. By default |
axis.line.width |
Numeric value to define the axes and ticks line width for all plots. By default |
text.size |
Numeric value to define the size of the text for the labels of all the plots. By default 12. |
legend.position |
Any ggplot supported value for the legend position (eg. "none", top", "bottom", "left", "right", c(fraction.x, fraction.y)). By default |
plot.vertical.lines |
Logical value to define whether to plot a dashed gray vertical line in correspondence of the reference points of each plot. By default |
write.reference.points |
Logical value to define whether to indicate the reference points on each plot. Applied only when |
colors |
Vector to define the line and error area colors. If only one value is provided it will applied to all the samples/groups. If the number of values is lower than the the required one, a random set of colors will be generated. All standard R.colors values are accepted. By default |
n.row.multiplot |
Numeric value to define the number of rows in the final multiplot. |
multiplot.export.file |
If a string with the name of a PDF file is provided the multiplot will be exported. By default |
real.width.single.plot |
Numeric value, in inches, to define the real width of each plot in the multiplot exported, if required. By default 2.9 inches. |
real.height.single.plot |
Numeric value, in inches, to define the real height of each plot in the multiplot exported, if required. By default 3.5 inches. |
by.row |
Logical value to define whether the plots should be arranged by row. By default |
print.multiplot |
Logical value to define whether to print the multiplot once created. By default |
To know more about the deepTools's function computeMatrix
see the package manual at the following link:
https://deeptools.readthedocs.io/en/develop/content/tools/computeMatrix.html.
The function returns a list containing:
data.table
with the computed values used for the plot;
metadata
table with the information gotten from the matrix_file.gz;
plot.list
with a plot for each list element;
multiplot
with the image of all the plots together.
plot.density.profile(
matrix.file = "/path.to/matrix.file.gz", plot.by.group = TRUE,
missing.data.as.zero = NULL, sample.names = NULL, region.names = NULL,
signal.type = "mean", error.type = "sem", plot.error = TRUE,
error.transparency = 0.125, title = NULL, x.lab = NULL, y.lab = NULL,
line.type = "solid", line.width = 0.5, x.lim = NULL, y.lim = NULL,
y.identical.auto = TRUE, y.ticks.number = 5, text.size = 12,
plot.vertical.lines = TRUE, colors = c("red", "blue", "#00BA38"),
n.row.multiplot = 1, multiplot.export.file = "/path.to/multiplot.pdf",
real.width.single.plot = 2.5, real.height.single.plot = 3,
print.multiplot = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.