tornado_insulation: Plot a heatmap or profile of insulation scores

View source: R/tornado_insulation.R

tornado_insulationR Documentation

Plot a heatmap or profile of insulation scores

Description

Takes pre-calculated insulation scores around a set of genomic locations and plots these in a heatmap and/or profile.

Usage

tornado_insulation(
  IS_discovery,
  bed,
  bed_pos = "end",
  region_width = 1e+06,
  sort_bins = 11,
  sort_on = 1,
  mode = c("both", "heatmap", "profile"),
  colour_lim = c(-1, 1),
  colours = NULL,
  profile_fun = mean,
  custom_fill_scale = NULL,
  profile_ylim = NULL,
  title = NULL
)

Arguments

IS_discovery

A GENOVA IS_discovery object as created by insulation_score().

bed

A data.frame with 3 columns in BED format, containing genomic locations for which the insulation score is taken. Alternatively, a list of such data.frame.

bed_pos

A character vector of length 1 containing either "start", "end" or "center" indicating what position of the 'bed' argument to center insulation scores around.

region_width

A numeric vector of length 1 for the size in basepairs around the feature to retrieve insulation scores for.

sort_bins

A integer of length 1 indicating how many central bins should be used to sort the heatmap.

sort_on

A integer of length 1 noting an experiment on which to sort the heatmap.

mode

A character of length 1 containing either "heatmap", "profile" or "both" for how the data should be plotted.

colour_lim

A numeric vector of length 2 indicating the limits of the heatmap colour scale in insulation scores.

colours

A vector of valid colours for the heatmap gradient. Internally defaults to a blue-white-red gradient.

profile_fun

A function with which to calculate the profile. Should return 1 value per call.

custom_fill_scale

A call to one of ggplot2's scale_fill_* family of functions to use as the heatmap's scale. If this argument is not NULL, it overrides the 'colour_lim' and 'colour' arguments.

profile_ylim

A numeric of length 2 indicating limits for the y-axis in the profile part.

title

A character or expression of length 1 to use as text for the plot title.

Details

The profile colours are automatically assumed from the colours given to the contacts object during the load_contacts operation. Entries in the 'bed' argument that contain > 1 percent missing data are dropped.

Value

A ggplot object.

See Also

insulation_score for calculating insulation scores. call_TAD_insulation for calling TADs on the insulation score.

Examples

## Not run: 
# Calculating insulation scores
ins <- tornado_insulation(list(WT_20kb, KO_20kb), window = 25)

# Calling TADs from the insulation score
tadlist <- call_TAD_insulation(ins)

# Plotting a heatmap
tornado_insulation(ins, tadlist$WT_20kb)

## End(Not run)

robinweide/GENOVA documentation built on March 14, 2024, 11:16 p.m.