% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/helpers_plots.R
\name{plot_mismatches}
\alias{plot_mismatches}
\title{Plots mismatches using ggplot2 and ggbio.}
\usage{
plot_mismatches(alignments, config, id, cut_buffer = 5, xlab_spacing = 4)
}
\arguments{
\item{alignments}{(data.frame) Loaded alignment information from
alignments_events.csv file.}

\item{config}{(data.frame) Loaded table from config_summary.csv file.}

\item{id}{(string or vector of strings) Name of the ID column from config
file or name of multiple IDs, if it is possible to group them. They have to
have the same amplicon, amplicons on the reverse strand will be reverse
complemented to match forward strand amplicons.}

\item{cut_buffer}{(numeric) Default is 5, you should specify the same as
used in the analysis.}

\item{xlab_spacing}{(numeric) Spacing of the x axis labels. Default is 4.}
}
\value{
(mismatches plot) ggplot2 object of mismatches plot
}
\description{
Plots mismatches in relation to the amplicon, assumes
your reads are relative to the respective amplicon sequences predicted cut
sites.
Top plot is for the forward reads, middle one shows
amplicon sequence, and bottom plot is for reverse reads.
}
\examples{
#example config
config <- read.csv(system.file("extdata", "results", "config_summary.csv",
                               package = "amplican"))
#example alignments results
alignments_file <- system.file("extdata", "results", "alignments",
                               "events_filtered_shifted_normalized.csv",
                               package = "amplican")
alignments <- read.csv(alignments_file)
plot_mismatches(alignments[alignments$consensus, ], config,
                c('ID_1', 'ID_3'))

}
\seealso{
Other specialized plots: \code{\link{metaplot_deletions}},
  \code{\link{metaplot_insertions}},
  \code{\link{metaplot_mismatches}},
  \code{\link{plot_cuts}}, \code{\link{plot_deletions}},
  \code{\link{plot_heterogeneity}},
  \code{\link{plot_insertions}},
  \code{\link{plot_variants}}
}
