inst/unitTests/test_ExpressionSet.R

test_ES_subset <- function() {
    data(sample.ExpressionSet)
    eset <- sample.ExpressionSet
    map <- getAnnMap("SYMBOL", annotation(eset))

    gss <- getBroadSets(system.file("extdata", "Broad.xml",
                                    package="GSEABase"))
    es <- eset[gss[[2]],]

    ids <- mget(geneIds(gss[[2]]), revmap(map), ifnotfound=NA)
    ids <- ids[!is.na(ids)]

    checkEquals(sum(unique(unlist(ids)) %in% featureNames(eset)),
                unname(nrow(es)))
    m <- mapIdentifiers(gss[[2]], AnnotationIdentifier(annotation(es)))
    checkTrue(all(featureNames(es) %in% geneIds(m)))
    checkTrue(all.equal(es, sample.ExpressionSet[m,]))
}

Try the GSEABase package in your browser

Any scripts or data that you put into this service are public.

GSEABase documentation built on Dec. 13, 2020, 2 a.m.