covDataObject-class: Container to hold raw data for SpliceWiz coverage plots

covDataObject-classR Documentation

Container to hold raw data for SpliceWiz coverage plots

Description

This object is generated using getCoverageData or getGenomeData methods, and is used as input for generating coverage plots.

Usage

## S4 method for signature 'covDataObject'
showEvents(object)

getCoverageData(
  se,
  Event,
  Gene,
  seqname,
  start,
  end,
  coordinates,
  strand = c("*", "+", "-"),
  zoom_factor = 0.2,
  bases_flanking = 100,
  tracks,
  condition,
  ...
)

getGenomeData(
  reference_path,
  Gene,
  seqname,
  start,
  end,
  coordinates,
  zoom_factor = 0.2,
  bases_flanking = 100,
  ...
)

plotAnnoTrack(
  object,
  Event,
  view_start,
  view_end,
  reverseGenomeCoords = FALSE,
  condensed = FALSE,
  selected_transcripts = "",
  plot_key_isoforms = FALSE,
  usePlotly = FALSE,
  ...
)

Arguments

object

For plotAnnoTrack(), the covDataObject created by getCoverageData() or getGenomeData()

se

A NxtSE object, created by makeSE. COV files must be linked to the NxtSE object. To do this, see the example in makeSE. Required by plotCoverage. Not required by plotGenome if reference_path is supplied.

Event

The EventName of the IR / alternative splicing event to be displayed. Use rownames(se) to display a list of valid events.

Gene

Whether to use the range for the given Gene. If given, overrides Event (but Event or norm_event will be used to normalise by condition). Valid Gene entries include gene_id (Ensembl ID) or gene_name (Gene Symbol).

seqname, start, end

The chromosome (string) and genomic start/end coordinates (numeric) of the region to display. If present, overrides both Event and Gene. E.g. for a given region of chr1:10000-11000, use the parameters: ⁠seqname = "chr1", start = 10000, end = 11000⁠

coordinates

A string specifying genomic coordinates can be given instead of ⁠seqname,start,end⁠. Must be of the format "chr:start-end", e.g. "chr1:10000-11000"

strand

Whether to show coverage of both strands "*" (default), or from the "+" or "-" strand only.

zoom_factor

Zoom out from event. Each level of zoom zooms out by a factor of 3. E.g. for a query region of chr1:10000-11000, if a zoom_factor of 1.0 is given, chr1:99000-12000 will be displayed.

bases_flanking

(Default = 100) How many bases flanking the zoomed window. Useful when used in conjunction with zoom_factor == 0. E.g. for a given region of chr1:10000-11000, if zoom_factor = 0 and bases_flanking = 100, the region chr1:9900-11100 will be displayed.

tracks

The names of individual samples, or the names of the different conditions to be plotted. For the latter, set condition to the specified condition category.

condition

To display normalised coverage per condition, set this to the condition category. If omitted, tracks are assumed to refer to the names of individual samples.

...

Ignored / not used

reference_path

The path of the reference generated by Build-Reference-methods. Required by plotGenome if a NxtSE object is not specified.

view_start, view_end

Start and end coordinates of plotting function. Note that plot coordinates may be different from retrieval coordinates and is useful for zooming in.

reverseGenomeCoords

Whether the genomic axis should be reversed to make it more convenient to plot reverse-stranded genes

condensed

(default 'FALSE) Whether the genomic track should be condensed to plot whole genes, rather than transcripts. Preferred if multiple genes are plotted on a zoomed-out plot

selected_transcripts

(default "") One or more transcript names or ID's to be displayed on the annotation track.

plot_key_isoforms

(default FALSE) If TRUE, plots only transcripts involved in the given splicing Event.

usePlotly

(default FALSE) Whether to return a plotly or ggplot object.

Value

For getCoverageData(): A covDataObject containing required data used to generate downstream For plotAnnoTrack(): A ggplot or plotly object

Functions

  • showEvents(covDataObject): Returns the EventNames for which events can be normalized using the given covDataObject

  • getCoverageData(): Get coverage / genome data for plotting coverage plots

  • getGenomeData(): Get coverage / genome data for plotting coverage plots

  • plotAnnoTrack(): Directly plots the annotation from a covDataObject.

See Also

covPlotObject

Examples

se <- SpliceWiz_example_NxtSE(novelSplicing = TRUE)

# Assign annotation of the experimental conditions
colData(se)$treatment <- rep(c("A", "B"), each = 3)

dataObj <- getCoverageData(
    se,
    Event = "SE:SRSF3-203-exon4;SRSF3-202-int3",
    tracks = colnames(se)
)

# Show `EventName`s of supported splicing events 
# contained within covDataObject

showEvents(dataObj)

# A limited covDataObject containing only the reference can be generated
# from the SpliceWiz reference

buildRef(
    reference_path = file.path(tempdir(), "Reference"),
    fasta = chrZ_genome(),
    gtf = chrZ_gtf()
)

genomeObj <- getGenomeData(
    reference_path = file.path(tempdir(), "Reference"),
    Gene = "SRSF3"
)

# Plot reference track directly from the covDataObject

# NB: Event plotting is not supported for reference-derived `covDataObject`s
plotAnnoTrack(genomeObj) 

plotAnnoTrack(dataObj, Event = "SE:SRSF3-203-exon4;SRSF3-202-int3") 


alexchwong/SpliceWiz documentation built on Oct. 15, 2024, 10:12 a.m.