dot-remove_duplicates: remove positional read duplicates from data.table

Description Usage Arguments Value Examples

Description

remove positional read duplicates from data.table

Usage

1
.remove_duplicates(reads_dt, max_dupes)

Arguments

reads_dt

a data.table containing read span information. required columns are which_label, start, end, and strand.

max_dupes

integer >= 1, the maximum allowed duplicates per position.

Value

data.table with reads in excess of max_dupes removed

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(data.table)
n = 4
dt = data.table(
  which_label = seq_len(n),
  seqnames = "chr1",
  strand = c("+", "-"),
  start = seq_len(n),
  end = seq_len(n) + 10
)
dt[, width := end - start + 1]
make_dupes = seq_len(nrow(dt))
make_dupes = rep(make_dupes, make_dupes)
dt = dt[make_dupes]
lapply(1: n, function(x)peakrefine:::.remove_duplicates(dt, max_dupes = x))

jrboyd/peakrefine documentation built on July 30, 2020, 7:13 p.m.