Skip to content

Commit

Permalink
test #4 for solving unit test issue with github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
phauchamps committed May 11, 2024
1 parent 6cbdc91 commit 2402840
Show file tree
Hide file tree
Showing 22 changed files with 4,576 additions and 1,021 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
182 changes: 182 additions & 0 deletions tests/testthat/_snaps/gating/singletsgate-default-channels.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
182 changes: 182 additions & 0 deletions tests/testthat/_snaps/gating/singletsgate-selected-channels.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
307 changes: 307 additions & 0 deletions tests/testthat/_snaps/ggplots/ggplotevents-2d-linear-double.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
183 changes: 183 additions & 0 deletions tests/testthat/_snaps/ggplots/ggplotevents-2d-x-linear-y-logicle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
186 changes: 186 additions & 0 deletions tests/testthat/_snaps/ggplots/ggplotevents-2d-x-logicle-y-linear.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
172 changes: 172 additions & 0 deletions tests/testthat/_snaps/ggplots/ggplotfilterevents-2d-5000-points.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
172 changes: 172 additions & 0 deletions tests/testthat/_snaps/ggplots/ggplotfilterevents-2d-all-points.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
172 changes: 172 additions & 0 deletions tests/testthat/_snaps/ggplots/ggplotfilterevents-2d-small-size.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
168 changes: 168 additions & 0 deletions tests/testthat/_snaps/ggplots/ggplotfilterevents-2d-translist-run.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
222 changes: 111 additions & 111 deletions tests/testthat/test-gating.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,114 +13,114 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details (<http://www.gnu.org/licenses/>).

# # obtain OMIP021UTSamples, light-weight version used specifically for these
# # unit tests
# path <- system.file("scripts",
# package = "CytoPipeline"
# )
#
# source(file.path(path,"MakeOMIP021UTSamples.R"))
#
# test_that("singletsGate works", {
# mySingletsGate <- singletsGate(OMIP021UTSamples[[1]])
#
# selectedSinglets <- flowCore::filter(
# OMIP021UTSamples[[1]],
# mySingletsGate
# )
# ff_l <- flowCore::Subset(OMIP021UTSamples[[1]], selectedSinglets)
#
# linRange <- c(0, 250000)
# p <- ggplotFilterEvents(
# ffPre = OMIP021UTSamples[[1]],
# ffPost = ff_l,
# seed = 1,
# xChannel = "FSC-A", xLinearRange = linRange,
# yChannel = "FSC-H", yLinearRange = linRange
# )
#
# vdiffr::expect_doppelganger("singletsGate default channels", fig = p)
#
# mySingletsGate <- singletsGate(OMIP021UTSamples[[1]], nmad = 3)
#
# selectedSinglets <- flowCore::filter(
# OMIP021UTSamples[[1]],
# mySingletsGate
# )
# ff_l <- flowCore::Subset(OMIP021UTSamples[[1]], selectedSinglets)
#
# p <- ggplotFilterEvents(
# ffPre = OMIP021UTSamples[[1]],
# ffPost = ff_l,
# seed = 1,
# xChannel = "FSC-A", xLinearRange = linRange,
# yChannel = "FSC-H", yLinearRange = linRange
# )
#
# vdiffr::expect_doppelganger(
# "singletsGate default channels with fixed nmad",
# fig = p
# )
#
# mySingletsGate <- singletsGate(OMIP021UTSamples[[1]],
# channel1 = "SSC-A",
# channel2 = "SSC-H"
# )
#
# selectedSinglets <- flowCore::filter(
# OMIP021UTSamples[[1]],
# mySingletsGate
# )
# ff_l <- flowCore::Subset(OMIP021UTSamples[[1]], selectedSinglets)
#
# p <- ggplotFilterEvents(
# ffPre = OMIP021UTSamples[[1]],
# ffPost = ff_l,
# seed = 1,
# xChannel = "SSC-A", xLinearRange = linRange,
# yChannel = "SSC-H", yLinearRange = linRange
# )
#
# vdiffr::expect_doppelganger("singletsGate selected channels", fig = p)
#
# # test application of two gates one after the other
# singletsGate1 <- singletsGate(OMIP021UTSamples[[1]], nmad = 3)
# singletsGate2 <- singletsGate(OMIP021UTSamples[[1]],
# channel1 = "SSC-A",
# channel2 = "SSC-H",
# filterId = "Singlets2"
# )
#
# singletCombinedGate <- singletsGate1 & singletsGate2
#
# selectedSinglets <- flowCore::filter(
# OMIP021UTSamples[[1]],
# singletCombinedGate
# )
#
# ff_l <- flowCore::Subset(OMIP021UTSamples[[1]], selectedSinglets)
#
# p1 <- ggplotFilterEvents(
# ffPre = OMIP021UTSamples[[1]],
# ffPost = ff_l,
# seed = 1,
# xChannel = "FSC-A", xLinearRange = linRange,
# yChannel = "FSC-H", yLinearRange = linRange
# )
#
# p2 <- ggplotFilterEvents(
# ffPre = OMIP021UTSamples[[1]],
# ffPost = ff_l,
# seed = 1,
# xChannel = "SSC-A", xLinearRange = linRange,
# yChannel = "SSC-H", yLinearRange = linRange
# )
#
#
# vdiffr::expect_doppelganger("singletsGates one after the other - fig1",
# fig = p1
# )
# vdiffr::expect_doppelganger("singletsGates one after the other - fig2",
# fig = p2
# )
# })
# obtain OMIP021UTSamples, light-weight version used specifically for these
# unit tests
path <- system.file("scripts",
package = "CytoPipeline"
)

source(file.path(path,"MakeOMIP021UTSamples.R"))

test_that("singletsGate works", {
mySingletsGate <- singletsGate(OMIP021UTSamples[[1]])

selectedSinglets <- flowCore::filter(
OMIP021UTSamples[[1]],
mySingletsGate
)
ff_l <- flowCore::Subset(OMIP021UTSamples[[1]], selectedSinglets)

linRange <- c(0, 250000)
p <- ggplotFilterEvents(
ffPre = OMIP021UTSamples[[1]],
ffPost = ff_l,
seed = 1,
xChannel = "FSC-A", xLinearRange = linRange,
yChannel = "FSC-H", yLinearRange = linRange
)

vdiffr::expect_doppelganger("singletsGate default channels", fig = p)

mySingletsGate <- singletsGate(OMIP021UTSamples[[1]], nmad = 3)

selectedSinglets <- flowCore::filter(
OMIP021UTSamples[[1]],
mySingletsGate
)
ff_l <- flowCore::Subset(OMIP021UTSamples[[1]], selectedSinglets)

p <- ggplotFilterEvents(
ffPre = OMIP021UTSamples[[1]],
ffPost = ff_l,
seed = 1,
xChannel = "FSC-A", xLinearRange = linRange,
yChannel = "FSC-H", yLinearRange = linRange
)

vdiffr::expect_doppelganger(
"singletsGate default channels with fixed nmad",
fig = p
)

mySingletsGate <- singletsGate(OMIP021UTSamples[[1]],
channel1 = "SSC-A",
channel2 = "SSC-H"
)

selectedSinglets <- flowCore::filter(
OMIP021UTSamples[[1]],
mySingletsGate
)
ff_l <- flowCore::Subset(OMIP021UTSamples[[1]], selectedSinglets)

p <- ggplotFilterEvents(
ffPre = OMIP021UTSamples[[1]],
ffPost = ff_l,
seed = 1,
xChannel = "SSC-A", xLinearRange = linRange,
yChannel = "SSC-H", yLinearRange = linRange
)

vdiffr::expect_doppelganger("singletsGate selected channels", fig = p)

# test application of two gates one after the other
singletsGate1 <- singletsGate(OMIP021UTSamples[[1]], nmad = 3)
singletsGate2 <- singletsGate(OMIP021UTSamples[[1]],
channel1 = "SSC-A",
channel2 = "SSC-H",
filterId = "Singlets2"
)

singletCombinedGate <- singletsGate1 & singletsGate2

selectedSinglets <- flowCore::filter(
OMIP021UTSamples[[1]],
singletCombinedGate
)

ff_l <- flowCore::Subset(OMIP021UTSamples[[1]], selectedSinglets)

p1 <- ggplotFilterEvents(
ffPre = OMIP021UTSamples[[1]],
ffPost = ff_l,
seed = 1,
xChannel = "FSC-A", xLinearRange = linRange,
yChannel = "FSC-H", yLinearRange = linRange
)

p2 <- ggplotFilterEvents(
ffPre = OMIP021UTSamples[[1]],
ffPost = ff_l,
seed = 1,
xChannel = "SSC-A", xLinearRange = linRange,
yChannel = "SSC-H", yLinearRange = linRange
)


vdiffr::expect_doppelganger("singletsGates one after the other - fig1",
fig = p1
)
vdiffr::expect_doppelganger("singletsGates one after the other - fig2",
fig = p2
)
})
Loading

0 comments on commit 2402840

Please sign in to comment.