Skip to content

ThreeWayClassifier fix#16

Merged
shraddhapai merged 3 commits intomasterfrom
vignetteFix
Oct 12, 2021
Merged

ThreeWayClassifier fix#16
shraddhapai merged 3 commits intomasterfrom
vignetteFix

Conversation

@writingindy
Copy link
Copy Markdown

Fixed getPSN() function so that ThreeWayClassifier vignette runs successfully (generating new sims list that matches new groupList limited to top features; see line 268-278 in helper.R).

Cleaned up RawDataConversion vignette slightly.

Error description:

----------- FAILURE REPORT --------------
 --- failure: the condition has length > 1 ---
 --- srcref ---
:
 --- package (from environment) ---
netDx
 --- call from context ---
checkMakeNetFuncSims(makeNetFunc = makeNetFunc, sims = sims,
    groupList = groupList)
 --- call from argument ---
if (all.equal(sort(names(sims)), sort(names(groupList))) != TRUE) stop("names(sims) must match names(groupList).")
 --- R stacktrace ---
where 1: checkMakeNetFuncSims(makeNetFunc = makeNetFunc, sims = sims,
    groupList = groupList)
where 2: plotIntegratedPatientNetwork(dataList = dat, groupList = g2,
    makeNetFunc = makeNetFunc, sims = sims, aggFun = aggFun,
    prune_pctX = prune_pctX, prune_useTop = prune_useTop, numCores = numCores,
    calcShortestPath = calcShortestPath, showStats = FALSE, verbose = TRUE,
    plotCytoscape = plotCytoscape)
where 3: getPSN(brca, groupList, sims = sims, selectedFeatures = results$selectedFeatures)
where 4: withCallingHandlers(expr, message = function(c) if (inherits(c,
    classes)) tryInvokeRestart("muffleMessage"))
where 5: suppressMessages(getPSN(brca, groupList, sims = sims, selectedFeatures = results$selectedFeatures))
where 6: eval(expr, envir, enclos)
where 7: eval(expr, envir, enclos)
where 8: withVisible(eval(expr, envir, enclos))
where 9: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler,
    error = eHandler, message = mHandler)
where 10: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir,
    enclos)), warning = wHandler, error = eHandler, message = mHandler))
where 11: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr,
    envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
where 12: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos,
    debug = debug, last = i == length(out), use_try = stop_on_error !=
        2L, keep_warning = keep_warning, keep_message = keep_message,
    output_handler = output_handler, include_timing = include_timing)
where 13: evaluate::evaluate(...)
where 14: evaluate(code, envir = env, new_device = FALSE, keep_warning = !isFALSE(options$warning),
    keep_message = !isFALSE(options$message), stop_on_error = if (is.numeric(options$error)) options$error else {
        if (options$error && options$include)
            0L
        else 2L
    }, output_handler = knit_handlers(options$render, options))
where 15: in_dir(input_dir(), evaluate(code, envir = env, new_device = FALSE,
    keep_warning = !isFALSE(options$warning), keep_message = !isFALSE(options$message),
    stop_on_error = if (is.numeric(options$error)) options$error else {
        if (options$error && options$include)
            0L
        else 2L
    }, output_handler = knit_handlers(options$render, options)))
where 16: eng_r(options)
where 17: block_exec(params)
where 18: call_block(x)
where 19: process_group.block(group)
where 20: process_group(group)
where 21: withCallingHandlers(if (tangle) process_tangle(group) else process_group(group),
    error = function(e) {
        setwd(wd)
        cat(res, sep = "\n", file = output %n% "")
        message("Quitting from lines ", paste(current_lines(i),
            collapse = "-"), " (", knit_concord$get("infile"),
            ") ")
    })
where 22: process_file(text, output)
where 23: knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet)
where 24: rmarkdown::render(file, encoding = encoding, quiet = quiet, envir = globalenv(),
    output_dir = getwd(), ...)
where 25: vweave_rmarkdown(...)
where 26: engine$weave(file, quiet = quiet, encoding = enc)
where 27: doTryCatch(return(expr), name, parentenv, handler)
where 28: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 29: tryCatchList(expr, classes, parentenv, handlers)
where 30: tryCatch({
    engine$weave(file, quiet = quiet, encoding = enc)
    setwd(startdir)
    output <- find_vignette_product(name, by = "weave", engine = engine)
    if (!have.makefile && vignette_is_tex(output)) {
        texi2pdf(file = output, clean = FALSE, quiet = quiet)
        output <- find_vignette_product(name, by = "texi2pdf",
            engine = engine)
    }
    outputs <- c(outputs, output)
}, error = function(e) {
    thisOK <<- FALSE
    fails <<- c(fails, file)
    message(gettextf("Error: processing vignette '%s' failed with diagnostics:\n%s",
        file, conditionMessage(e)))
})
where 31: tools::buildVignettes(dir = ".", tangle = TRUE)

 --- value of length: 2 type: logical ---
[1] TRUE TRUE
 --- function from context ---
function (makeNetFunc, sims, groupList)
{
    if (is.null(makeNetFunc) && is.null(sims)) {
        stop("Provide either makeNetFunc or sims (preferred).")
    }
    if (!is.null(makeNetFunc) && !is.null(sims)) {
        stop("Provide either makeNetFunc or sims (preferred).")
    }
    if (!is.null(sims)) {
        if (class(sims) != "list")
            stop("sims must be a list.")
        if (all.equal(sort(names(sims)), sort(names(groupList))) !=
            TRUE)
            stop("names(sims) must match names(groupList).")
    }
    return(TRUE)
}
<bytecode: 0x5616e1414570>
<environment: namespace:netDx>
 --- function search by body ---
Function checkMakeNetFuncSims in namespace netDx has this body.
 ----------- END OF FAILURE REPORT --------------
Quitting from lines 417-419 (ThreeWayClassifier.Rmd)
Error: processing vignette 'ThreeWayClassifier.Rmd' failed with diagnostics:
the condition has length > 1
--- failed re-building 'ThreeWayClassifier.Rmd'
@shraddhapai shraddhapai merged commit e546a90 into master Oct 12, 2021
@shraddhapai shraddhapai deleted the vignetteFix branch October 12, 2021 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants