set_track_parameters: set_track_parameters

Description Usage Arguments Value Author(s) Examples

Description

Setup parameters for plotting coverage signals along genome tracks. Result from this function can be passed to plot_tracks

Usage

1
2
3
4
5
6
7
## S4 method for signature 'character'
set_track_parameters(object, annotation = NULL,
  track_names = if (!is.null(names(object))) names(object) else
  basename(object), groups = track_names, share_y = TRUE,
  showlegend = TRUE, colors = NULL, fill = c("tozeroy", "none"),
  mode = "lines", annotation_position = c("bottom", "top"),
  annotation_size = 0.25, summary = NULL, layout = list())

Arguments

object

vector of bam or bigwig file names

annotation

TxDb or OrganismDb object

track_names

names to associate with each file

groups

vector of group assignments. traces will be grouped onto subplots based on group assignments (if only showing 1 region)

share_y

share the y axis?

showlegend

show the legend?

colors

colors for each bam file

fill

fillmode for line plot

mode

mode for plot

annotation_position

plot annotations on bottom or on top of signal traces

annotation_size

relative size of annotation plot

summary

Summary parameters from set_summary_parameters

layout

list of additional plotly layout arguments

...

additional arguments

Value

object storing track parameters, for use in plot_tracks

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
library(GenomicRanges)
library(TxDb.Hsapiens.UCSC.hg19.knownGene)

## First we'll read in some sample data
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)
ctcf.peaks = genomation::readBroadPeak(system.file("extdata",
                         "wgEncodeBroadHistoneH1hescCtcfStdPk.broadPeak.gz",
                          package = "genomationData"))
ctcf.peaks = ctcf.peaks[seqnames(ctcf.peaks) == "chr21"]

## resize peaks to size 1000
ctcf.peaks = resize(ctcf.peaks, width = 10000, fix = "center")

## Make track plotter

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)
  
if (interactive()){
  plot_tracks(ctcf.peaks[1], track_params)
  plot(ctcf.peaks[1:3], track_params)
}   

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