heatMap_single: Coverage heatmap of single libraries

View source: R/coverage_heatmaps.R

heatMap_singleR Documentation

Coverage heatmap of single libraries

Description

Coverage heatmap of single libraries

Usage

heatMap_single(
  region,
  tx,
  reads,
  outdir,
  scores = "sum",
  upstream,
  downstream,
  zeroPosition = upstream,
  returnCoverage = FALSE,
  acceptedLengths = NULL,
  legendPos = "right",
  colors = "default",
  addFracPlot = TRUE,
  location = "start site",
  shifting = NULL,
  skip.last = FALSE,
  title = NULL,
  gradient.max = "default"
)

Arguments

region

#' a GRangesList object of region, usually either leaders, cds', 3' utrs or ORFs, start region, stop regions etc. This is the region that will be mapped in heatmap

tx

default NULL, a GRangesList of transcripts or (container region), names of tx must contain all grl names. The names of grl can also be the ORFik orf names. that is "txName_id"

reads

a GAlignments, GRanges, or precomputed coverage as covRleList (where names of covRle objects are readlengths) of RiboSeq, RnaSeq etc.
Weigths for scoring is default the 'score' column in 'reads'. Can also be random access paths to bigWig or fstwig file. Do not use random access for more than a few genes, then loading the entire files is usually better.

outdir

a character path to save file as: not just directory, but full name.

scores

character vector, default "sum", either of zscore, transcriptNormalized, sum, mean, median, .. see ?coverageScorings for info and more alternatives.

upstream

an integer, relative region to get upstream from.

downstream

an integer, relative region to get downstream from

zeroPosition

an integer DEFAULT (upstream), what is the center point? Like leaders and cds combination, then 0 is the TIS and -1 is last base in leader. NOTE!: if windows have different widths, this will be ignored.

returnCoverage

logical, default: FALSE, return coverage, if FALSE returns plot instead.

acceptedLengths

an integer vector (NULL), the read lengths accepted. Default NULL, means all lengths accepted.

legendPos

a character, Default "right". Where should the fill legend be ? ("top", "bottom", "right", "left")

colors

character vector, default: "default", this gives you: c("white", "yellow2", "yellow3", "lightblue", "blue", "navy"), do "high" for more high contrasts, or specify your own colors.

addFracPlot

Add margin histogram plot on top of heatmap with fractions per positions

location

a character, default "start site", will make xlabel of heatmap be Position relative to "start site" or alternative given.

shifting

a character, default NULL (no shifting), can also be either of c("5prime", "3prime")

skip.last

skip top(highest) read length, default FALSE

title

a character, default NULL (no title), what is the top title of plot?

gradient.max

numeric or character, default: "default", which is: max(coverage$score), the max coverage over all readlengths. If you want all plots to use same reference point for max scaling, then first detect this point, look at max in plot etc, and use that value, to get all plots to have same max point.

Value

ggplot2 grob (default), data.table (if returnCoverage is TRUE)

See Also

Other heatmaps: coverageHeatMap(), heatMapL(), heatMapRegion()


JokingHero/ORFik documentation built on Dec. 21, 2024, 12:01 a.m.