Learn R Programming

diffloop (version 1.0.2)

union,loops,loops-method: Combine two loops objects

Description

union combines two loops objects' interactions and anchors and populates the colData matrix where available

Usage

## S3 method for class 'loops,loops':
union(x, y)

Arguments

x
A loops object
y
A loops object

Value

  • A loops obect

Details

This function returns a single loops object that has all the anchors and interactions contained in the two loops objects that were part of the input. However, when the two objects have different samples, the counts matrix will contain missing values (e.g. when loop counts in x are not in y, those values are unknown). While the number of interactions, colData, and anchors should be correct, we need to correct the counts using a subsetting function. The row data gets re-initialized here to only the loop widths

Examples

Run this code
# divide and recombine samples
rda<-paste(system.file('rda',package='diffloop'),'loops.small.rda',sep='/')
load(rda)
naive <- loops.small[,1:2]
primed <- loops.small[,3:4]
np <- union(naive, primed)
# Subset from full to get correct counts
c.np <- loopsSubset(np, loops.small)

Run the code above in your browser using DataLab