annotateAnchors {diffloop} | R Documentation

## Add meta data column to anchors based on GRanges

### Description

`annotateAnchors` adds a logical variable to meta data columns in the anchors based on a GRanges object of features' genomic coordinates

### Usage

    annotateAnchors(dlo, features, featureName, maxgap)

    ## S4 method for signature 'loops,GRanges,character,missing'
    annotateAnchors(dlo, features,
      featureName, maxgap = 1000)

    ## S4 method for signature 'loops,GRanges,character,numeric'
    annotateAnchors(dlo, features,
      featureName, maxgap)

### Arguments

`dlo` | A loops object whose anchors will be annotated
`features` | A Granges object corresponding to locations of interest
`featureName` | A string that will be the mcol name in anchors
`maxgap` | A value of max permissible gap between a feature and anchor

### Details

This function adds column of TRUE/FALSE values on the loops object anchors whether a feature is observed nearby in `features`. The name of this column that will be in the anchors GRanges object is specified by a user defined string `featureName`. Gap tolerance between a feature and an anchor is specified by `maxgap`, where the default is 1,000bp.

### Value

A loops object with new meta data column in anchors

### Examples

    # Annotate whether anchors are near a gene body; within 1kb
    rda<-paste(system.file('rda',package='diffloop'),'loops.small.rda',sep='/')
    load(rda)
    gb <-getHumanGenes()
    loops.small <- annotateAnchors(loops.small,gb,'nearGeneBody')

    # Adding close to gene bodies with no gap tolerance
    loops.small <- annotateAnchors(loops.small,gb,'inGeneBody',0)

[Package diffloop version 1.14.0 Index]