Skip to content

Commit 523a292

Browse files
committed
properly handle explicit NULL arguments
1 parent e28f80a commit 523a292

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: inferrnal
22
Title: Interface to Call Programs from Infernal RNA Covariance Model Package
3-
Version: 0.99.3
3+
Version: 0.99.4
44
Authors@R:
55
person(given = "Brendan",
66
family = "Furneaux",

NEWS.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# inferrnal 0.99.4
2+
3+
* Properly handle explicit `NULL` values for `cpu` and `mxsize`.
4+
15
# inferrnal 0.99.3
26

37
* Added `mxsize` argument to `cmalign` to change the maximum matrix size.

R/inferrnal.R

+5-5
Original file line numberDiff line numberDiff line change
@@ -118,19 +118,19 @@ read_stockholm_msa <- function(stockholm) {
118118
#' # also works if the fasta file has already been loaded
119119
#' samp <- Biostrings::readDNAStringSet(sampfasta)
120120
#' cmsearch(cm = cm, seq = samp, cpu = 1)
121-
cmsearch <- function(cm, seq, glocal = TRUE, alignment, cpu) {
121+
cmsearch <- function(cm, seq, glocal = TRUE, alignment = NULL, cpu = NULL) {
122122
assertthat::assert_that(assertthat::is.string(cm),
123123
file.exists(cm),
124124
assertthat::is.flag(glocal))
125125
tablefile <- tempfile("cmsearch", fileext = ".dat")
126126
on.exit(unlink(tablefile))
127127
args <- c("--tblout", tablefile, "--toponly", "--noali")
128128
if (isTRUE(glocal)) args <- c(args, "-g")
129-
if (!missing(cpu)) {
129+
if (!is.null(cpu)) {
130130
assertthat::assert_that(assertthat::is.count(cpu))
131131
args <- c(args, "--cpu", cpu)
132132
}
133-
if (!missing(alignment)) {
133+
if (!is.null(alignment)) {
134134
assertthat::assert_that(assertthat::is.string(alignment))
135135
d <- dirname(alignment)
136136
if (nchar(d) > 0 && !dir.exists(d)) dir.create(d, recursive = TRUE)
@@ -223,11 +223,11 @@ cmalign <- function(cmfile, seq, glocal = TRUE, cpu = NULL, mxsize = NULL) {
223223
assertthat::is.flag(glocal))
224224
args <- "cmalign"
225225
if (isTRUE(glocal)) args <- c(args, "-g")
226-
if (!missing(cpu)) {
226+
if (!is.null(cpu)) {
227227
assertthat::assert_that(assertthat::is.count(cpu))
228228
args <- c(args, "--cpu", cpu)
229229
}
230-
if (!missing(mxsize)) {
230+
if (!is.null(mxsize)) {
231231
assertthat::assert_that(
232232
assertthat::is.number(mxsize),
233233
mxsize > 0)

man/cmsearch.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)