heatmap_to_tracks_shiny: heatmap_to_tracks_shiny

Description Usage Arguments Value Author(s) Examples

Description

Function for making shiny app linking a heatmap to genome tracks

Usage

1
2
3
heatmap_to_tracks_shiny(heatmap, track_params, link,
  title = "Heatmap linked to Genome Tracks", options = list(height = 1400),
  ...)

Arguments

heatmap

IHeatmap object

track_params

output from set_track_parameters

link

link function, linking rows of heatmap to input to track function generator, result from heatmap_click

title

Title of shiny app

options

to pass to shiny

...

additional arguments to plot_tracks

Value

Shiny application

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
35
36
37
38
39
40
41
library(GenomicRanges)
library(TxDb.Hsapiens.UCSC.hg19.knownGene)

  
## 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)
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 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)

# Make coverage heamap

ctcf_mats <- make_coverage_matrix(samp.info$fileName[1:5], 
                                  ctcf.peaks, 
                                  input_names = samp.info$sampleName[1:5],
                                  up = 250, 
                                  down = 250, 
                                  binsize = 25)
                                  
hm <- coverage_heatmap(ctcf_mats, "Ctcf") 

link_fn <- heatmap_click(hm, ctcf.peaks)
      
if (interactive()){
  heatmap_to_tracks_shiny(hm, track_params, link_fn)
}   

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