Skip to content
Prev 10322 / 21318 Next

[Bioc-devel] TabixFileList() constructor broken in devel

A while ago Martin and I discussed the possibility of idempotence for
TabixFile ... this seemed
to make sense and so
function (file, index = paste(file, "tbi", sep = "."), ..., yieldSize =
NA_integer_)

{

    if (is(file, "TabixFile"))

        return(file)

    tryCatch({

        .io_check_exists(c(file, index))

    }, error = function(err) {

        stop(sprintf("TabixFile: %s", conditionMessage(err)),

            call. = FALSE)

    })

    .RsamtoolsFile(.TabixFile, file, index, yieldSize = yieldSize,

        ...)

}

<environment: namespace:Rsamtools>


TabixFileList could behave similarly, working either from character paths,
or from

a list of TabixFile instances, or from a TabixFileList ... might be a
design practice to

promote for S4 programming
function (file, index = paste(file, "tbi", sep = "."), ..., yieldSize =
NA_integer_)

{

    index <- as.character(index)

    .RsamtoolsFileList(file, index, ..., yieldSize = yieldSize,

        class = "TabixFile")

}

<environment: namespace:Rsamtools>

On Thu, Dec 29, 2016 at 11:55 AM, Robert Castelo <robert.castelo at upf.edu>
wrote: