mmplot_cov_profiles: Compare coverage profiles

Description Usage Arguments Value Examples

View source: R/mmplot_cov_profiles.R

Description

Plots all coverage profiles in the data for comparison. This is useful for identifying scaffold patterns across multiple coverage profiles and spot potential contaminants.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
mmplot_cov_profiles(
  mm,
  normalise = FALSE,
  alpha = 0.6,
  color_by = NULL,
  color_vector = c("blue", "green", "red"),
  color_scale_log10 = FALSE,
  y_scale_log10 = FALSE,
  plot_lines = TRUE,
  interactive_plot = FALSE,
  mm_normalise = NULL,
  mm_normalise_index = NULL
)

Arguments

mm

(required) A dataframe loaded with mmload.

normalise

(Logical) Normalises each coverage column in mm to its highest value and multiplies by 100. (Default: TRUE)

alpha

The transparancy of the scaffold points and lines, where 0 is invisible and 1 is opaque. (Default: 0.6)

color_by

Color the scaffolds by a variable in mm. (Default: NULL)

color_vector

The colors from which to generate a color gradient when color_by is set and the variable is continuous. Any number of colors can be used. (Default: c("blue", "green", "red"))

color_scale_log10

(Logical) Log10-scale the color gradient when color_by is set and the variable is continuous. (Default: FALSE)

y_scale_log10

(Logical) Log10-scale the y axis. (Default: FALSE)

plot_lines

(Logical) Connect scaffolds with lines. (Default: TRUE)

interactive_plot

(Logical) Return an interactive plotly plot or not. (Default: FALSE)

mm_normalise

A dataframe loaded with mmload to normalise by.

mm_normalise_index

A coverage column to serve as an index for normalisation.

Value

A ggplot or plotly object. Note that mmgenome2 hides all warnings produced by ggplot objects.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library(mmgenome2)
data(mmgenome2)
mmgenome2
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)
)
mmgenome2_extraction <- mmextract(mmgenome2,
  min_length = 3000,
  selection = selection,
  inverse = FALSE
)
mmplot_cov_profiles(mmgenome2_extraction,
  color_by = "taxonomy",
  normalise = FALSE
)

KasperSkytte/mmgenome2 documentation built on Dec. 14, 2021, 12:11 a.m.