shiftPlots: Plot shifted heatmaps per library

shiftPlotsR Documentation

Plot shifted heatmaps per library

Description

Around CDS TISs, plot coverage. A good validation for you p-shifting, to see shifts are corresponding and close to the CDS TIS.

Usage

shiftPlots(
  df,
  output = NULL,
  title = "Ribo-seq",
  scoring = "transcriptNormalized",
  pShifted = TRUE,
  upstream = if (pShifted) 5 else 20,
  downstream = if (pShifted) 20 else 5,
  type = "bar",
  addFracPlot = TRUE,
  plot.ext = ".pdf",
  dpi = ifelse(nrow(df) < 22, 300, 200),
  BPPARAM = bpparam()
)

Arguments

df

an ORFik experiment

output

name to save file, full path. (Default NULL) No saving. Sett to "auto" to save to QC_STATS folder of experiment named: "pshifts_barplots.png" or "pshifts_heatmaps.png" depending on type argument. Folder must exist!

title

Title for top of plot, default "Ribo-seq". A more informative name could be "Ribo-seq zebrafish Chew et al. 2013"

scoring

which scoring scheme to use for heatmap, default "transcriptNormalized". Some alternatives: "sum", "zscore".

pShifted

a logical (TRUE), are Ribo-seq reads p-shifted to size 1 width reads? If upstream and downstream is set, this argument is irrelevant. So set to FALSE if this is not p-shifted Ribo-seq.

upstream

an integer (5), relative region to get upstream from. Default: ifelse(!is.null(tx), ifelse(pShifted, 5, 20), min(ifelse(pShifted, 5, 20), 0))

downstream

an integer (20), relative region to get downstream from. Default: ifelse(pShifted, 20, 5)

type

character, default "bar". Plot as faceted bars, gives more detailed information of read lengths, but harder to see patterns over multiple read lengths. Alternative: "heatmap", better overview of patterns over multiple read lengths.

addFracPlot

logical, default TRUE, add positional sum plot on top per heatmap.

plot.ext

default ".pdf". Alternative ".png". Only added if output is "auto".

dpi

numeric, default: ifelse(nrow(df) < 22, 300, 200)

BPPARAM

how many cores/threads to use? default: bpparam()

Value

a ggplot2 grob object

See Also

Other pshifting: changePointAnalysis(), detectRibosomeShifts(), shiftFootprints(), shiftFootprintsByExperiment(), shifts_load(), shifts_save()

Examples

df <- ORFik.template.experiment.zf()
df <- df[df$libtype == "RFP",][1,] #lets only p-shift first RFP sample
#shiftFootprintsByExperiment(df, output_format = "bedo)
#grob <- shiftPlots(df, title = "Ribo-seq Human ORFik et al. 2020")
#plot(grob) #Only plot in RStudio for small amount of files!

Roleren/ORFik documentation built on Nov. 13, 2024, 10 p.m.