PlotCoverage: PlotCoverage

View source: R/plotting_functions.R

PlotCoverageR Documentation

PlotCoverage

Description

Plots read coverage across a gene for a set of BAM files and/or wig data.

Usage

PlotCoverage(
  genome_gr,
  geneSymbol = "",
  wig_data = NULL,
  bamfiles = NULL,
  peaks.annot = NULL,
  label.transcripts = FALSE,
  wig_same_strand = TRUE,
  genome = NULL,
  pdf_output = FALSE,
  wig_data.tracknames = NULL,
  bamfile.tracknames = NULL,
  output_file_name = "",
  zoom_3UTR = FALSE,
  annotation.fontsize = NULL,
  axis.fontsize = NULL,
  ylims = NULL
)

Arguments

genome_gr

: genome granges object

geneSymbol

: Name of gene symbol

wig_data

can be a data frame or a genomic ranges object. Must be stranded.

bamfiles

: BAM filenames that are to be displayed as data tracks

peaks.annot

an optionally named vector of peaks to annotate on the plot.

label.transcripts

if set to TRUE, adds transcript identifiers to the gene model

wig_same_strand

Display same strand or opposing strand of wig data (compared to reference gene)

genome

: genome object

pdf_output

: If true will create output pdf files

wig_data.tracknames

: WIG track display names. Assumed to be in same order as wig_data.

bamfile.tracknames

: BAM track display names. Assumed to be in same order as bamfiles.

output_file_name

: Used if pdf_output is true. Location of where files will be placed.

zoom_3UTR

: If TRUE will create a second figure which will zoom in on 3'UTR.

annotation.fontsize

font size for optional peak and transcript annotations

axis.fontsize

font size for the axis labels

ylims

manually set the y-axis scale

Value

NULL by default.

Examples


extdata_path <- system.file("extdata",package = "Sierra")
reference.file <- paste0(extdata_path,"/Vignette_cellranger_genes_subset.gtf")
gtf_gr <- rtracklayer::import(reference.file)
bam.files <- c(paste0(extdata_path,"/Vignette_example_TIP_mi.bam"),
                 paste0(extdata_path,"/Vignette_example_TIP_sham.bam"))


PlotCoverage(genome_gr = gtf_gr, geneSymbol = "Lrrc58", genome = "mm10", 
           bamfiles = bam.files, bamfile.tracknames=c("MI", "sham"))
           
## Alternatively, plot with annotated peaks
peaks.annot <- c("Lrrc58:16:37888444-37888858:1", "Lrrc58:16:37883336-37883588:1")
names(peaks.annot) <- c("Peak 1", "Peak 2")

PlotCoverage(genome_gr = gtf_gr, geneSymbol = "Lrrc58", genome = "mm10", 
          peaks.annot = peaks.annot, bamfiles = bam.files, 
          bamfile.tracknames=c("MI", "sham"))


VCCRI/Sierra documentation built on July 3, 2023, 6:39 a.m.