Skip to content

Commit 8537c71

Browse files
committed
Update package to version 1.15.1
1 parent 29da895 commit 8537c71

File tree

5 files changed

+54
-40
lines changed

5 files changed

+54
-40
lines changed

DESCRIPTION

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
Package: methylInheritance
2-
Version: 1.15.0
3-
Date: 2016-10-25
2+
Version: 1.15.1
3+
Date: 2021-04-06
44
Title: Permutation-Based Analysis associating Conserved Differentially
55
Methylated Elements Across Multiple Generations to a Treatment Effect
66
Description: Permutation analysis, based on Monte Carlo sampling, for
77
testing the hypothesis that the number of conserved
88
differentially methylated elements, between several
99
generations, is associated to an effect inherited from a
1010
treatment and that stochastic effect can be dismissed.
11-
Author: Astrid Deschênes, Pascal Belleau and Arnaud Droit
12-
Author@R: c(person("Astrid", "Deschênes", email="adeschen@hotmail.com",
13-
role=c("cre","aut")), person("Pascal", "Belleau",
14-
email="pascal.belleau@crchuq.ulaval.ca", role=c("aut")),
11+
Authors@R: c(person("Astrid", "Deschênes", email="adeschen@hotmail.com",
12+
role=c("cre","aut"), comment = c(ORCID = "0000-0001-7846-6749")),
13+
person("Pascal", "Belleau", email="pascal_belleau@hotmail.com",
14+
role=c("aut"), comment = c(ORCID = "0000-0002-0802-1071")),
1515
person("Arnaud", "Droit",
1616
email="arnaud.droit@crchuq.ulaval.ca", role=c("aut")))
1717
Depends: R (>= 3.5)
@@ -26,5 +26,4 @@ VignetteBuilder: knitr
2626
biocViews: BiologicalQuestion, Epigenetics, DNAMethylation,
2727
DifferentialMethylation, MethylSeq, Software, ImmunoOncology,
2828
StatisticalMethod, WholeGenome, Sequencing
29-
Maintainer: Astrid Deschenes <adeschen@hotmail.com>
3029
RoxygenNote: 7.1.1

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ importFrom(ggplot2,xlab)
3939
importFrom(ggplot2,ylab)
4040
importFrom(gridExtra,grid.arrange)
4141
importFrom(gridExtra,tableGrob)
42+
importFrom(methods,is)
4243
importFrom(methods,new)
4344
importFrom(methylKit,calculateDiffMeth)
4445
importFrom(methylKit,filterByCoverage)

R/methylInheritanceInternalMethods.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ validateRunPermutation <- function(methylKitData,
285285
#'
286286
#' @author Astrid Deschenes
287287
#' @importFrom S4Vectors isSingleInteger isSingleNumber
288+
#' @importFrom methods is
288289
#' @keywords internal
289290
validateRunObservation <- function(methylKitData,
290291
type, outputDir,
@@ -305,7 +306,7 @@ validateRunObservation <- function(methylKitData,
305306
}
306307

307308
## Validate that methylKitData is a list of methylRawList
308-
if (class(methylKitData) != "list" ||
309+
if (!is(methylKitData, "list") ||
309310
!all(sapply(methylKitData, class) == "methylRawList")) {
310311
stop(paste0("methylKitData must be a list containing ",
311312
"\"methylRawList\" entries; each entry must contain ",
@@ -443,14 +444,15 @@ validateRunObservation <- function(methylKitData,
443444
#'
444445
#' @author Astrid Deschenes
445446
#' @importFrom S4Vectors isSingleInteger isSingleNumber
447+
#' @importFrom methods is
446448
#' @keywords internal
447449
validateExtractInfo <- function(allResults, type, inter, position) {
448450

449451
if (!is.numeric(position) || floor(position) != position || position < 1) {
450452
stop("position must be a positive integer")
451453
}
452454

453-
if (!"methylInheritanceAllResults" %in% class(allResults)) {
455+
if (!is(allResults, "methylInheritanceAllResults")) {
454456
stop("allResults must be of class \"methylInheritanceAllResults\"")
455457
}
456458

inst/NEWS

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1+
CHANGES IN VERSION 1.15.1
2+
------------------------
3+
4+
BUG FIXES AND IMPROVEMENTS
5+
6+
o Fix bug causing problem when using loadConvergenceData() with a different directory for the observation file and the permutation files.
7+
8+
19
CHANGES IN VERSION 1.5.1
210
------------------------
311

412
SIGNIFICANT USER-VISIBLE CHANGES
513

614
o New citation referring to the associated published article in Nucleic Acids Research.
715

16+
817
CHANGES IN VERSION 1.1.1
918
------------------------
1019

inst/unitTests/test_methylInheritanceMethods.R

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
###################################################
99

1010
METHYL_OBJ_FILE_01 <- system.file("extdata", "methylObj_001.RDS",
11-
package = "methylInheritance")
11+
package="methylInheritance")
1212

1313
METHYL_OBJ_01 <- readRDS(METHYL_OBJ_FILE_01)
1414

15-
TEST_DIR <- system.file("extdata", "TEST", package = "methylInheritance")
15+
TEST_DIR <- system.file("extdata", "TEST", package="methylInheritance")
1616

1717
data("methylInheritanceResults")
1818

@@ -41,15 +41,15 @@ test.runPermutation_methylKitData_not_valid_RDS <- function() {
4141
message <- paste0(" test.runPermutation_methylKitData_not_valid_RDS() ",
4242
"- Not valid file for methylKitData did not generated expected message.")
4343

44-
checkEquals(obs, exp, msg = message)
44+
checkEquals(obs, exp, msg=message)
4545
}
4646

4747
## Test when all parameters valid
4848
test.runPermutation_good_001 <- function() {
4949

5050
if (!dir.exists("test_002")) {
51-
dir.create("test_002/SITES/", recursive = TRUE)
52-
dir.create("test_002/TILES/", recursive = TRUE)
51+
dir.create("test_002/SITES/", recursive=TRUE)
52+
dir.create("test_002/TILES/", recursive=TRUE)
5353
}
5454

5555
obs <- runPermutation(methylKitData = METHYL_OBJ_FILE_01, runObservationAnalysis = FALSE,
@@ -119,25 +119,26 @@ test.runObservation_methylKitData_not_valid <- function() {
119119
message <- paste0(" test.runObservation_methylKitData_not_valid() ",
120120
"- Not valid file for methylKitData did not generated expected message.")
121121

122-
checkEquals(obs, exp, msg = message)
122+
checkEquals(obs, exp, msg=message)
123123
}
124124

125125
## Test when all parameters valid
126126
test.runObservation_good_001 <- function() {
127127

128128
if (!dir.exists("test_002")) {
129-
dir.create("test_002/SITES/", recursive = TRUE)
129+
dir.create("test_002/SITES/", recursive=TRUE)
130130
}
131131

132132
obs <- runObservation(
133-
methylKitData = METHYL_OBJ_FILE_01, type = "sites",
134-
outputDir = "test_002", nbrCoresDiffMeth = 1,
135-
minReads = 10, minMethDiff = 5, qvalue = 0.05,
136-
maxPercReads = 99.9, destrand = FALSE, minCovBasesForTiles = 2,
137-
tileSize = 1000, stepSize = 100, vSeed = 200, saveInfoByGeneration = FALSE)
133+
methylKitData=METHYL_OBJ_FILE_01, type="sites",
134+
outputDir="test_002", nbrCoresDiffMeth=1,
135+
minReads=10, minMethDiff=5, qvalue = 0.05,
136+
maxPercReads=99.9, destrand=FALSE, minCovBasesForTiles=2,
137+
tileSize=1000, stepSize=100, vSeed=200,
138+
saveInfoByGeneration=FALSE)
138139

139-
obsV <- methylInheritance::loadAllRDSResults(permutationResultsDir = NULL,
140-
analysisResultsDir = "test_002")
140+
obsV <- methylInheritance::loadAllRDSResults(permutationResultsDir=NULL,
141+
analysisResultsDir="test_002")
141142

142143
exp <- list()
143144
exp[["OBSERVATION"]] <- list()
@@ -152,8 +153,8 @@ test.runObservation_good_001 <- function() {
152153
message <- paste0(" test.runObservation_good_001() ",
153154
"- All valid parameters did not generated expected result.")
154155

155-
checkEquals(obs, 0, msg = message)
156-
checkEquals(obsV$OBSERVATION, exp$OBSERVATION, msg = message)
156+
checkEquals(obs, 0, msg=message)
157+
checkEquals(obsV$OBSERVATION, exp$OBSERVATION, msg=message)
157158
}
158159

159160

@@ -176,7 +177,7 @@ test.extractInfo_good_01 <- function() {
176177
message <- paste0(" test.extractInfo_good_01() ",
177178
"- Valid parameters for formatForGraph did not generated expected results.")
178179

179-
checkEquals(obs, exp, msg = message)
180+
checkEquals(obs, exp, msg=message)
180181
}
181182

182183

@@ -231,7 +232,7 @@ test.loadAllRDSResults_good_01 <- function() {
231232
"- Valid parameters for loadAllRDSResults() ",
232233
"did not generated expected results.")
233234

234-
checkEquals(obs, exp, msg = message)
235+
checkEquals(obs, exp, msg=message)
235236
}
236237

237238

@@ -270,7 +271,7 @@ test.mergePermutationAndObservation_permutation_not_list <- function() {
270271
message <- paste0(" test.mergePermutationAndObservation_permutation_not_list() ",
271272
"- Not a list for permutationResults did not generated expected results.")
272273

273-
checkEquals(obs, exp, msg = message)
274+
checkEquals(obs, exp, msg=message)
274275
}
275276

276277
## Test result when all parameters are good
@@ -322,7 +323,7 @@ test.mergePermutationAndObservation_good_01 <- function() {
322323
"- Valid parameters for mergePermutationAndObservation() ",
323324
"did not generated expected results.")
324325

325-
checkEquals(obs, exp, msg = message)
326+
checkEquals(obs, exp, msg=message)
326327
}
327328

328329
###########################################################
@@ -340,9 +341,9 @@ test.plotGraph_good_01 <- function() {
340341
message <- paste0(" test.plotGraph_good_01() ",
341342
"- Valid parameters for plotGraph did not generated expected results.")
342343

343-
checkTrue("gtable" %in% class(obs), msg = message)
344-
checkEquals(class(obs[[1]]), "list", msg = message)
345-
checkEquals(class(obs[[2]]), "data.frame", msg = message)
344+
checkTrue(is(obs, "gtable"), msg=message)
345+
checkTrue(is(obs[[1]], "list"), msg=message)
346+
checkTrue(is(obs[[2]], "data.frame"), msg=message)
346347
}
347348

348349

@@ -366,9 +367,9 @@ test.plotConvergenceGraph_good_01 <- function() {
366367
message <- paste0(" test.plotConvergenceGraph_good_01() ",
367368
"- Valid parameters for plotGraph did not generated expected results.")
368369

369-
checkTrue("ggplot" %in% class(obs), msg = message)
370-
checkTrue(is(obs[[1]], "data.frame"), msg = message)
371-
checkTrue(is(obs[[2]], "list"), msg = message)
370+
checkTrue(is(obs, "ggplot"), msg=message)
371+
checkTrue(is(obs[[1]], "data.frame"), msg=message)
372+
checkTrue(is(obs[[2]], "list"), msg=message)
372373

373374
}
374375

@@ -396,7 +397,7 @@ test.loadConvergenceData_good_01 <- function() {
396397
message <- paste0(" test.loadConvergenceData_good_01() ",
397398
"- Valid parameters for loadConvergenceData did not generated expected results.")
398399

399-
checkEquals(class(data), "data.frame", msg = message)
400+
checkTrue(is(data, "data.frame"), msg = message)
400401
checkEquals(data , expected, msg = message)
401402
}
402403

@@ -456,12 +457,14 @@ test.loadConvergenceData_two_different_directories_by_5 <- function() {
456457
expected <- data.frame(NBR_PERMUTATIONS=c(5,5,10,10),
457458
ELEMENT=rep("SITES", 4), ANALYSIS=rep("iAll", 4),
458459
POSITION=rep(1, 4), TYPE=rep(c("HYPER", "HYPO"), 2),
459-
SIGNIFICANT_LEVEL=c(0.83333333333333337034, 0.33333333333333331483,
460-
0.72727272727272729291, 0.27272727272727270709))
460+
SIGNIFICANT_LEVEL=c(0.83333333333333337034,
461+
0.33333333333333331483,
462+
0.72727272727272729291,
463+
0.27272727272727270709))
461464

462465
message <- paste0(" test.loadConvergenceData_two_different_directories() ",
463466
"- Using two different directories for observation and permutation with loadConvergenceData did not generated expected results.")
464467

465-
checkEquals(class(data), "data.frame", msg = message)
466-
checkEquals(data , expected, msg = message)
468+
checkTrue(is(data, "data.frame"), msg=message)
469+
checkEquals(data , expected, msg=message)
467470
}

0 commit comments

Comments
 (0)