Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drugsens
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OvCa research
drugsens
Commits
538f82ed
Commit
538f82ed
authored
1 year ago
by
Flavio Lombardo
Browse files
Options
Downloads
Patches
Plain Diff
Add more unit testing, fix typos
parent
b242240a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
DESCRIPTION
+3
-2
3 additions, 2 deletions
DESCRIPTION
tests/testthat/test_cases.R
+60
-20
60 additions, 20 deletions
tests/testthat/test_cases.R
with
63 additions
and
22 deletions
DESCRIPTION
+
3
−
2
View file @
538f82ed
Package: DRUGSENS
Title: Get Data From QuPath For Data Analysis
Title: DRUGSENS is a R-package that allows users to automatically analyze QuPath™'s output data from imaging analysis.
In addition, it will automatically extract metadata from the QuPath's data.
Version: 0.1.0
BugReports: https://git.scicore.unibas.ch/ovca-research/DRUGSENS/issues
Authors@R: c(
...
...
@@ -9,7 +10,7 @@ Authors@R: c(
person("University of Basel and University Hospital Basel", role = c("cph"))
)
URL: https://git.scicore.unibas.ch/ovca-research/DRUGSENS/
Maintainer: Flavio
C.
Lombardo <flavio.lombardo@unibas.ch
t
>
Maintainer: Flavio Lombardo <flavio.lombardo@unibas.ch>
Description: This package simplifies the analysis of QuPath data is complementary to the STAR Protocol:
"DRUG-SENS: Quantification of Drug Sensitivity in 3D Patient-derived Ovarian Cancer Models"
License: MIT + file LICENSE
...
...
This diff is collapsed.
Click to expand it.
tests/testthat/test_cases.R
+
60
−
20
View file @
538f82ed
...
...
@@ -39,28 +39,68 @@ test_that("list_all_files returns correct file paths", {
})
test_that
(
"Check that the config.txt is made and can be read"
,
{
test_that
(
"Check that the config.txt is made and
that it
can be read"
,
{
expect_silent
(
make_run_config
())
expect_silent
(
make_run_config
())
expect_true
(
file.exists
(
path.expand
(
path
=
paste0
(
getwd
(),
"/config_DRUGSENS.txt"
))))
expect_true
(
exists
(
"list_of_relabeling"
))
})
# WIP add for the regex in processing the data
# test_that("Check that parsig does work", {
#
# Image1 <- "B516_Ascites_2023-11-25_DOC2020-12-14_CarboplatinPaclitaxel_100_uM_10_nM_Ecad_cCasp3_(series 01).tif"
# Image2 <- "A8759_Spleen_2020.11.10_DOC2001.10.05_compoundX34542_1000_uM_EpCAM_Ecad_cCasp3_(series 01).tif"
# Image3 <- "A8759_Spleen_2020.11.10_DOC2001.10.05_compoundX34542_1000_uM_EpCAM_Ecad_cCasp3_(series 01).tif"
# Image4 <- "B38_Eye_2023.11.10_DOC2023.10.05_GentamicinePaclitaxel_100_uM_10_nM_EpCAM_Ecad_cCasp3_(series 01).tif"
#
# # make a dataframe of those images examples
# dt <- data.frame(
# Image = c(Image1, Image2, Image3, Image4),
# Example = c("Protocol", "Fake", "Fake", "Fake")
# )
#
# # run parser
# dt1 <- DRUGSENS:::string_parsing(dt)
#
# expect_true(exists("list_of_relabeling"))
# })
test_that
(
"Check that the example file can be read correctly"
,
{
datas
<-
DRUGSENS
::
data_binding
(
path_to_the_projects_folder
=
system.file
(
"extdata/to_merge/"
,
package
=
"DRUGSENS"
))
expect_true
(
exists
(
"datas"
))
expect_equal
(
ncol
(
datas
),
expected
=
28
)
})
test_that
(
"Check that the drugs combination have two unit and two concentration and control none"
,
{
datas
<-
DRUGSENS
::
data_binding
(
path_to_the_projects_folder
=
system.file
(
"extdata/to_merge/"
,
package
=
"DRUGSENS"
))
expect_true
(
datas
[
datas
$
Treatment
==
"GentamicinePaclitaxel"
,
"Treatment_complete"
][
1
]
==
"GentamicinePaclitaxel100uM-10uM"
||
datas
[
datas
$
Treatment
==
"GentamicinePaclitaxel"
,
"Treatment_complete"
][
1
]
==
"gentamicinePaclitaxel100uM-10uM"
)
expect_true
(
datas
[
datas
$
Treatment
==
"Control"
,
"Treatment_complete"
][
1
]
==
"Control"
||
datas
[
datas
$
Treatment
==
"Control"
,
"Treatment_complete"
][
1
]
==
"control"
)
})
test_that
(
"Config file was there and removed correctly"
,
{
expect_silent
(
file.remove
(
path.expand
(
paste0
(
getwd
(),
"/config_DRUGSENS.txt"
)))
)
})
test_that
(
"The parsing is working"
,
{
input_data
<-
data.frame
(
Image
=
"PID1_Tissue1_2024-02-13_DOC2024.02.13_TreatmentRana_10_uM_15_nm_Replica_(series.10)"
)
expected_output
<-
data.frame
(
Image
=
"PID1_Tissue1_2024-02-13_DOC2024.02.13_TreatmentRana_10_uM_15_nm_Replica_(series.10)"
,
Image_number
=
"series.10"
,
PID
=
"PID1"
,
Tissue
=
"Tissue1"
,
Date1
=
"2024-02-13"
,
DOC
=
"2024.02.13"
,
ReplicaOrNot
=
"Replica"
,
Treatment
=
"TreatmentRana"
,
Concentration1
=
"10"
,
Concentration2
=
"15"
,
ConcentrationUnits1
=
"uM"
,
ConcentrationUnits2
=
"nm"
,
Treatment_complete
=
"TreatmentRana10uM-15nm"
)
expect_equal
(
DRUGSENS
:::
string_parsing
(
input_data
),
expected
=
expected_output
)
})
test_that
(
"Another parsing test"
,
{
input_data
<-
data.frame
(
Image
=
"B516_Ascites_2023-11-25_DOC2020-12-14_dmso_rep_Ecad_cCasp3_(series 01).tif"
)
expected_output
<-
data.frame
(
Image
=
"B516_Ascites_2023-11-25_DOC2020-12-14_dmso_rep_Ecad_cCasp3_(series 01).tif"
,
Image_number
=
"series 01"
,
PID
=
"B516"
,
Tissue
=
"Ascites"
,
Date1
=
"2023-11-25"
,
DOC
=
"2020-12-14"
,
ReplicaOrNot
=
"Replica"
,
Treatment
=
"dmso"
,
Concentration1
=
NA_character_
,
#WIP
Concentration2
=
NA_integer_
,
ConcentrationUnits1
=
NA_character_
,
ConcentrationUnits2
=
NA_character_
,
Treatment_complete
=
"dmso"
)
expect_equal
(
DRUGSENS
:::
string_parsing
(
input_data
),
expected
=
expected_output
)
# Image1 <- "B516_Ascites_2023-11-25_DOC2020-12-14_CarboplatinPaclitaxel_100_uM_10_nM_Ecad_cCasp3_(series 01).tif"
# Image2 <- "A8759_Spleen_2020.11.10_DOC2001.10.05_compoundX34542_1000_uM_EpCAM_Ecad_cCasp3_(series 01).tif"
# Image3 <- "A8759_Spleen_2020.11.10_DOC2001.10.05_compoundX34542_1000_uM_EpCAM_Ecad_cCasp3_(series 01).tif"
# Image4 <- "B38_Eye_2023.11.10_DOC2023.10.05_GentamicinePaclitaxel_100_uM_10_nM_EpCAM_Ecad_cCasp3_(series 01).tif"
})
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment