Skip to content

Commit

Permalink
Add test for detection of ties
Browse files Browse the repository at this point in the history
Testthat test for  "Ties detection in ranking works"
  • Loading branch information
ToledoEM authored Feb 21, 2018
1 parent ba2b96d commit 1646d12
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/testthat/test_gsea_analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,18 @@ test_that("fgseaLabel works", {
fgseaRes <- fgseaLabel(pathways, mat, labels, nperm = 1000, minSize = 15, maxSize = 500)

})

test_that("Ties detection in ranking works",{
data(examplePathways)
data(exampleRanks)
exampleRanks.ties <- exampleRanks
name20<- names(exampleRanks.ties[42])
exampleRanks.ties[41] <- exampleRanks.ties[42]
names(exampleRanks.ties[41])<-name20

expect_silent(fgsea(examplePathways, exampleRanks, nperm=100,minSize=50, maxSize=10,nproc = 1))

expect_warning( fgsea(examplePathways, exampleRanks.ties, nperm=100,minSize=50, maxSize=10,nproc = 1))


})

0 comments on commit 1646d12

Please sign in to comment.