establish_bijection {idr2d} | R Documentation

## Finds One-to-One Correspondence between Peaks or interactions from Replicate 1 and 2

### Description

This method establishes a bijective assignment between observations (genomic peaks in case of ChIP-seq, genomic interactions in case of ChIA-PET, HiChIP, and Hi-C) from replicate 1 and 2. An observation in replicate 1 is assigned to an observation in replicate 2 if and only if (1) the observation loci in both replicates overlap (or the gap between them is less than or equal to `max_gap`), and (2) there is no other observation in replicate 2 that overlaps with the observation in replicate 1 and has a lower ambiguity resolution value.

### Usage

    establish_bijection(
      rep1_df,
      rep2_df,
      analysis_type = c("IDR1D", "IDR2D"),
      ambiguity_resolution_method = c("overlap", "midpoint", "value"),
      max_gap = -1L
    )

### Arguments

`rep1_df` | data frame of observations (i.e., genomic peaks or genomic interactions) of replicate 1. If `analysis_type` is IDR1D, the columns of `rep1_df` are described in `establish_bijection1d`, otherwise in `establish_bijection2d`
`rep2_df` | data frame of observations (i.e., genomic peaks or genomic interactions) of replicate 2. Same columns as `rep1_df`.
`analysis_type` | "IDR2D" for genomic interaction data sets, "IDR1D" for genomic peak data sets
`ambiguity_resolution_method` | defines how ambiguous assignments (when one interaction or peak in replicate 1 overlaps with multiple interactions or peaks in replicate 2 or vice versa) are resolved. For available methods, see `establish_overlap1d` or `establish_overlap2d`, respectively.
`max_gap` | integer; maximum gap in nucleotides allowed between two anchors for them to be considered as overlapping (defaults to -1, i.e., overlapping anchors)

### Value

See `establish_bijection1d` or `establish_bijection2d`, respectively.

### Examples

    rep1_df <- idr2d:::chipseq$rep1_df
    rep1_df$value <- preprocess(rep1_df$value, "log")

    rep2_df <- idr2d:::chipseq$rep2_df
    rep2_df$value <- preprocess(rep2_df$value, "log")

    mapping <- establish_bijection(rep1_df, rep2_df, analysis_type = "IDR1D")

[Package idr2d version 1.8.1 Index]