hic_matrixplot: hic.matrixplot

View source: R/matrixplot_hic.R

hic_matrixplotR Documentation

hic.matrixplot

Description

Plot a matrix (or two) for a region of interest with annotations

Usage

hic_matrixplot(
  exp1,
  exp2 = NULL,
  chrom,
  start,
  end,
  colour_lim = NULL,
  chip = list(NULL, NULL, NULL, NULL),
  inferno = NULL,
  cexTicks = 1,
  chip.colour = "black",
  chip.yMax = NULL,
  type = rep("triangle", 4),
  guessType = T,
  coplot = "dual",
  genes = NULL,
  tads = NULL,
  tads.type = "lower",
  loops = NULL,
  loops.type = "lower",
  tads.colour = "#1faee3",
  loops.radius = NULL,
  loops.colour = "#1faee3",
  skipAnn = F,
  symmAnn = F,
  check.genome = T,
  smoothNA = F,
  fillNAtreshold = 2,
  rasterise = FALSE,
  addnames = TRUE,
  cut.off = NULL,
  colour_bar = FALSE,
  antoni = F
)

Arguments

exp1

The Hi-C experiment object: produced by construct.experiment().

exp2

Optional: a Hi-C experiment object.

chrom

Chromosome of the region of interest. Alternatively one of the following:

  • A 3-column, 1-row data.frame in BED-format.

  • A single character describing a locus in UCSC notation, e.g. "chr1:30,000,000-35,000,000"

The latter two options automatically provide the start and end arguments too.

start, end

Start and end position of the region of interest. Ignored if the chrom argument is a BED-format data.frame.

colour_lim, cut.off

A numeric of length 2 for the lower and upper colour limits of the hic-matrix plot. cut.off: older syntax.

chip

A list of feature tracks, can be bed structure (i.e. data frames) or a path to bigwig file (i.e. character variable), maximum length of 4. Placement is inner-top, outer-top, outer-left, inner-left.

inferno

White/Red/black or White/Red coloscale?

cexTicks

Change size of numbers on the axis

chip.colour

A vector of four, parallel to [chip], of the to use colour.

chip.yMax

A vector of four, parallel to [chip], of the maximum height of the biwigs. If only one value is given, all be set on this value.

type

Should a rectangle or a triangle be drawn? Note that for a triangle a 6th strand column should be included

guessType

If an element in the chip is a dataframe, infer the type from column 6? If true, column six should hold "+" and "-". If a row has other characters, we view this entry as no-oriention and thus plot a rectangle.

coplot

When drawing together two experiments: [dual] is bottom triangle exp2, top triangle exp1; [diff] plots a substraction of exp2-exp1

genes

Structure with gene information, will only be combined with bed structure

tads

BED-like dataframe or a list of these data.frames

tads.type

How to show TADS: upper, lower and or both

loops

BED-like dataframe or a list of these data.frames

loops.type

How to show loops: upper, lower and or both

tads.colour

Which colour do you want the TADs to have?

loops.radius

Set the size of the loop-circle to X bp. Can help visibility.

loops.colour

Which colour do you want the loops to have?

skipAnn

Do not plot outside-annotation. Can be used to plot other things next to the matrix.

symmAnn

Put features 1&2 also on verical (ignore chip-entries 3&4)

check.genome

Check if reference genomes in exp1 and exp2 are the same

smoothNA

Set to TRUE to perform a Nadaraya/Watson normalization. This will try to eliminate white stripes: this is only cosmetic and has no effect on the compartment-scores.

fillNAtreshold

Set the amount strength of outlier correction for fillNA.

rasterise

Set to true to use a bitmap raster instead of polygons.

addnames

When the coplot argument is "dual", display names of the samples? (default: TRUE)

colour_bar

A logical of length 1, indicating whether a colour-bar legend should be drawn at the right.

antoni

Logical: plot an explorer of the microscopic world

Value

A matrix-plot

Resolution recommendation

A resolution in the ballpark of (end - start) / 500.

Note

To plot genes, a gene-model data.frame must be made. This can be done via a multitude of ways (e.g. biomart, UCSC table browser). The resulting data.frame must have one exon per row with the following columns: geneID | transcriptID | chrom | txStart | txEnd | exonStart | exonEnd | strand. Alternatively, if you download the knowngene table from UCSC, you can directly use this table (with exons combined per row), by renaming exonStarts and exonEnds to exonStart and exonEnd.

Author(s)

Robin H. van der Weide, r.vd.weide@nki.nl

Elzo de Wit, e.d.wit@nki.nl

See Also

Other matrix plots: compartment_matrixplot(), insulation_matrixplot(), pyramid(), trans_matrixplot()

Examples

## Not run: 
# plot two matrices of Hap-1 cells, including their respective loop-calls
hic.matrixplot(
  exp1 = Hap1_Haarhuis2017_10kb,
  exp2 = Hap1_Sanborn2015_10kb,
  chrom = "chr7",
  start = 25e6,
  end = 30e6,
  loops = list(Haarhuis2017_Loops, sanborn2015_Loops),
  loops.colour = c("blue", "green"),
  loops.type = c("upper", "lower"),
  loops.resize = c(20e3, 20e3), # expand for visibility
  colour_lim = c(0, 25)
) # upper limit of contacts

## End(Not run)

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