% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/seqArchRplus_motif_heatmaps.R
\name{plot_motif_heatmaps2}
\alias{plot_motif_heatmaps2}
\title{Plot heatmaps of motifs occurring in seqArchR clusters}
\usage{
plot_motif_heatmaps2(
  sname,
  seqs,
  flanks = c(50),
  clusts,
  use_colors = NULL,
  motifs,
  dir_path,
  fheight = 1.5 * fwidth,
  fwidth = 2000,
  hm_scale_factor = 0.75,
  n_cores = 1,
  type = c("png", "jpg"),
  ...
)
}
\arguments{
\item{sname}{The sample name}

\item{seqs}{The sequences as a DNAStringSet object}

\item{flanks}{Flank size. The same flank is used upstream and downstream.
A vector of values is also accepted when more than oone flanks should be
visualized}

\item{clusts}{List of sequence Ids in each cluster}

\item{use_colors}{Specify colors to use}

\item{motifs}{A vector of motifs to be visualized in the sequence. This can
be any words formed by the
\href{https://www.bioinformatics.org/sms2/iupac.html}{IUPAC code}.
For example, TATAA, CG, WW, SS etc.}

\item{dir_path}{The path to the directory}

\item{fheight, fwidth}{Height and width of the individual heatmap
plots in pixels}

\item{hm_scale_factor}{Factor to scale the color scale bar w.r.t. the
heatmaps. Values in (0,1]. Useful when specifying more than two motifs at
once. Note that combining/specifying more than 3 or 4 motifs in one call
to the function may result in a sub-optimally combined plot}

\item{n_cores}{Numeric. If you wish to parallelize,
specify the number of cores. Default is 1 (serial)}

\item{type}{Specify either of "png" or "jpg" to obtain PNG or JPEG files as
output}

\item{...}{Additional arguments passed to
\code{\link[seqPattern]{plotPatternDensityMap}}}
}
\value{
Nothing. Images are written to disk using the provided filenames.
In addition, two legends are printed to separate files: the color legend
and the clustering legend, which can be then combined with the heatmaps.
The heatmaps themselves have the cluster numbers marked on the vertical axis.
}
\description{
This function uses the seqPattern package. It is
 recommended to use this function rather than `plot_motif_heatmaps'
}
\examples{

library(Biostrings)
raw_seqs <- Biostrings::readDNAStringSet(
                          filepath = system.file("extdata",
                            "example_promoters200.fa.gz",
                            package = "seqArchRplus",
                            mustWork = TRUE)
                        )

use_clusts <- readRDS(system.file("extdata", "example_clust_info.rds",
         package = "seqArchRplus", mustWork = TRUE))

plot_motif_heatmaps2(sname = "sample1", seqs = raw_seqs,
                    flanks = c(50),
                    clusts = use_clusts,
                    motifs = c("WW", "SS"),
                    dir_path = tempdir())

}
\author{
Sarvesh Nikumbh
}
