@@ -200,6 +200,11 @@ cmsearch <- function(cm, seq, glocal = TRUE, alignment, cpu) {
200
200
# ' See \href{http://eddylab.org/infernal/}{Infernal} documentation for
201
201
# ' more information.
202
202
# ' @param cpu (\code{integer} scalar) The number of cpus to use.
203
+ # ' @param mxsize (\code{double} scalar) The maximum DP matrix size, in Mb.
204
+ # ' Maximum potential memory usage is approximately cpu*mxsize, although
205
+ # ' this is usually not realized.
206
+ # ' See \href{http://eddylab.org/infernal/}{Infernal} documentation for
207
+ # ' more information.
203
208
# '
204
209
# ' @return the aligned sequences, as returned by
205
210
# ' \code{\link{read_stockholm_msa}}.
@@ -213,7 +218,7 @@ cmsearch <- function(cm, seq, glocal = TRUE, alignment, cpu) {
213
218
# ' # also works if the fasta file has already been loaded
214
219
# ' unaln <- Biostrings::readRNAStringSet(unaln)
215
220
# ' cmalign(cm, unaln, cpu = 1)
216
- cmalign <- function (cmfile , seq , glocal = TRUE , cpu ) {
221
+ cmalign <- function (cmfile , seq , glocal = TRUE , cpu = NULL , mxsize = NULL ) {
217
222
assertthat :: assert_that(assertthat :: is.readable(cmfile ),
218
223
assertthat :: is.flag(glocal ))
219
224
args <- " cmalign"
@@ -222,6 +227,12 @@ cmalign <- function(cmfile, seq, glocal = TRUE, cpu) {
222
227
assertthat :: assert_that(assertthat :: is.count(cpu ))
223
228
args <- c(args , " --cpu" , cpu )
224
229
}
230
+ if (! missing(mxsize )) {
231
+ assertthat :: assert_that(
232
+ assertthat :: is.number(mxsize ),
233
+ mxsize > 0 )
234
+ args <- c(args , " --mxsize" , mxsize )
235
+ }
225
236
226
237
seqfile <- NULL
227
238
if (assertthat :: is.string(seq ) && file.exists(seq )) {
0 commit comments