|
73 | 73 | #' @export |
74 | 74 | #' |
75 | 75 | #' @examples |
76 | | -#' \dontrun{ |
77 | | -#' mp <- MmapprParam(gmapR::GmapGenome('GRCz11'), 'wt.bam', 'mut.bam', 'danio_rerio') |
| 76 | +#' if (requireNamespace('MMAPPR2data', quietly=TRUE)) { |
| 77 | +#' ## Ignore these lines: |
| 78 | +#' MMAPPR2:::.insertFakeVEPintoPath() |
| 79 | +#' genDir <- gmapR::GmapGenomeDirectory('example', create=TRUE) |
| 80 | +#' |
| 81 | +#' mmapprParam <- MmapprParam(refGenome = gmapR::GmapGenome("GRCz11", genDir), |
| 82 | +#' wtFiles = MMAPPR2data::zy13wtBam(), |
| 83 | +#' mutFiles = MMAPPR2data::zy13mutBam(), |
| 84 | +#' species = "danio_rerio") |
78 | 85 | #' } |
79 | 86 | MmapprParam <- function(refGenome, wtFiles, mutFiles, species, vepFlags=NULL, |
80 | 87 | outputFolder=NULL, distancePower=4, |
@@ -145,13 +152,7 @@ MmapprParam <- function(refGenome, wtFiles, mutFiles, species, vepFlags=NULL, |
145 | 152 | errors <- c(errors, paste0(files, " is not a BamFileList object")) |
146 | 153 | for (i in seq_along(files)) { |
147 | 154 | file <- files[[i]] |
148 | | - if (file.exists(file$path)) { |
149 | | - if (length(Rsamtools::index(file)) == 0) { |
150 | | - file <- .addBamFileIndex(file) |
151 | | - if (length(Rsamtools::index(file)) == 0) |
152 | | - warning(paste0(file$path), " in wtFiles has no index file") |
153 | | - } |
154 | | - } else { |
| 155 | + if (!file.exists(file$path)) { |
155 | 156 | errors <- c(errors, paste0(file$path, " does not exist")) |
156 | 157 | } |
157 | 158 | } |
@@ -182,7 +183,8 @@ setMethod("show", "MmapprParam", function(object) { |
182 | 183 | .customPrint(object@vepFlags, margin) |
183 | 184 |
|
184 | 185 | cat("Other parameters:\n") |
185 | | - slotNames <- slotNames("MmapprParam")[5:length(slotNames("MmapprParam"))] |
| 186 | + slotNames <- slotNames("MmapprParam")[6:length(slotNames("MmapprParam"))] |
| 187 | + slotNames <- c('species', slotNames) |
186 | 188 | slotValues <- sapply(slotNames, function(name) slot(object, name)) |
187 | 189 | names(slotValues) <- slotNames |
188 | 190 | print(slotValues, quote=FALSE) |
@@ -255,6 +257,7 @@ setMethod("show", "MmapprData", function(object) { |
255 | 257 | #' peakIntervalWidth peakIntervalWidth<- |
256 | 258 | #' minDepth minDepth<- |
257 | 259 | #' minBaseQuality minBaseQuality<- |
| 260 | +#' minMapQuality minMapQuality<- |
258 | 261 | #' loessOptResolution loessOptResolution<- |
259 | 262 | #' loessOptCutFactor loessOptCutFactor<- |
260 | 263 | #' naCutoff naCutoff<- |
@@ -356,15 +359,15 @@ setMethod("wtFiles<-", "MmapprParam", |
356 | 359 | function(obj, value) { |
357 | 360 | obj@wtFiles <- Rsamtools::BamFileList(value) |
358 | 361 | v <- .validFiles(obj@wtFiles) |
359 | | - if (typeof(v) == 'logical') obj else v |
| 362 | + if (typeof(v) == 'logical') obj else stop(v) |
360 | 363 | }) |
361 | 364 | #' @rdname MmapprParam-functions |
362 | 365 | #' @export |
363 | 366 | setMethod("mutFiles<-", "MmapprParam", |
364 | 367 | function(obj, value) { |
365 | 368 | obj@mutFiles <- Rsamtools::BamFileList(value) |
366 | 369 | v <- .validFiles(obj@wtFiles) |
367 | | - if (typeof(v) == 'logical') obj else v |
| 370 | + if (typeof(v) == 'logical') obj else stop(v) |
368 | 371 | }) |
369 | 372 | #' @rdname MmapprParam-functions |
370 | 373 | #' @export |
|
0 commit comments