% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/seqArchRplus_iqw.R
\name{iqw_tpm_plots}
\alias{iqw_tpm_plots}
\title{IQW, TPM plots}
\usage{
iqw_tpm_plots(
  sname,
  info_df,
  clusts,
  iqw = TRUE,
  tpm = TRUE,
  cons = TRUE,
  order_by_median = TRUE,
  dir_path = NULL,
  txt_size = 12,
  use_suffix = NULL,
  use_prefix = "C",
  wTitle = TRUE
)
}
\arguments{
\item{sname}{Sample name}

\item{info_df}{A DataFrame object holding information on the tag clusters.
Expected columns (names) are 'chr', 'start', 'end', 'IQW', 'domTPM', and
'strand'.}

\item{clusts}{List of sequence ids in each cluster.}

\item{iqw}{Logical. Specify TRUE if boxplots of interquantile widths (IQW)
of the tag clusters corresponding to the promoters in each cluster
are to be plotted.}

\item{tpm}{Logical. Specify TRUE if boxplots of TPM values for all clusters
are to be plotted.}

\item{cons}{Logical. Specify TRUE if boxplots of conservation scores
(PhastCons scores) for all clusters. If this is TRUE, an additional column
named 'cons' is expected in the `info_df`.}

\item{order_by_median}{Logical. Whether to order to clusters by their
median (when TRUE) or mean (when FALSE) interquantile widths.}

\item{dir_path}{The /path/to/the/directory where files will be written.
Default is NULL.}

\item{txt_size}{Specify text size to be used in the plots.}

\item{use_suffix, use_prefix}{Character. Specify any suffix and/or prefix
you wish to add to the filename.}

\item{wTitle}{Logical. If TRUE, the returned plot will contain a default
title, which is the same as the filename. See details.}
}
\value{
The plot(s) as a ggplot2 object. The order of the plots is IQW,
followed by TPM values (when specified), followed by conservation scores
(when specified).
}
\description{
IQW, TPM plots
}
\details{
The plots are written to a file named
"Sample_<sample_name>_IQW_TPM_Cons_plot.pdf" if all of `iqw`, `tpm`,
and `cons` are set to TRUE. This is also set as the plot title if `wTitle`
is set to TRUE.

All plots are arranged by the IQWs (smallest on top, largest at the bottom),
even if `iqw` is set to FALSE.
}
\examples{

bed_fname <- system.file("extdata", "example_info_df.bed.gz",
         package = "seqArchRplus", mustWork = TRUE)

info_df <- read.delim(file = bed_fname,
         sep = "\t", header = TRUE,
         col.names = c("chr", "start", "end", "width",
                 "dominant_ctss", "domTPM",
                 "strand", "score", "nr_ctss",
                 "q_0.1", "q_0.9", "IQW", "tpm"))

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


iqw_tpm_pl <- iqw_tpm_plots(sname = "sample1",
                            dir_path = tempdir(),
                            info_df = info_df,
                            iqw = TRUE,
                            tpm = TRUE,
                            cons = FALSE,
                            clusts = use_clusts,
                            txt_size = 14)


}
\author{
Sarvesh Nikumbh
}
