Description Usage Arguments Value Author(s) Examples
Plots any information about the scaffolds contained in the given mm object as a scatterplot, for example different coverage variables, scaffold length, GC content, or anything else that were loaded with mmload
. Scaffolds can then be highlighted and extracted using the locator and selection features.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | mmplot(
mm,
x,
y,
min_length = 0,
color_by = NULL,
locator = FALSE,
selection = NULL,
network = NULL,
shared_genes = FALSE,
label_scaffolds = FALSE,
label_scaffolds_by = "scaffold",
label_bins = NULL,
highlight_scaffolds = NULL,
highlight_color = "darkred",
x_scale = NULL,
x_limits = NULL,
y_scale = NULL,
y_limits = NULL,
alpha = 0.1,
fixed_size = NULL,
size_scale = 1,
factor_shape = "outline",
color_vector = c("blue", "green", "red"),
color_scale_log10 = FALSE
)
|
mm |
(required) A dataframe loaded with |
x |
(required) The variable from |
y |
(required) The variable from |
min_length |
Remove scaffolds with a length at or below this value before plotting. (Default: |
color_by |
Color the scaffolds by a variable in |
locator |
(Logical) When |
selection |
A 2-column dataframe with the x and y coordinates of points with which to draw a polygon onto the plot to highlight a selected region. A selection can be obtained by using the locator feature (by |
network |
Paired-end or mate-pair connections between scaffolds in long format. The first and second columns must contain all connected scaffold pairs and the third column the number of connections. |
shared_genes |
(Logical) If |
label_scaffolds |
Add text labels (with text from the variable in mm defined by |
label_scaffolds_by |
The variable in mm by which to label the scaffolds defined by |
label_bins |
Add labels at the centroids of bins (groups of scaffolds) defined by a variable in |
highlight_scaffolds |
A vector of scaffold names or a dataframe loaded with |
highlight_color |
The color with which to highlight the scaffolds set by |
x_scale |
Log10-scale ( |
x_limits |
Axis limits of the x axis. Must be a vector of length 2 where the first number is the lower limit and the second number is the upper limit. Use |
y_scale |
Log10-scale ( |
y_limits |
Axis limits of the y axis. Must be a vector of length 2 where the first number is the lower limit and the second number is the upper limit. Use |
alpha |
The transparancy of the scaffold points, where 0 is invisible and 1 is opaque. (Default: |
fixed_size |
A fixed size for all scaffolds if set. If |
size_scale |
A factor to scale the sizes of the scaffolds plotted. Only applies when |
factor_shape |
When |
color_vector |
The colors from which to generate a color gradient when |
color_scale_log10 |
(Logical) Log10-scale the color gradient when |
A ggplot object. Note that mmgenome2 hides all warnings produced by ggplot objects.
Kasper Skytte Andersen ksa@bio.aau.dk
Soren M. Karst smk@bio.aau.dk
Mads Albertsen MadsAlbertsen85@gmail.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | library(mmgenome2)
data(mmgenome2)
mmgenome2
mmplot(mmgenome2,
min_length = 3000,
x = "cov_C13.11.25",
y = "cov_C14.01.09",
color_by = "taxonomy",
# locator = TRUE,
x_scale = "log10",
y_scale = "log10"
)
# Set "locator = TRUE" to interactively capture the coordinates of
# mouse clicks in an mmplot, or provide coordinates with "selection":
selection <- data.frame(
cov_C13.11.25 = c(7.2, 16.2, 25.2, 23.3, 10.1),
cov_C14.01.09 = c(47, 77, 52.8, 29.5, 22.1)
)
mmplot(mmgenome2,
min_length = 10000,
x = "cov_C13.11.25",
y = "cov_C14.01.09",
color_by = "taxonomy",
x_scale = "log10",
y_scale = "log10",
x_limits = c(1, NA), # zoom in at minimum 1x coverage
y_limits = c(1, NA), # zoom in at minimum 1x coverage
selection = selection
) # highlight the selection marked with locator
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.