shaman_plot_feature_grid

shaman_plot_feature_grid(
  grids,
  range,
  grid_resolution,
  plot_resolution,
  type = "enrichment",
  fig_fn = "",
  fig_width = 400,
  fig_height = 400,
  pal = colorRampPalette(c("blue", "#87FFFF", "white", "#FF413D", "black")),
  zlim = c(-1, 1)
)

Arguments

grids

List of grids generated for the same two feature sets from replicate observed / expected hic tracks.

range

Window size around the grid point that was used to generate the grid.

grid_resolution

Size of bins that was used to generate the grid.

plot_resolution

Size of bins to display.

type

The type of data to plot, can be "observed" for log10(obs/sum(obs)), "expected" for log10(exp/sum(exp)) or "enrichment" for log2(obs/sum(obs) / exp/sum(exp))

fig_fn

Name of png file to output to. Empty string will cause the figure to be plotted to the current device.

fig_width

Width in pixels of output png figure.

fig_height

Height in pixels of output png figure.

pal

Color palette to use for image

zlim

The minimum and maximum values for which colors should be plotted. Suggested zlim values by type: enrichment: (-1,1), obs,exp: (-4.5, -3)

Details

After contact feature grids are generated via shaman_generate_feature_grid, use this function to visualize them.

Examples


# Set misha db to test
gsetroot(shaman_get_test_track_db())
#> Error in setwd(groot): cannot change working directory
grid <- shaman_generate_feature_grid(shaman::ctcf_forward, shaman::ctcf_reverse, "hic_obs",
    exp_track_nm = "hic_exp", score_track_nm = "hic_score"
)
#> Error in shaman_generate_feature_grid(shaman::ctcf_forward, shaman::ctcf_reverse,     "hic_obs", exp_track_nm = "hic_exp", score_track_nm = "hic_score"): Missing obs_track_nm ( hic_obs ) in track db
shaman_plot_feature_grid(list(grid), 25000, 500, 500)
#> Error: object of type 'closure' is not subsettable
shaman_plot_feature_grid(list(grid), 25000, 500, 1000)
#> Error: object of type 'closure' is not subsettable
shaman_plot_feature_grid(list(grid), 25000, 500, 2000)
#> Error: object of type 'closure' is not subsettable