File: test_makeIdsForUniqueDataFrameRows.R

package info (click to toggle)
r-bioc-genomicfeatures 1.50.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,056 kB
  • sloc: makefile: 6; sh: 2
file content (16 lines) | stat: -rw-r--r-- 518 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
###

test_makeIdsForUniqueDataFrameRows <- function()
{
    x <- data.frame(
             chrom=c("chr2", "chr2", "chr2", "chr2", "chr1",
                     "chr2", "chr2", "chr1", "chr3", "chr1"),
             strand=c("+", "-", "-", "+", "+", "+", "+", "-", "-", "+"),
             start=c(5, 2, 2, 5, 4, 5, 5, 4, 2, 1),
             end=c(15, 12, 12, 15, 14, 13, 15, 14, 12, 11)
         )
    y <- unique(x)[GenomicFeatures:::makeIdsForUniqueDataFrameRows(x), ]
    row.names(y) <- NULL
    checkEquals(y, x)
}