Learn R Programming

diffloop (version 1.0.2)

annotateAnchors: Add meta data column to anchors based on .bed file

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)

## S3 method for class 'loops,GRanges,character,missing': annotateAnchors(dlo, features, featureName, maxgap = 1000)

## S3 method for class '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

Value

  • A loops object with new meta data column in anchors

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.

Examples

Run this code
# 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)

Run the code above in your browser using DataLab