plot_tracks: plot_tracks

Description Usage Arguments Value Author(s) Examples

Description

plot_tracks

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## S4 method for signature 'GenomicRanges'
plot_tracks(windows, params,
  locus_names = mcols(windows)$name, offset = width(windows[1])%/%2,
  xtitle = if (length(windows) > 1) "Relative Position" else
  seqnames(windows), ..., summary_args = list())

## S4 method for signature 'character'
plot_tracks(windows, params, locus_names = windows,
  offset = NULL, xtitle = if (length(windows) > 1) "Relative Position" else
  NULL, ..., summary_args = list())

Arguments

windows

GenomicRanges or rownames for summary object

params

TrackParameters, from set_track_parameters

locus_names

names for each genomic locus represented by windows

offset

offset to use for center of region, used when plotting multiple regions

xtitle

title for x axis

...

additional arguments from set_track_parameters

summary_args

lof arguments to override from set_summary_parameters

Value

GenomeTrackWidgets object, which is displayed as htmlwidgets. To convert manually to htmlwidgets, use to_widget

Author(s)

Alicia Schep and Justin Finkle

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
library(GenomicRanges)
library(TxDb.Hsapiens.UCSC.hg19.knownGene)

## we'll read in some RNA counts
data(rpkm_chr21)

## From the ranges of the rpkm object, we'll pull out the tss
chr21_promoters <- promoters(SummarizedExperiment::rowRanges(rpkm_chr21),
                 up = 1000, down = 1000)

## set summary parameters

summary_params <- set_summary_parameters(rpkm_chr21,
  groups = "GROUP", ranges = chr21_promoters) 
  
## We'll also read in some track data to plot
genomation_dir <- system.file("extdata", package = "genomationData")
samp.file <- file.path(genomation_dir,'SamplesInfo.txt')
samp.info <- read.table(samp.file, header=TRUE, sep="\t", 
                        stringsAsFactors = FALSE)
samp.info$fileName <- file.path(genomation_dir, samp.info$fileName)

## Make track plotter using summary parametrs

track_params <- set_track_parameters(samp.info$fileName[1:3], 
  annotation = TxDb.Hsapiens.UCSC.hg19.knownGene, 
  track_names = samp.info$sampleName[1:3], 
  share_y = TRUE,
  summary = summary_params)
  
if (interactive()){
  plot_tracks(rownames(rpkm_chr21)[1:3], track_params)
  plot(chr21_promoters[1:3], track_params)
}   

skummerf/GenomicWidgets documentation built on May 31, 2019, 6:16 p.m.