This file is indexed.

/usr/lib/R/site-library/SummarizedExperiment/unitTests/test_Assays-class.R is in r-bioc-summarizedexperiment 1.8.0-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
test_bind_Assays <- function() {
    ## unnamed -- map by position
    l1 <- list(matrix(1, 3, 4), matrix(2, 3, 4))
    l2 <- list(matrix(3, 3, 4), matrix(4, 3, 4))
    a1 <- Assays(l1)
    a2 <- Assays(l2)

    target <- Map(rbind, l1, l2)
    current <- rbind(a1, a2)
    checkTrue(is(current, "ShallowSimpleListAssays"))
    checkIdentical(as(target, "SimpleList"), as(current, "SimpleList"))

    target <- Map(cbind, l1, l2)
    current <- cbind(a1, a2)
    checkTrue(is(current, "ShallowSimpleListAssays"))
    checkIdentical(as(target, "SimpleList"), as(current, "SimpleList"))

    ## named -- map by name
    l1 <- list(x=matrix(1, 3, 4), y=matrix(2, 3, 4))
    l2 <- list(y=matrix(4, 3, 4), x=matrix(3, 3, 4))
    a1 <- Assays(l1)
    a2 <- Assays(l2)

    target <- Map(rbind, l1, l2[match(names(l2), names(l1))])
    current <- rbind(a1, a2)
    checkTrue(is(current, "ShallowSimpleListAssays"))
    checkIdentical(as(target, "SimpleList"), as(current, "SimpleList"))

    target <- Map(cbind, l1, l2[match(names(l2), names(l1))])
    current <- cbind(a1, a2)
    checkTrue(is(current, "ShallowSimpleListAssays"))
    checkIdentical(as(target, "SimpleList"), as(current, "SimpleList"))
}

test_bind_higher_order_Assays <- function() {
    ## unnamed -- map by position
    l1 <- list(array(1, dim = c(3, 4, 5, 6)),
               array(2, dim = c(3, 4, 5, 6)))
    l2 <- list(array(4, dim = c(3, 4, 5, 6)),
               array(3, dim = c(3, 4, 5, 6)))
    a1 <- Assays(l1)
    a2 <- Assays(l2)

    target <- Map(arbind, l1, l2)
    current <- rbind(a1, a2)
    checkTrue(is(current, "ShallowSimpleListAssays"))
    checkIdentical(as(target, "SimpleList"), as(current, "SimpleList"))

    target <- Map(acbind, l1, l2)
    current <- cbind(a1, a2)
    checkTrue(is(current, "ShallowSimpleListAssays"))
    checkIdentical(as(target, "SimpleList"), as(current, "SimpleList"))

    ## named -- map by name
    l1 <- list(x = array(1, dim = c(3, 4, 5, 6)),
               y = array(2, dim = c(3, 4, 5, 6)))
    l2 <- list(y = array(4, dim = c(3, 4, 5, 6)),
               x = array(3, dim = c(3, 4, 5, 6)))
    a1 <- Assays(l1)
    a2 <- Assays(l2)

    target <- Map(arbind, l1, l2[match(names(l2), names(l1))])
    current <- rbind(a1, a2)
    checkTrue(is(current, "ShallowSimpleListAssays"))
    checkIdentical(as(target, "SimpleList"), as(current, "SimpleList"))

    target <- Map(acbind, l1, l2[match(names(l2), names(l1))])
    current <- cbind(a1, a2)
    checkTrue(is(current, "ShallowSimpleListAssays"))
    checkIdentical(as(target, "SimpleList"), as(current, "SimpleList"))
}

test_bind_error_on_incompatible_dimension_Assays <- function() {
    l1 <- list(x = array(1, dim = c(3, 4, 5, 6)),
               y = array(2, dim = c(3, 4, 5, 6)))
    l2 <- list(y = matrix(4, 3, 4), x = matrix(3, 3, 4))
    a1 <- Assays(l1)
    a2 <- Assays(l2)

    ## arbind
    checkException(rbind(a1, a2), silent = TRUE)
    checkException(arbind(l1[[1]], l2[[1]]), silent = TRUE)

    ## acbind
    checkException(cbind(a1, a2), silent = TRUE)
    checkException(acbind(l1[[1]], l2[[1]]), silent = TRUE)
}