loopPlot {diffloop} | R Documentation

## Visualize looping

### Description

`loopPlot` takes a `loops` object and a `GRanges` objectand shows all loops in region (where both anchors are present)

### Usage

    loopPlot(x, y, organism = "h", geneinfo = "NA", colorLoops = TRUE,
      cache = TRUE, showAnchorWidths = FALSE, maxCounts = -1)

    ## S4 method for signature 'loops,GRanges'
    loopPlot(x, y, organism = "h", geneinfo = "NA",
      colorLoops = TRUE, cache = TRUE, showAnchorWidths = FALSE,
      maxCounts = -1)

### Arguments

`x` | A loops object
`y` | A GRanges object containing region of interest
`organism` | 'h' for human or 'm' for mouse supported
`geneinfo` | A data.frame manually specifying annotation (see Examples)
`colorLoops` | Differentiates loops based on loop.type in loops object
`cache` | logic variable (default = TRUE) to use gene annotation from July.2015 freeze
`showAnchorWidths` | Display the width of the anchor on the plot? Default = FALSE
`maxCounts` | Number of counts associated with thickest loop. Default is largest count in region displayed

### Details

Basic plot function shows the looping in each sample. The intensity of the color is proportional to the number of counts observed for the particular loop relative to the other loops in the entire plot. If colorLoops is specified at TRUE, then the x object must be loops and it must have a loop.type column which can be generated from the `annotateLoops` function. Blue loops are CTCF loops; black are none; red are enhancer-promoter loops; orange are promoter-promoter loops; and purple are enhancer-enhancer loops. Plots use hg19 and mm9 annotation by default.

### Value

A plot object

### Examples

    # Print loops in region chr1:36000000-36300000
    library(GenomicRanges)
    rda<-paste(system.file('rda',package='diffloop'),'loops.small.rda',sep='/')
    load(rda)
    regA <- GRanges(c('1'),IRanges(start=c(36000000),end=c(36300000)))
    plot1 <- loopPlot(loops.small, regA)
    #Example of \code{geneinfo} table
    geneinfo <- data.frame(1,359345,359681,'RP5-8572K21.15','.',-1)
    names(geneinfo) <- c('chrom','start','stop','gene','strand')

[Package diffloop version 1.22.0 Index]