File: test-colnameOrder.R

package info (click to toggle)
r-bioc-multiassayexperiment 1.24.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 996 kB
  • sloc: makefile: 2
file content (14 lines) | stat: -rw-r--r-- 517 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
context("Colname consistency after subsetting")

test_that("when columns in different order, subset ops will rearrange them", {
    sampMap <- sampleMap(mae)
    ## Reverse the order of the samples in the first assay
    newSampMap <- rbind(sampMap[4:1, ], sampMap[5:nrow(sampMap), ])

    sampleMap(mae) <- newSampMap

    # Rearrange ExperimentList colnames using sampleMap "assay" column
    mae <- mae[, rownames(colData(mae)), ]

    expect_true(identical(sampleMap(mae)[1:4, "colname"], colnames(mae)[[1]]))
})