shiftPlots {ORFik} | R 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",
      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.
`downstream` | an integer (20), relative region to get downstream from
`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".
`BPPARAM` | how many cores/threads to use? default: bpparam()

### Value

a ggplot2 grob object

### See Also

Other pshifting: `changePointAnalysis()`, `detectRibosomeShifts()`, `shiftFootprintsByExperiment()`, `shiftFootprints()`, `shifts.load()`

### Examples

    df <- ORFik.template.experiment()
    df <- df[3,] #lets only p-shift RFP sample at index 3
    #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!

[Package ORFik version 1.12.13 Index]