Skip to contents

This function takes a linkSet object, identifies repeated interactions (where both bait and other end are repeated), makes them unique, and counts the number of repetitions for each unique interaction.

Usage

# S4 method for class 'linkSet'
countInteractions(x, baitRegions = TRUE)

Arguments

x

A linkSet object

Value

A list containing:

unique_linkSet

A new linkSet object with unique interactions

interaction_counts

A data frame with counts for each unique interaction

Examples

data(linkExample)
linkSet = c(linkExample,linkExample)
result <- countInteractions(linkSet)
result
#> linkSet object with 5 interactions and 2 metadata columns:
#>              bait     seqnames_oe ranges_oe | anchor1.symbol     count
#>       <character>           <Rle> <IRanges> |    <character> <integer>
#>   [1]       Gene1 ---        chr1     50-59 |          Gene1         2
#>   [2]       Gene1 ---        chr2   150-159 |          Gene1         2
#>   [3]       Gene2 ---        chr2   250-259 |          Gene2         2
#>   [4]       Gene3 ---        chr4   350-359 |          Gene3         2
#>   [5]       Gene3 ---        chr4   450-459 |          Gene3         2
#>   -------
#>   regions: 10 ranges and 0 metadata columns
#>   seqinfo: 4 sequences from an unspecified genome; no seqlengths