@@ -118,19 +118,19 @@ read_stockholm_msa <- function(stockholm) {
118
118
# ' # also works if the fasta file has already been loaded
119
119
# ' samp <- Biostrings::readDNAStringSet(sampfasta)
120
120
# ' 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 ) {
122
122
assertthat :: assert_that(assertthat :: is.string(cm ),
123
123
file.exists(cm ),
124
124
assertthat :: is.flag(glocal ))
125
125
tablefile <- tempfile(" cmsearch" , fileext = " .dat" )
126
126
on.exit(unlink(tablefile ))
127
127
args <- c(" --tblout" , tablefile , " --toponly" , " --noali" )
128
128
if (isTRUE(glocal )) args <- c(args , " -g" )
129
- if (! missing (cpu )) {
129
+ if (! is.null (cpu )) {
130
130
assertthat :: assert_that(assertthat :: is.count(cpu ))
131
131
args <- c(args , " --cpu" , cpu )
132
132
}
133
- if (! missing (alignment )) {
133
+ if (! is.null (alignment )) {
134
134
assertthat :: assert_that(assertthat :: is.string(alignment ))
135
135
d <- dirname(alignment )
136
136
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) {
223
223
assertthat :: is.flag(glocal ))
224
224
args <- " cmalign"
225
225
if (isTRUE(glocal )) args <- c(args , " -g" )
226
- if (! missing (cpu )) {
226
+ if (! is.null (cpu )) {
227
227
assertthat :: assert_that(assertthat :: is.count(cpu ))
228
228
args <- c(args , " --cpu" , cpu )
229
229
}
230
- if (! missing (mxsize )) {
230
+ if (! is.null (mxsize )) {
231
231
assertthat :: assert_that(
232
232
assertthat :: is.number(mxsize ),
233
233
mxsize > 0 )
0 commit comments