"CrocAuc.MBparams.MBnetwork.MBdataDE.MBgibbsPars" <- function(params,graph,data,gibbsPars,quiet=FALSE,truth,perm=c("none","gene","know"),contrasts=NULL,t0=1,...) { # Compatibility checks isCompat1 <- compatObjects(params,graph) isCompat2 <- compatObjects(graph,data) isValid <- validObject(gibbsPars) # Run Gibbs sampler on simulated data if(!quiet) cat("\nRunning gibbs sampler on simulated data...\n\n") graph <- calcCPDs(x=graph,data=data,contrasts) if(perm=="none") { graph <- CgibbsSampler(x=graph,params=params,gibbsPars=gibbsPars,quiet=quiet,...) scores <- calcLods(graph) } else { if(perm=="gene") graph <- CpermSigGene(graph=graph,params=params,gibbsPars=gibbsPars,quiet=quiet,...) else graph <- CpermSigKnow(graph=graph,params=params,gibbsPars=gibbsPars,quiet=quiet,...) scores <- -1*graph@Pvals } # ROC analysis if(!quiet) cat("\nPerforming ROC AUC analysis...\n\n") #scores[is.na(scores)] <- min(scores,na.rm=TRUE)-1 auc.sim <- performance(prediction(predictions=scores,labels=truth),measure="auc",fpr.stop=t0)@y.values[[1]] return(auc.sim) }