union,loops,loops-method {diffloop} | R Documentation

## Combine two loops objects

### Description

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

### Usage

    ## S4 method for signature 'loops,loops'
    union(x, y)

### Arguments

`x` | A loops object
`y` | A loops object

### 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

### Value

A loops obect

### Examples

    # 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)

[Package diffloop version 1.16.0 Index]