Found 57474 results in 2878 files, showing top 50 files (show more).
ExploreModelMatrix:R/ExploreModelMatrix.R: [ ]
177:                                class = "fa fa-question-circle",
658:                          class = "fa fa-question-circle",
55: ExploreModelMatrix <- function(sampleData = NULL, designFormula = NULL) {
199:                                class = "fa fa-question-circle",
224:                                class = "fa fa-question-circle",
252:                                class = "fa fa-question-circle",
283:                                class = "fa fa-question-circle",
306:                                class = "fa fa-question-circle",
333:                                class = "fa fa-question-circle",
355:                                class = "fa fa-question-circle",
23: #' app <- ExploreModelMatrix(
90:         title = paste0("Design matrix visualization (ExploreModelMatrix v",
91:                        utils::packageVersion("ExploreModelMatrix"), ")"),
612:                               designMatrix = NULL)
1109:                                      package = "ExploreModelMatrix"),
1131:                                                package = "ExploreModelMatrix"),
VariantAnnotation:R/methods-VCF-class.R: [ ]
20:         class <- "CollapsedVCF"
503: .showVCFSubclass <- function(object)
447: SnpMatrixToVCF <- function(from, seqSource)
2: ### VCF class methods 
29:         class <- "ExpandedVCF"
39:     new(class, SummarizedExperiment(assays=geno, rowRanges=rowRanges,
384:     if (!.compare(lapply(args, class)))
385:         stop("'...' objects must be of the same VCF class")
422:     if (!.compare(lapply(args, class)))
423:         stop("'...' objects must be of the same VCF class")
546:     cat("class:", classNameForDisplay(object), "\n")
526:         cat(margin, classNameForDisplay(x), " with ",
534:         cat(margin, classNameForDisplay(x), " with ",
542:         cat(margin, classNameForDisplay(x), " of length ", lo, 
spatialHeatmap:inst/extdata/shinyApp/R/server.R: [ ]
204:       tags$div(class='tp', span(class='tpt', 'Ensure "columns in the data matrix corresponds with "rows" in the targets file respectively...(4 bytes skipped)...
206:       tags$div(class='tp', span(class='tpt', 'Ensure "rows" in the data matrix corresponds with "rows" in the row metadata file respectiv...(7 bytes skipped)...
223:       tags$div(class='tp', span(class='tpt', 'The data is matched with a single aSVG file.'),
225:       tags$div(class='tp', span(class='tpt', 'The data is matched with multiple aSVG files (e.g. developmental stages).'),
749:    class='cell-border strip hover') %>% formatStyle(0, backgroundColor="orange", cursor='pointer') %>% 
768:    class='cell-border strip hover') %>% formatStyle(0, backgroundColor="orange", cursor='pointer') %>% 
781:    class='cell-border strip hover') %>% formatStyle(0, backgroundColor="orange", cursor='pointer') %>% 
946:       validate(need(try(ncol(gene)>4), 'The "sample__condition" variables in the Data Matrix are less than 5, so no coexpression analysis is applied!'))
965:     #if (is.null(input$mhm.but)) return() # Matrix heatmap sections is removed.
975:     withProgress(message="Matrix heatmap:", value=0, {
984:     cat('Matrix heatmap ... \n')
989:     withProgress(message="Matrix heatmap:", value=0, {
1002:     withProgress(message="Matrix heatmap:", value=0, {
1119:     if (is.null(input$gen.sel)) return() # Matrix heatmap section is removed.
1363:       span(class = "panel panel-default", style = 'margin-left:0px',
1364:         div(class = "panel-heading", strong("Features in aSVG")),
1365:         div(class = "panel-body", id = ns("ftSVG"), ft2tag(sf.all))
1367:       div(class = "panel panel-default",
1368:         div(class = "panel-heading", strong("Features in data")),
1864:      # print(list(ID, is.null(svg.df()), is.null(geneIn()), ids$sel, color$col[1], class(color$col[1])))
2709:     d.tab <- datatable(vs, selection='none', extensions='Scroller', plugins = "ellipsis", class='cell-border strip hover', options = list(dom = 't', scrollX = TRUE)); cat('Done! \n')
2896:       class='cell-border strip hover') %>% formatStyle(0, backgroundColor="orange", cursor='pointer'); cat('Don...(7 bytes skipped)...
2999:       class='cell-border strip hover') %>% formatStyle(0, backgroundColor="white", cursor='pointer')
3056:     library(Matrix)
3058:     assay(sce) <- as(assay(sce), 'dgCMatrix')
geNetClassifier:R/functions.public.R: [ ]
389:                             class <- names(x)[largest]
71:     classes <- factor(apply(prob, 2, function(x) {assignment.conditions(x, minProb, minDiff)}))
97:     classes<-unique(c(rownames(mxcf),colnames(mxcf)))
176: externalValidation.probMatrix<- function(queryResult, realLabels, numDecimals=2)
209:     probMatrix <- matrix(0,nrow=length(levels(realLabels)), ncol=length(predClasses))
215:         classAssignments <- globalQueryResult$class[names(realLabels)[which(realLabels==label)]] #Prob for the class samples, even if the prediction was wrong
249:     classes <- rownames(globalQueryResult$probabilities)
608:     exprMatrix <- eset
695:         classes <- levels(sampleLabels)
718:         classLabels <- stats::setNames(paste("C", sapply(classes,function(x) which(classes==x)), sep=""), classes)
815:                                 classMean <- mean(matriz[genesVector[i], (prevLim+1):j])
931:             classificationGenesRanking <- classificationGenes
1156:         tempDpMatrix <- discrPwDF
1307:                 classificationGenesInfo <- genesDetails(classificationGenes)[nwClasses]
1382:                         classGeneLabels    <- as.vector(genesInfoList[[cl]][,"GeneName"])[availableNames]
1395:                 classGenes <- getNodes(genesNetwork[[cl]])
1412:         classificationGenesNetwork <- NULL
1413:         classificationGenesID <- NULL
1489:                 if(length(genesNetwork[[nw]]@nodes)>0)    {        classGraph <- igraph::graph.data.frame(as.data.frame(genesNetwork[[nw]]@edges[,ntwColnames,drop=FALSE]), ...(68 bytes skipped)...
99:     nclasses <- length(classes)
43: ...(52 bytes skipped)...obAssignCoeff' should be a coefficient to modify the probability required to assign the sample to a class.")
44: ...(72 bytes skipped)...d be a coefficient to modify the required difference between probabilites to assign the sample to a class.")
67: ...(86 bytes skipped)...etSelection)) esetSelection <- t(cbind(NULL,esetSelection)) #To avoid error when there is only 1gen/class
72:     ret <- list(call=match.call(), class= classes, probabilities=prob)
77: ...(6 bytes skipped)...ulates stats from the confussion matrix. i.e. sensitivity and specificity of the predictor for each class, global accuracy and call rate (rate of assigned samples)
79: # 100% Sensitivity = Recognizes all positives for the class
80: # 100% Specificity = Recognizes all negatives for the class
82: #Renombrado de class.accuracy
93:         warning("The confussion matrix should have the real class in rows and the assigned class in cols. The matrix provided didn't seem to be in the right order so it was transposed:")
174: # Returns the matrix with the average probabilities of assigning a sample to each class (only of assigned samples)
186:         if (length(realLabels) == length( names(queryResult$class))) 
188:             names(realLabels) <- names(queryResult$class)
201:     if(sum(!names(globalQueryResult$class) %in% names(realLabels)) >0) stop("There are samples for which the real label was not provided.") 
203:     if((length(globalQueryResult$class)!=dim(globalQueryResult$probabilities)[2]) || (sum(!names(globalQueryResult$class) %in% colnames(globalQueryResult$probabilities))>0 )) {stop("The samples in $class and in $probabilities do not match.")}
228: # Gives basic stats of the probabilities with wich the samples were assigned to the class
246:     if(length(globalQueryResult$class)!=dim(globalQueryResult$probabilities)[2]) {}#El numero de samples no encaja
248:     numSamples <- length(globalQueryResult$class)
262:             if (globalQueryResult$class[i] == classes[c])
270:             else if (c==1 && (globalQueryResult$class[i] == "NotAssigned")) notAssigned <- notAssigned+1
284:     # Info about NotAssigned samples (most likely class & probs)
288:         highestProb        <- apply(globalQueryResult$probabilities[,which(globalQueryResult$class == "NotAssigned"), drop=FALSE], 2, function(x) round(max(x), numDecimals))    #--> mayor probabilid...(13 bytes skipped)...
289: ...(33 bytes skipped)...mes(globalQueryResult$probabilities)[apply(globalQueryResult$probabilities[,which(globalQueryResult$class == "NotAssigned"), drop=FALSE], 2, function(x) which(order(x, decreasing=TRUE)==1))] #Clase con la ...(18 bytes skipped)...
291:         nextProbIndex     <- cbind(apply(globalQueryResult$probabilities[,which(globalQueryResult$class...(10 bytes skipped)...signed"), drop=FALSE], 2, function(x) which(order(x, decreasing=TRUE)==2)), which(globalQueryResult$class == "NotAssigned"))
293: ...(34 bytes skipped)...mes(globalQueryResult$probabilities)[apply(globalQueryResult$probabilities[,which(globalQueryResult$class == "NotAssigned"), drop=FALSE], 2, function(x) which(order(x, decreasing=TRUE)==2))]
302: ...(19 bytes skipped)...("The query contains ", samplesQueried=numSamples, " samples. ",sum(stats[,1])," were assigned to a class resulting on a call rate of ", callRate,"%. \n", sep=""))
331:         if (length(realLabels) == length(names(queryResult$class))) 
333:             names(realLabels) <- names(queryResult$class)
342: ...(72 bytes skipped)...d be a coefficient to modify the required difference between probabilites to assign the sample to a class.")
363:     plot(c(minX,1), c(0,1), type="n", xlab="Probability of the most likely class", ylab="Difference with next class", frame=FALSE, main="Thresholds to assign query samples")
380: ...(0 bytes skipped)...    graphics::legend("bottomright", "(x,y)", legend=c("Correct", "Incorrect"), title = "Most likely class", text.width = strwidth("1,000,000"),  xjust = 1, yjust = 1, lty = 0, pch=16, col=c(correctColor, i...(24 bytes skipped)...
393:                             class <- "NA"
395:                         return(c(biggestProb=x[largest], nextProb=nextProb, assignedClass=class))
466:     if(class(sampleLabels) != "factor") { 
480:         if(class(sampleLabels) != "factor") { warning("The argument 'sampleLabels' had to be converted into a factor...(27 bytes skipped)...
599:         if(class(sampleLabels) != "factor") { warning("The argument 'sampleLabels' had to be converted into a factor...(27 bytes skipped)...
638:         if(class(sampleLabels) != "factor") { warning("The argument 'sampleLabels' had to be converted into a factor...(4 bytes skipped)...
671:                 # Default class colors for boxplot
719:         warning(paste("Some class names are longer than 10 characters. The following labels will be used in plots:\n",paste(classLabels, names(classLabels), sep=": ", collapse="\n"), sep=""))
746:     geneTitles <- matrix(ncol=3, dimnames=list(genesVector,c("class","label","labelShort")),nrow=length(genesVector))
752:             # Gene class, from genes table
753:             geneTitles[g,"class"] <- unique(colnames(genes)[which(genes == g,arr.ind=TRUE)[,2]])
754:             if(nchar(geneTitles[g,"class"])>10) geneTitles[g,"class"] <- paste(geneTitles[g,"class"], " (C",which(classes==geneTitles[g,"class"]), ")", sep="")
757:             geneTitles[g,"class"]<-"" 
799:                 title(paste(geneTitles[genesVector[i],"class"], geneTitles[genesVector[i],"label"], sep="\n" ))
845:                 title(paste(geneTitles[gen,"class"], geneTitles[gen,"label"], sep="\n" ))
926:     if(any(class(classificationGenes) == "GenesRanking"))
988:             warning(paste("The number of classes provided don't match the classifier's. The default class names will be used instead.",sep=""), immediate. = TRUE)    }
1002:     if(!is.matrix(classificationGenes)) { #if(verbose) warning("The 'classification genes' are not sorted by colums and classes, the gene class will not be shown .")
1010:             classificationGenes <- classificationGenes[,apply(classificationGenes, 2, function(x) !all(is.na(x)))] # Is there any class without genes?
1259:                 warning(paste("Plotting up to ", max(numGenes(genesRanking)), " genes of each class.", sep=""))
1272:             if(!class(genesNetwork) == "GenesNetwork") stop("genesNetwork should be either a list or a GenesNetwork.")
1273:             if((sum(c("class1", "class2") %in% colnames(genesNetwork@edges)) == 2 ) && nrow(genesNetwork@edges)>0)
1275:                 nwClasses <- unique(as.vector(genesNetwork@edges[,c("class1", "class2")]))
1291:         if(any(class(classificationGenes) == "GenesRanking") && all(numGenes(classificationGenes) == 0))  classificationGenes <- NULL
1298:                 if(class(genesRanking) != "GenesRanking") stop("genesRanking should be an object of type GenesRanking.")
1305:                 if(class(classificationGenes)[1] != "GenesRanking") stop("classificationGenes should be an object of type GenesRanking (the classificationGenes object returned by the classifier).")
1345:                 if(any(! names(genesNetwork) %in% names(genesInfo))) { stop("The class names in genesInfo and genesNetwork do not match.")
1481:         # For each class...
4: # clasificador                        (in file: classifier.main.r)
7: #    externalValidation.probMatrix
24:   #   classifier: 
30:   # WARNING!: The arrays should have been normalized with the samples used for the classifier training.
31: queryGeNetClassifier <- function(classifier, eset,    minProbAssignCoeff=1, minDiffAssignCoeff=0.8, verbose=TRUE)
36:     if(is(classifier, "GeNetClassifierReturn")){
37:         if("classifier" %in% names(classifier)) { classifier <- classifier@classifier$SVMclassifier
38:         }else stop("'classifier' doesn't contain a trained classifier.")
40:     if(!is(classifier, "svm")) classifier <- classifier$SVMclassifier
41:     if(!is(classifier, "svm")) stop("The first argument should be the classifier returned by geNetClassifier.")
42:     numClasses <- length(classifier$levels)
45: ...(67 bytes skipped)...ignCoeff>(numClasses/2)))) stop("'minProbAssignCoeff' should be between 0 and half of the number of classes.")
46: ...(31 bytes skipped)... || minDiffAssignCoeff>numClasses) stop("'minDiffAssignCoeff' should be between 0 and the number of classes.")
47:     genes <- colnames(classifier$SV)
59:     rand <- 1/length(classifier$levels)
60:     if(length(classifier$levels)>2) { minProb <- 2*rand * minProbAssignCoeff
63: ...(147 bytes skipped)..., "(default)",""),".\n Minimum difference between the probabilities of first and second most likely classes  = ", round(minDiff,2),ifelse(minDiffAssignCoeff==1, "(default)",""), sep=""))  ; utils::flush.co...(8 bytes skipped)...
68:     prob <- t(attributes(stats::predict(classifier, esetSelection, probability=TRUE ))$probabilities)
69:     if(is.null(names(prob))) colnames(prob)<-rownames(esetTdf) # if 2 classes... not labeled. Needed for mxcf...
83: externalValidation.stats <- function(confussionMatrix, numDecimals=2) #Confussion matrix
85:     mxcf <- confussionMatrix
98:     if(any(classes=="NotAssigned")) classes <- classes[-which(classes=="NotAssigned")]
103:     if (any(!classes %in% colnames(mxcf))) 
105:         missingClasses <- classes[which(!classes %in% colnames(mxcf))]
111:     if (any(!classes %in% rownames(mxcf))) 
113:         missingClasses <- classes[which(!classes %in% rownames(mxcf))]
120:     #Just in case they are not in order (Diagonal=hits). Will use only the real classes.
121:     mxcf<- mxcf[,c(classes,"NotAssigned")]                                                                                  ...(22 bytes skipped)...
122:     mxcf<- mxcf[c(classes),]        
134:     rownames(byClass)<- classes
171:     return( list(byClass=byClass, global=global, confMatrix=mxcf) )
210:     rownames(probMatrix)<- levels(realLabels)
211:     colnames(probMatrix)<- predClasses
216:         assignedSamples <- names(classAssignments)[    which( classAssignments!= "NotAssigned")]
219:             if(length(assignedSamples)>1) probMatrix...(8 bytes skipped)... <- apply(globalQueryResult$probabilities[,assignedSamples], 1, function(x) {mean(x)})[colnames(probMatrix)]
220:             else probMatrix[label,] <- globalQueryResult$probabilities[,assignedSamples][colnames(probMatrix)]
224:     ret<- round(probMatrix,numDecimals)
250:     numClasses <- length(classes)
253:     rownames(stats)<-c(classes)
339: ...(51 bytes skipped)...talNumberOfClasses<length(levels(realLabels)))) stop ("totalNumberOfClasses should be the number of classes for which the classifier was originaly trained.")
343: ...(63 bytes skipped)...ignCoeff>(numClasses/2)))) stop("'minProbAssignCoeff' should be between 0 and half of the number of classes.")
344: ...(27 bytes skipped)... || minDiffAssignCoeff>numClasses) stop("'minDiffAssignCoeff' should be between 0 and the number of classes.")
467:         #warning("The argument 'classification sampleLabels' had to be converted into a factor.", immediate. = TRUE)
533:         numClasses <- ncol(postProb) # If there are only 2 classes, postProb only has 1 column
575: ...(55 bytes skipped)...leName=NULL, geneLabels=NULL, type="lines", sampleLabels=NULL, sampleColors=NULL, labelsOrder=NULL, classColors=NULL, sameScale=TRUE, showSampleNames=FALSE, showMean= FALSE, identify=TRUE, verbose=TRUE)
610:     if(is(exprMatrix, "ExpressionSet")) exprMatrix <- exprs(exprMatrix) else if (!is.matrix(exprMatrix)) stop("The first argument should be an expression matrix or an ExpressionSet.")
615:         genes <- rownames(exprMatrix)
618:     if(is(genes, "GeNetClassifierReturn") && "classificationGenes" %in% names(genes)) {
619:         genes <- genes@classificationGenes
620:         warning("Plotting expression profiles of the classification genes. To plot other genes, set i.e. genes=...@genesRanking")
629:     if(sum(!genes[which(genes!="NA")] %in% rownames(exprMatrix))!=0) stop ("The expression matrix doesn't contain all the genes.")
632:     if(!is.null(geneLabels)) geneLabels<-extractGeneLabels(geneLabels, rownames(exprMatrix[genesVector,]))
635:     numSamples <- dim(exprMatrix)[2] 
643:             if(sum(!names(sampleLabels) %in% colnames(exprMatrix))>0 ) stop("The names of the labels do not match the samples.")
646:             names(sampleLabels)<-colnames(exprMatrix)
659:     if(!is.null(sampleColors) && !is.null(classColors)) stop("Provide either 'sampleColors' or 'classColors'")
662:         if(is.null(classColors)) 
672:                 if(is.null(classColors))
674:                     if(!is.null(sampleLabels)) classColors <- rev(hcl(h=seq(0,360, length.out=length(levels(sampleLabels))+1))[1:length(levels(sampleLab...(7 bytes skipped)...
675:                     if(is.null(sampleLabels)) classColors <- "white"
680:             if(is.null(sampleLabels)) stop("Cannot use 'classColors' if 'sampleLabels' is not provided.")
681:             if(length(levels(sampleLabels)) != length(classColors))stop("Length of 'classColors' should match the number of classes in the samples.")
683:             if(any(type%in%"lines"))    sampleColors <- classColors[sampleLabels]
696:         if(!is.null(labelsOrder)) classes <- labelsOrder
697:         numClasses <- length(classes)
702:             indexes <- c(indexes,  which(sampleLabels==classes[i]))
704:         matriz <- exprMatrix[genesVector, indexes, drop=FALSE]
709:         classes <- colnames(genes)            
710:         numClasses <- length(classes)        
711:         matriz <- exprMatrix[genesVector,, drop=FALSE]
716:     if(any(nchar(classes)>10)) 
796:                 } else    {    geneClass<-"" }                    #classes[which(genes == genesVector[i], arr.ind=TRUE)[2]]
810: ...(21 bytes skipped)...       if(!is.na((sampleLabels[j] != sampleLabels[j+1]) ) ) abline(v=j+0.5, col="black") # Separate classes
811:                             if (any(nchar(classes)>10) ) {graphics::text(prevLim+((j-prevLim)/2), ylim[2]-(ylim[2]*0.04), labels=classLabels[sampleLabels[j]]) # Class title
816:                                 graphics::lines(c(prevLim+1, j), c(classMean, classMean) , col="grey")
834:                 names(esetXclases) <- classLabels[names(esetXclases)] #paste("C", sapply(names(esetXclases),function(x) which(classes==x)), sep="")
844: ...(12 bytes skipped)...    boxplot(Expression~sampleLabel, esetExprSamplesMelted, ylim=ylim, ylab="Expression values", col=classColors, las=2, outpch=16, outcex=0.5)
879: # discriminant.power.plot(classifier, classificationGenes, classNames=c("ALL","AML","CLL","CML","NoLeu"), fileName="test.pdf",correctedAlpha=TRUE)
880: # discriminant.power.plot(classifier, classificationGenes, fileName="test.pdf")
882: # discriminant.power.plot(classifier, colnames(classif$SV), fileName="test.pdf")
888: # classifier: puede ser un svm o el objeto devuelto por la funcion principal
889: # classificationGenes: puede ser un c(), una matriz o un GenesRanking
891: plotDiscriminantPower <- function(classifier, classificationGenes=NULL , geneLabels=NULL, classNames=NULL, plotDP = TRUE, fileName= NULL, returnTable=FALSE, verbose=TRUE)
905:     if(is(classifier, "GeNetClassifierReturn")){
906:         if("classificationGenes" %in% names(classifier))
908:             if(is.null(classificationGenes))
910:                 classificationGenes <- classifier@classificationGenes
912:                 if(is.null(geneLabels) && is.character(classificationGenes))
914:                     if(length(classifier@classificationGenes@geneLabels) > 0 &&  any(!is.na(classifier@classificationGenes@geneLabels[classificationGenes])))                
915:                         geneLabels <- classifier@classificationGenes@geneLabels[classificationGenes]
919:         if("classifier" %in% names(classifier)) {classifier <- classifier@classifier$SVMclassifier
920:         }else stop("'classifier' doesn't contain a trained classifier.")
922:     if(is.list(classifier) && ("SVMclassifier" %in% names(classifier))) classifier <- classifier$SVMclassifier
923:     if(!is(classifier,"svm")) stop("The first argument should be a svm classifier or the object returned by geNetClassifier.")
928:         if(sum(numGenes(classificationGenes)))
930:             if(is.null(geneLabels) && (length(classificationGenes@geneLabels) > 0 &&  any(!is.na(classificationGenes@geneLabels)))) geneLabels <- classificationGenes@geneLabels
932:             classificationGenes <- getRanking(classificationGenes, showGeneLabels=FALSE, showGeneID=TRUE)$geneID 
934:             classificationGenes <- NULL
935:             classificationGenesRanking<-NULL
938:         classificationGenesRanking<-NULL
941:     # If classificationGenes is not provided/valid, use the classifier's SV
942:     missingGenes <- !as.vector(classificationGenes[!is.na(classificationGenes)]) %in% colnames(classifier$SV)
945:         missingGenes <- as.vector(classificationGenes[!is.na(classificationGenes)])[which(missingGenes)]
951:         missingGenes <- missingGenes[which(!missingGenes %in% colnames(classifier$SV))]
953:         classificationGenes[which(classificationGenes %in% missingGenes)] <- NA
955:          if(all(is.na(classificationGenes))) stop("The given 'classificationGenes' are not used by the classifier. Their Discriminant Power cannot be calculated.")
956:         if(length(missingGenes)>0) warning(paste("The following classificationGenes are not used by the classifier. Their Discriminant Power cannot be calculated: ", missingGenes, sep=""))
958:     if(is.null(classificationGenes)) classificationGenes <- colnames(classifier$SV)
981: ...(35 bytes skipped)...ull(names(geneLabels))) stop("names(geneLabels) can't be empty. It should contain the names used in classification genes.")
982:     #if(!is.null(geneLabels) && sum(!names(geneLabels) %in% classificationGenes[which(classificationGenes!="NA")] )>0) warning("Some geneLabels will not  be used.")
983:     if(!is.null(geneLabels) && sum(!classificationGenes[which(class...(9 bytes skipped)...Genes!="NA")] %in% names(geneLabels))>0) warning("geneLabels doesn't contain the symbol for all the classification genes.")
985:     # classNames
986:     if(is.null(classNames) || (length(classifier$levels) != length(classNames))){
987:         if (!is.null(classNames) && length(classifier$levels) != length(classNames))  {
989:         classNames <-classifier$levels         
991:     longClassNames <- any(nchar(classNames)>6)
994:         for( i in 1:length(classNames)) #Add "C1:..."
996:             if (nchar(classNames[i])>10 ) classNames[i] <- paste(substr(classNames[i] ,1,10), "...",sep="")    
997:             classNames[i] <- paste("C", i, ": ", classNames[i], sep="")
1000:     numClasses <- ifelse(is.matrix(classificationGenes), length(classNames), length(classifier$levels))
1005:             if(length(classifier$levels) == 2) {
1006:                 if (dim(classificationGenes)[2] != 1)  stop("The classes of the classifier and the classification genes provided don't match.")
1008:                 if(sum(!colnames(classificationGenes) %in% classifier$levels)>0) stop("The classes of the classifier provided and the classification genes don't match.")
1013:     nGenes <- length(classificationGenes[which(!is.na(classificationGenes))]) #sum(numGenes(classifier$classificationGenes))
1014:     if(nGenes>dim(classifier$SV)[2]){ warning(paste("The given number of genes is bigger than the classifier's.",sep=""), immediate. = TRUE)}
1021:     if(is.matrix(classificationGenes))    # If it contains the genes by classes (columns)
1023:         for(cl in 1:dim(classificationGenes)[2])
1025:             discrPwList <- c(discrPwList, discrPwList=list(sapply(as.character(classificationGenes[which(classificationGenes[,cl]!="NA"),cl]), function(x) SV.dif(classifier, x, correctedAlpha=correctedAlpha))))
1026:             names(discrPwList)[cl] <- colnames(classificationGenes)[cl]
1030:         classificationGenes <- classificationGenes[which(!is.na(classificationGenes))]
1031:         discrPwList <- list(sapply(as.character(classificationGenes), function(x) SV.dif(classifier, x, correctedAlpha=correctedAlpha)))
1032:         classificationGenes <- as.matrix(classificationGenes)
1042:         numRows <- numGenesPlot/dim(classificationGenes)[2]
1043:         while ((numRows < dim(classificationGenes)[1]) && (length(classificationGenes[which(!is.na(classificationGenes[1:numRows,, drop=FALSE]))]) < numGenesPlot))
1048:         if(length(classificationGenes[which(!is.na(classificationGenes[1:numRows,, drop=FALSE]))]) <= numGenesPlot)
1050:             classificationGenes <- classificationGenes[1:numRows,, drop=FALSE]
1052:             classificationGenes <- classificationGenes[1:(numRows-1),, drop=FALSE]
1068:         mycols <- colorRampPalette(c("blue","white"))(max(classifier$nSV+2))    
1070:         for(c in 1:dim(classificationGenes)[2]) #numClasses
1072:             for(g in 1:dim(classificationGenes)[1]) 
1075:                 gene <- classificationGenes[g,c]
1125: ...(0 bytes skipped)...                    barplot(pos,add=TRUE, col=mycols, width=0.9, space=0.1, names.arg=rep("",length(classNames)))
1126: ...(0 bytes skipped)...                    barplot(neg,add=TRUE, col=mycols, width=0.9, space=0.1, names.arg=rep("",length(classNames)))
1128:                     if(!correctedAlpha) graphics::text(seq(1, length(classNames), by=1)-0.5, par("usr")[3] - 0.2, labels = classNames, srt = 90, pos = 4, xpd = TRUE) 
1129:                     if(correctedAlpha) graphics::text(seq(1, length(classNames), by=1)-0.5, par("usr")[3], labels = classNames, srt = 90, pos = 4, xpd = TRUE) 
1157:         tempDpMatrix[,"discriminantPower"] <- abs (tempDpMatrix[,"discriminantPower"] )
1159:         for(cl in classifier$levels)
1161:             clGenes <- which(tempDpMatrix[,"discrPwClass"]==cl)
1162:             discrPwDF <- rbind(discrPwDF, tempDpMatrix[clGenes[order(as.numeric(tempDpMatrix[clGenes,"discriminantPower"]),decreasing=TRUE)],])
1166:         if(is.null(classificationGenesRanking)) 
1171:             gDetails<-genesDetails(classificationGenesRanking)
1187: # plotType="dynamic" (each can be modified), plotType="static" (1 image divided into classes), plotType="pdf" 
1189: # genesInfo: Data.frame containing info about the genes. Can be replaced by classificationGenes or genesRanking (recommended).
1190: # If classificationGenes + genesRanking:  
1191: # classificationGenes: Tiene q ser un genesRanking
1193: plotNetwork  <- function(genesNetwork, classificationGenes=NULL, genesRanking=NULL, genesInfo=NULL,geneLabels=NULL, returniGraphs=FALSE, plotTyp...(199 bytes skipped)...
1254:             if(is.null(classificationGenes) && ("classificationGenes" %in% names(genesNetwork)))     classificationGenes <- genesNetwork@classificationGenes
1257:                 nGenes <- max( 100, numGenes(genesNetwork@classificationGenes))
1289:         # Check classificationGenes and Genes ranking format and EXTRACT its genes INFO.
1290:         if(is.matrix(classificationGenes) && nrow(classificationGenes)==0) classificationGenes <- NULL
1292:         if(plotClassifcationGenesNetwork && is.null(classificationGenes)) warning("The classifcation genes network can only be plotted if the classification genes are provided.")
1293:         if((!is.null(class...(30 bytes skipped)...nesRanking)) && !is.null(genesInfo)) stop("Please, provide either 'genesInfo' OR a genesRanking and classificationGenes.")
1294:         if(!is.null(genesRanking) || !is.null(classificationGenes))
1303:             if(!is.null(classificationGenes))
1308:                 clGenes <- lapply(classificationGenesInfo, rownames)            
1310:                 if(showWarning) warning("Not all the classificationGenes are available in the genesNetwork. They will be represented, but there may be missing...(29 bytes skipped)...
1314:                     genesInfo <- classificationGenesInfo
1317:                     missingColumnsInGlobal <- colnames(classificationGenesInfo[[1]])[which(!colnames(classificationGenesInfo[[1]]) %in% colnames(genesInfo[[1]]))]
1328: ...(30 bytes skipped)...  if((is.factor(temp[,tempCol]))) levels(temp[,tempCol]) <- unique(c(levels(temp[,tempCol]), levels(classificationGenesInfo[[cl]][,tempCol])))
1331:                             temp[rownames(classificationGenesInfo[[cl]]), ] <- classificationGenesInfo[[cl]][,colnames(temp)]
1364: ...(143 bytes skipped)...lot, but there may be missing relationships.") # showWarning: The warning was already shown for the classification genes.
1383:                         names(classGeneLabels) <- rownames(genesInfoList[[cl]])[availableNames]
1384:                         geneLabels <- c(geneLabels, classGeneLabels)
1396:                 missingGenes <- classGenes[which(!classGenes %in% rownames(genesInfoList[[cl]]))]
1408:         # - Add classification nodes Network 
1414:         if(!is.null(classificationGenes) && plotClassifcationGenesNetwork)
1416:             classificationGenesID <- getRanking(classificationGenes, showGeneLabels=FALSE, showGeneID=TRUE)$geneID[, nwClasses, drop=FALSE]
1417:             classificationGenesNetwork <- getSubNetwork(genesNetwork, classificationGenesID)
1418:             names(classificationGenesNetwork) <- paste(names(classificationGenesNetwork), " - Classification Genes",sep="")
1420:             clToAdd <- which(sapply(genesNetwork, function(x){length(getNodes(x))}) - sapply(classificationGenesNetwork, function(x){length(getNodes(x))}) != 0)
1423:                 warning("Only the classification genes network was provided. Only 'AllNodesNetwork' will be plotted.")
1431:                     genesNetwork <- c(genesNetwork[1:pos], classificationGenesNetwork[clToAdd[i]], genesNetwork[-(1:pos)])
1433:                    genesInfoList <- c(genesInfoList[1:pos], list(genesInfoList[[i]][classificationGenesID[,clToAdd[i]][!is.na(classificationGenesID[,i])],] ), genesInfoList[-(1:pos)])
1434:                    names(genesInfoList)[pos+1] <- names(classificationGenesNetwork[clToAdd[i]])
1440:         # (Needs to be added after classific. in order to add it right after the "full" network)
1474:             if( numClasses>25 )  stop("Too many classes to draw in a single plot. Use 'pdf' instead.")                        
1485:             classGenes <- unique(c(genesNetwork[[nw]]@edges[,"gene1"],genesNetwork[[nw]]@edges[,"gene2"]))
1487:             if((is.null(genesInfoList) || nrow(genesInfoList[[nw]])==0 ) || any(!classGenes %in% rownames(genesInfoList[[nw]]))) 
1490:                 } else classGraph <- igraph::graph.data.frame(as.data.frame(genesNetwork[[nw]]@edges[,ntwColnames,drop=FALSE]), ...(15 bytes skipped)...
1493:                 classGraph <- igraph::graph.data.frame(as.data.frame(genesNetwork[[nw]]@edges[,ntwColnames,drop=FALSE]), ...(101 bytes skipped)...
1495:             if (igraph::vcount(classGraph) != 0) 
1501:                     graphLayout <- igraph::layout.fruchterman.reingold(classGraph) # .grid is faster, but the result looks far worse.
1509:                 vertexLabels <- igraph::get.vertex.attribute(classGraph,"name")
1515:                 if(!is.null(igraph::get.vertex.attribute(classGraph,"exprsMeanDiff")))
1517:                     exprsDiff <- as.numeric(igraph::get.vertex.attribute(classGraph,"exprsMeanDiff"))
1539:                 if(!is.null(igraph::get.vertex.attribute(classGraph,"discriminantPower")))
1541:                     discPower<-round(as.numeric(igraph::get.vertex.attribute(classGraph,"discriminantPower")))
1555:                 if(!is.null(igraph::get.vertex.attribute(classGraph,"discriminantPower")))
1560:                 if(!is.null(classificationGenes)) # alguna comprobacion mas?
1562:                     vertexShape[which(igraph::get.vertex.attribute(classGraph,"name")%in% as.vector(getRanking(classificationGenes, showGeneID=TRUE)$geneID))] <- "square"
1567:                 relColors <- ifelse( igraph::get.edge.attribute(classGraph,"relation")==levels(factor(igraph::get.edge.attribute(classGraph,"relation")))[1], relColors[1],relColors[2])
1571:                     if(igraph::ecount(classGraph) > 0)
1573:                         igraph::tkplot(classGraph, layout=graphLayout, vertex.label=vertexLabels, vertex.label.family="sans",  vertex.color=vert...(178 bytes skipped)...
1583:                     plot(classGraph, layout=graphLayout, vertex.label=vertexLabels, vertex.label.family="sans",  vertex.label.cex=...(219 bytes skipped)...
1586:             graphList <- c(graphList, graph=list(classGraph))
1607:             text(0,0.6,"Node shape: Chosen/Not chosen for classification", pos=4, font=2)
129:     #nclasses <- dim(mxcf)[1]
131:     numNA <- sum(mxcf[,nclasses+1])
133:     byClass <- matrix(nrow=nclasses, ncol=4)
137:     falseNegatives <- array(0,dim=nclasses)
138:     falsePositives <- array(0,dim=nclasses)
139:     trueNegatives <- array(0,dim=nclasses)
140:     truePositives <- array(0,dim=nclasses)
144:         for(j in 1:nclasses)  #dim(mxcf)[2])  Para incluir NA
156:     for (i in 1:nclasses) #We need another loop in order to have the whole trueNegatives ready
CancerSubtypes:R/internal.R: [ ]
427:   class <- unique(x)
169: affinityMatrix <- function(Diff,K=20,sigma=0.5) {
406:   classx <- unique(x)
407:   classy <- unique(y)
105: .distanceWeighted2<-function(X,weight)  ##X is the expression Matrix(Row is sample, column is feature) 
155: #' This is the affinity Matrix function extracted from SNFtool package.
429:   nc <- length(class)
433:     prob[i] <- sum(x == class[i])/nx
12: #' #W1 = affinityMatrix(Dist1, 20, 0.5)
163: #' W1 = affinityMatrix(Dist1, 20, 0.5)
196:   ###You can do various applications on this graph, such as clustering(subtyping), classification, prediction.
409:   ncx <- length(classx)
410:   ncy <- length(classy)
415:       probxy[i, j] <- sum((x == classx[i]) & (y == classy[j])) / nx
psichomics:R/analysis.R: [ ]
888:             warn <- tags$div(class="alert alert-warning", role="alert",
969:             error <- tagList(h4("t-test"), tags$div(class="alert alert-danger",
118: #' @param match Matrix: match between samples and subjects
254:     class(survTime) <- c("data.frame", "survTime")
407:     class(res) <- c("survTerms", class(res))
556:     if ("simpleError" %in% class(survTerms)) {
686:         if ("simpleError" %in% class(survTerms)) return(NA)
975:             warn <- tags$div(class="alert alert-warning", role="alert",
1220:     type <- sapply(cols, function(i) class(df[[i]]))
2064: #' @return A list with class \code{"htest"} containing the following components:
2103:     class(rval) <- "htest"
2710:             type <- sapply(cols, function(i) class(stats[[i]]))
3178:         div(class="col-sm-6 col-md-4",
3179:             div(class="thumbnail", style="background:#eee;",
3180:                 div(class="caption", uiOutput(ns(id)))))
3193:             class="btn-info btn-md btn-block", class="visible-lg visible-md"),
3196:             class="btn-info btn-xs btn-block", class="visible-sm visible-xs"))
3214:         actionButton(ns("analyse"), "Perform analyses", class="btn-primary"),
3224:         div(class="row", card("ttest"), card("levene")),
3226:         div(class="row", card("wilcox"), card("kruskal"), card("fligner")))
3307:             event, class=NULL, showPath=FALSE, showText=FALSE,
3315:             event, class=NULL, showPath=FALSE, showText=FALSE,
ISAnalytics:R/internal-functions.R: [ ]
256:                 class = "xls_file"
725:             class = "missing_path_col"
764:                     class = "filter_warn"
1510:             class = "malformed_ism"
31: # @param x A data.frame object (or any extending class)
50: # @param x A data.frame object (or any extending class)
73: # @param x A data.frame object (or any extending class)
125: #---- USED IN : import_single_Vispa2Matrix ----
1466: # A single threaded and simplified version of import_single_Vispa2Matrix
135: # * "NEW" :  for the classic Vispa2 annotated/not annotated matrices
192:         .mandatory_IS_types("classic")
199:             .annotation_IS_types("classic")
1497:             ### If not, switch to classic for reading
1498:             mode <- "classic"
BioNERO:R/gcn_inference.R: [ ]
428:     hm <- WGCNA::labeledHeatmap(Matrix = modtraitcor,
407:     textMatrix <- paste(signif(modtraitcor, 2), modtraitsymbol, sep = "")
732:             # Create a data frame containing annotations and the annotation class
741:             # Add column containing the annotation class
408:     dim(textMatrix) <- dim(modtraitcor)
412:         textMatrix <- t(textMatrix)
433:                                 textMatrix = textMatrix, setStdMargins = FALSE,
HiCBricks:R/Brick_functions.R: [ ]
2168:     Matrix <- Brick_get_matrix(Brick = Brick, chr1 = chr1, chr2 = chr2,
2255:     Matrix <- Brick_get_vector_values(Brick = Brick, chr1=chr1, chr2=chr2,
554:     Matrix_info <- return_configuration_matrix_info(Brick)
776:     Matrix.list.df <- do.call(rbind,chr1.list)
1613:     Matrix.list <- Brick_list_matrices(Brick = Brick, chr1 = chr1, 
1657:     Matrix.list <- Brick_list_matrices(Brick = Brick, chr1 = chr1, chr2 = chr2,
1713:     Matrix.list <- Brick_list_matrices(Brick = Brick, chr1 = chr1, chr2 = chr2,
1803:     Matrix.list <- Brick_list_matrices(Brick = Brick, chr1 = chr1, chr2 = chr2,
1898:     Matrix.list <- Brick_list_matrices(Brick = Brick, chr1 = chr1, chr2 = chr2,
10: #' project. At the end, this function will return a S4 object of class 
74: #' A value of length 1 of class character or numeric specifying the resolution 
138: #' the function will return an object of class BrickContainer.
555:     current_resolution <- vapply(Matrix_info, function(a_list){
561:     chrom1_binned_length <- vapply(Matrix_info[current_resolution], 
565:     chrom1s <- vapply(Matrix_info[current_resolution], 
569:     chrom1_max_sizes <- vapply(Matrix_info[current_resolution], 
646: #' An object of class ranges specifying the ranges to store in the Brick.
652: #' When an object of class BrickContainer is provided, resolution defines the 
661: #' When an object of class BrickContainer is provided, num_cpus defines the
692:     if(!(class(ranges) %in% "GRanges") | ("list" %in% class(ranges))){
693:         stop("Object of class Ranges expected")
777:     rownames(Matrix.list.df) <- NULL
778:     return(Matrix.list.df)
954:     BrickContainer_class_check(Brick)
1127: #' Indexes is a column of class \code{IRanges::IntegerList}, which is
1169:         stop("Provided chr, start, end do not match expected class ",
1314: #' Matrix_file <- system.file(file.path("extdata", 
1319: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
1326:     BrickContainer_class_check(Brick)
1367:         Matrix.file = matrix_file, delim = delim, Group.path = Group.path, 
1411: #' Matrix_file <- system.file(file.path("extdata", 
1416: #' chr = "chr2L", resolution = 100000, matrix_file = Matrix_file, 
1462:         Matrix.file = matrix_file, delim = delim, Group.path = Group.path,
1596: #' Matrix_file <- system.file(file.path("extdata", 
1601: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
1615:     return(Matrix.list[Matrix.list$chr1 == chr1 &
1616:         Matrix.list$chr2 == chr2, "done"])
1640: #' Matrix_file <- system.file(file.path("extdata", 
1645: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
1659:     return(Matrix.list[Matrix.list$chr1 == chr1 &
1660:         Matrix.list$chr2 == chr2, "sparsity"])
1692: #' Matrix_file <- system.file(file.path("extdata", 
1697: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
1715:     return((Matrix.list[Matrix.list$chr1 == chr1 &
1716:         Matrix.list$chr2 == chr2, "distance"]))
1747: #' Matrix_file <- system.file(file.path("extdata", 
1752: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
1786: #' Matrix_file <- system.file(file.path("extdata", 
1791: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
1805:     Filter <- Matrix.list$chr1 == chr1 & Matrix.list$chr2 == chr2
1806:     Extent <- c(Matrix.list[Filter, "min"],Matrix.list[Filter, "max"])
1832: #' Matrix_file <- system.file(file.path("extdata", 
1837: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
1881: #' Matrix_file <- system.file(file.path("extdata", 
1886: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
1900:     Filter <- Matrix.list$chr1 == chr1 & Matrix.list$chr2 == chr2
1901:     Extent <- Matrix.list[Filter, "filename"]
1947: #' Matrix_file <- system.file(file.path("extdata", 
1952: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
2098: #' Matrix_file <- system.file(file.path("extdata", 
2103: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
2136:             " found x_coords class ", class(x_coords), " and y_coords class ",
2137:             class(y_coords))
2154:         stop(chr1," ",chr2," matrix is yet to be loaded into the class.")
2171:     return(Matrix)
2211: #' Matrix_file <- system.file(file.path("extdata", 
2216: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
2245:         stop(chr1,chr2," matrix is yet to be loaded into the class.\n")
2258:         return(Matrix)             
2260:         return(FUN(Matrix))
2320: #' Matrix_file <- system.file(file.path("extdata", 
2325: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
2357:         stop("Provided Chromosomes does not appear to be of class character")
2372:         stop("vector must be of class ",
2477: #' Matrix_file <- system.file(file.path("extdata", 
2482: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
2501:         stop("Provided Chromosomes does not appear to be of class character")
2539: #' chromosome pair provided an object of class BrickContainer, and values for 
2546: #' @return Returns an object of class matrix with dimensions corresponding to
2563: #' Matrix_file <- system.file(file.path("extdata", 
2568: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
2579:         stop("Provided Chromosomes does not appear to be of class character")
2636: #' Matrix_file <- system.file(file.path("extdata", 
2641: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
2653:     BrickContainer_class_check(Brick)
2659:         stop("Matrix for this chromsome pair does not exist.\n")  
2663:         stop("Matrix for this chromsome pair is yet to be loaded.\n")  
2716: #' `Brick_export_to_sparse` will accept as input an object of class 
2746: #' Matrix_file <- system.file(file.path("extdata", 
2751: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
2833: #' Matrix_file <- system.file(file.path("extdata", 
2838: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
2847:     BrickContainer_class_check(Brick)
2900: #' Matrix_file <- system.file(file.path("extdata", 
2905: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
2921:     BrickContainer_class_check(Brick)
173:     Reference.object <- GenomicMatrix$new()
330:     Reference.object <- GenomicMatrix$new()
426:     Reference.object <- GenomicMatrix$new()
468:     Reference.object <- GenomicMatrix$new()
549:     Reference.object <- GenomicMatrix$new()
617:     Reference.object <- GenomicMatrix$new()
691:     Reference.object <- GenomicMatrix$new()
756:     Reference.object <- GenomicMatrix$new()
810:     Reference.object <- GenomicMatrix$new()
892:     Reference.object <- GenomicMatrix$new()
953:     Reference.object <- GenomicMatrix$new()
1086:     Reference.object <- GenomicMatrix$new()
1325:     Reference.object <- GenomicMatrix$new()
1366:     RetVar <- ._ProcessMatrix_(Brick = Brick_filepath, 
1423:     Reference.object <- GenomicMatrix$new()
1535:     Reference.object <- GenomicMatrix$new()
1608:     Reference.object <- GenomicMatrix$new()
1652:     Reference.object <- GenomicMatrix$new()
1704:     Reference.object <- GenomicMatrix$new()
1798:     Reference.object <- GenomicMatrix$new()
1848:     Reference.object <- GenomicMatrix$new()
1893:     Reference.object <- GenomicMatrix$new()
1977:     Reference.object <- GenomicMatrix$new()
2494:     Reference.object <- GenomicMatrix$new()
2575:     Reference_object <- GenomicMatrix$new()
2651:     Reference.object <- GenomicMatrix$new()
2707:     Reference.object <- GenomicMatrix$new()
2760:     Reference.object <- GenomicMatrix$new()
2920:     Reference.object <- GenomicMatrix$new()
discordant:R/discordant.R: [ ]
394:         class <- cbind(rep(0, dim(pdata)[1]), rep(0, dim(pdata)[1]))
488:         classMatrix <- matrix(classVector, nrow = featureSize, byrow = FALSE)
439:             sub.class <- cbind(rep(0, subSize), rep(0, subSize))
239:         namesMatrix <- NULL
241:             tempMatrix <- cbind(rep(rownames(x)[i],nrow(y)), rownames(y))
474:         classVector <- finalResult$class
486:         discordPPMatrix <- matrix(discordPPV, nrow = featureSize, 
307:             statMatrix1 <- cor(t(data1), method = cor.method)
308:             statMatrix2 <- cor(t(data2), method = cor.method)
173: em.normal.partial.concordant <- function(data, class, tol=0.001, 
176:     g <- as.integer(nlevels(as.factor(class)))
185:     zx <- unmap(class[,1])
186:     zy <- unmap(class[,2])
203:         loglik=results[[11]], class=apply(array(results[[3]], dim=c(n,g*g)),1,
207: subSampleData <- function(pdata, class, mu, sigma, nu, tau, pi) {
209:     g <- as.integer(nlevels(as.factor(class)))
218:     zx <- unmap(class[,1])
219:     zy <- unmap(class[,2])
227:         results[[9]]), class=apply(array(results[[3]], dim=c(n,g*g)),1,order,
395:         class[pdata[,1]>0+param1,1] <- 2
396:         class[pdata[,1]<0-param1,1] <- 1
397:         class[pdata[,2]>0+param2,2] <- 2
398:         class[pdata[,2]<0-param2,2] <- 1
403:         class <- cbind(rep(0, dim(pdata)[1]), rep(0, dim(pdata)[1]))
404:         class[pdata[,1]>0+param1,1] <- 2
405:         class[pdata[,1]<0-param1,1] <- 1
406:         class[pdata[,1]>0+(2*param1),1] <- 4
407:         class[pdata[,1]<0-(2*param1),1] <- 3
408:         class[pdata[,2]>0+param2,2] <- 2
409:         class[pdata[,2]<0-param2,2] <- 1
410:         class[pdata[,2]>0+(2*param2),2] <- 4
411:         class[pdata[,2]<0-(2*param2),2] <- 3
441:                 sub.class[sub.pdata[,1]>0+param1,1] <- 2
442:                 sub.class[sub.pdata[,1]<0-param1,1] <- 1
443:                 sub.class[sub.pdata[,2]>0+param2,2] <- 2
444:                 sub.class[sub.pdata[,2]<0-param2,2] <- 1
447:                 sub.class[sub.pdata[,1]>0+param1,1] <- 2
448:                 sub.class[sub.pdata[,1]<0-param1,1] <- 1
449:                 sub.class[sub.pdata[,1]>0+(2*param1),1] <- 4
450:                 sub.class[sub.pdata[,1]<0-(2*param1),1] <- 3
451:                 sub.class[pdata[,2]>0+param2,2] <- 2
452:                 sub.class[pdata[,2]<0-param2,2] <- 1
453:                 sub.class[pdata[,2]>0+(2*param2),2] <- 4
454:                 sub.class[pdata[,2]<0-(2*param2),2] <- 3
456:             pd <- em.normal.partial.concordant(sub.pdata, sub.class, 
472:         finalResult <- subSampleData(pdata, class, mu, sigma, nu, tau, pi)
476:         pd <- em.normal.partial.concordant(pdata, class, tol=0.001, 
480:         classVector <- pd$class
491:         rownames(classMatrix) <- rownames(x)
492:         colnames(classMatrix) <- rownames(y)
501:         classMatrix <- discordPPMatrix
504:         classMatrix[diag] <- classVector
507:         rownames(classMatrix) <- rownames(x)
508:         colnames(classMatrix) <- rownames(x)
518:         discordPPV, classMatrix = classMatrix, classVector = classVector, 
161: unmap <- function(classification){
162:     n <- length(classification)
163:     u <- sort(unique(classification))
167:     for (j in 1:k) z[classification == u[j], j] <- 1
242:             namesMatrix <- rbind(namesMatrix, tempMatrix)
251:         namesMatrix <- NULL
257:                 tempMatrix <- cbind(rep(rownames(x)[i],length(index)), 
259:                 namesMatrix <- rbind(namesMatrix, tempMatrix)
264:     vector_names <- apply(namesMatrix, 1, function(k) paste(k[1],"_",k[2],
311:             statMatrix1 <- biwt.cor(data1)
312:             statMatrix2 <- biwt.cor(data2)
318:             statMatrix1 <- SparCC.count(t(data1))
319:             statMatrix2 <- SparCC.count(t(data2))
321:         statMatrix1 <- statMatrix1[1:featureSize,
323:         statMatrix2 <- statMatrix2[1:featureSize,
325:         statVector1 <- as.vector(statMatrix1)
326:         statVector2 <- as.vector(statMatrix2)
334:             statMatrix1 <- cor(t(data1), method = cor.method)
335:             statMatrix2 <- cor(t(data2), method = cor.method)
338:             statMatrix1 <- biwt.cor(data1)
339:             statMatrix2 <- biwt.cor(data2)
345:         statMatrix1 <- SparCC.count(t(data1))
346:         statMatrix2 <- SparCC.count(t(data2))
348:         statVector1 <- as.vector(statMatrix1)
349:         statVector2 <- as.vector(statMatrix2)
350:         diag <- lower.tri(statMatrix1, diag = FALSE)
351:         statVector1 <- statMatrix1[diag]
352:         statVector2 <- statMatrix2[diag]
489:         rownames(discordPPMatrix) <- rownames(x)
490:         colnames(discordPPMatrix) <- rownames(y)
496:         names(classVector) <- vector_names
500:         discordPPMatrix <- matrix(NA,nrow = featureSize, ncol = featureSize)
502:         diag <- lower.tri(discordPPMatrix, diag = FALSE)
503:         discordPPMatrix[diag] <- discordPPV
505:         rownames(discordPPMatrix) <- rownames(x)
506:         colnames(discordPPMatrix) <- rownames(x)
511:         names(classVector) <- vector_names
517:     return(list(discordPPMatrix = discordPPMatrix, discordPPVector = 
519:         probMatrix = zTable, loglik = pd$loglik))
trio:R/qingInternal.R: [ ]
7782:     class = unlist(lapply(elm, FUN=class))
7773:   class.last = NULL
9892:      anyMatrix = inMatrix[,colVec]
3071: 				if(class(data[,m[i]])=="factor") data[,i]=as.character(data[,m[i]])
3074: 				if(class(data[,m[i]])=="factor") data[,i]=as.numeric(as.character(data[,m[i]]))
3077: 				if(class(data[,m[i]])=="factor") data[,i]=as.numeric(as.character(data[,m[i]]))
7793:       if(length(class.last)==length(class)){
7794:         all.m = class.last==class
7795:         if(sum(all.m)!=length(class)) search=FALSE
7809:     class.last=class
7810:     class=NULL
7818:       reStr = paste(c("name", "class", "length"),
7819:                   c("",  class.last[1],  len.last[1]), 
7822:       reStr = paste(c("name", "class", "length"),
7823:                   c(names.last[1],  class.last[1],  len.last[1]), 
9415: 		if(class(data[,i])=="factor") data[,i]=as.numeric(as.character(data[,i]))
9836: util.listMatrix.2matrix <-
9890: function(inMatrix, colVec, discIn=NULL, discVec=NULL, delimVec, digitVec, missingVec=NULL){
9893:      mRow = dim(anyMatrix)[1]
9894:      mCol = dim(anyMatrix)[2]
9899:        re[,1]= inMatrix[,discIn]
9906:          num = anyMatrix[row, col]
Pi:R/xMLcaret.r: [ ]
88: 	class <- as.factor(gs_targets[!is.na(ind)])
87: 	df_predictor_class <- as.data.frame(df_predictor[ind[!is.na(ind)],])
102: ...(4 bytes skipped)...Control <- caret::trainControl(method=c("repeatedcv","cv","oob")[1], number=nfold, repeats=nrepeat, classProbs=TRUE, summaryFunction=caret::twoClassSummary, allowParallel=FALSE)
3: ...(348 bytes skipped)... in rows and predictors in columns, with their predictive scores inside it. It returns an object of class 'sTarget'.
10: ...(71 bytes skipped)...idataion. Per fold creates balanced splits of the data preserving the overall distribution for each class (GSP and GSN), therefore generating balanced cross-vallidation train sets and testing sets. By defa...(44 bytes skipped)...
18: #' an object of class "sTarget", a list with following components:
20: #'  \item{\code{model}: an object of class "train" as a best model}
29: #'  \item{\code{evidence}: an object of the class "eTarget", a list with following components "evidence" and "metag"}
85: 	## predictors + class
89: 	levels(class) <- c("GSN","GSP")
90: 	df_predictor_class$class <- class
94: ...(40 bytes skipped)...ds (%d in GSP, %d in GSN) are used for supervised integration of %d predictors/features (%s).", sum(class=="GSP"), sum(class=="GSN"), ncol(df_predictor), as.character(now)), appendLF=TRUE)
119: 		fit_gbm <- caret::train(class ~ ., 
120: 								data = df_predictor_class, 
158: 		fit_svm <- caret::train(class ~ ., 
159: 								data = df_predictor_class, 
195: 		fit_rda <- caret::train(class ~ ., 
196: 								data = df_predictor_class, 
231: 		fit_knn <- caret::train(class ~ ., 
232: 								data = df_predictor_class, 
267: 		fit_pls <- caret::train(class ~ ., 
268: 								data = df_predictor_class, 
305: 		suppressMessages(fit_nnet <- caret::train(class ~ ., 
306: 								data = df_predictor_class, 
346: 		fit_rf <- caret::train(class ~ ., 
347: 								data = df_predictor_class, 
384:                                        class = c("numeric", 'numeric'),
446: 		fit_myrf <- caret::train(class ~ ., 
447: 								data = df_predictor_class, 
486: 		fit_crf <- caret::train(class ~ ., 
487: 								data = df_predictor_class, 
524: 		fit_glmnet <- caret::train(class ~ ., 
525: 								data = df_predictor_class, 
556: 		fit_glm <- caret::train(class ~ ., 
557: 								data = df_predictor_class, 
589: 		fit_bglm <- caret::train(class ~ ., 
590: 								data = df_predictor_class, 
627: 		fit_blr <- caret::train(class ~ ., 
628: 								data = df_predictor_class, 
669: 		fit_xgbl <- caret::train(class ~ ., 
670: 								data = df_predictor_class, 
712: 		fit_xgbt <- caret::train(class ~ ., 
713: 								data = df_predictor_class, 
792: ...(54 bytes skipped)...atrix of %d rows/genes X %d columns/repeats*folds, aggregated via '%s' (%s) ...", nrow(df_predictor_class), nfold*nrepeat, aggregateBy, as.character(now)), appendLF=TRUE)
917:     class(sTarget) <- "sTarget"
34: #' @seealso \code{\link{xPierMatrix}}, \code{\link{xPredictROCR}}, \code{\link{xPredictCompare}}, \code{\link{xSparseMatrix}}, \code{\link{xSymbol2GeneID}}
57: 		df_predictor <- xPierMatrix(list_pNode, displayBy="score", combineBy="union", aggregateBy="none", RData.location=RData.location...(12 bytes skipped)...
61: 		eTarget <- xPierMatrix(list_pNode, displayBy="evidence", combineBy="union", aggregateBy="none", verbose=FALSE, RData.locat...(30 bytes skipped)...
103: 	fitControl_withoutParameters <- caret::trainControl(method="none", classProbs=TRUE, allowParallel=FALSE)
394:                fit = function(x, y, wts, param, lev, last, classProbs, ...) { 
432:                levels = function(x) x$classes,
818: 		df_full <- as.matrix(xSparseMatrix(df_full, verbose=FALSE))
decoupleR:R/utils-dataset-converters.R: [ ]
326:                 class = "quo_missing_error"
446:             class = "different_set_columns"
332:                 class = "quo_null_error"
468: #' @param mat Matrix in matrix format.
CHETAH:R/Utils_CHETAH.R: [ ]
865:     class <- class(toplot[,1])
688:     classification <- nodeDown(conf = conf, prof = prof, node = 1,
971:     classification <- input$celltype_CHETAH
1263:     classification <- input$celltype_CHETAH
115: CHETAHclassifier <- function (input,
619:     ## as.matrix: in cases were a sparse Matrix is used
868:     if(class == "factor") {
876:     if(class == "numeric" | class == 'integer') {
897: # Plot boxplots grouped by a class variable
898: PlotBox <- function(toplot, class, col = NULL, grad_col = NULL,
902:     class <- data.frame(class, stringsAsFactors = TRUE)
903:     col <- col[levels(class[,1])]
908:     data <- cbind.data.frame(toplot, class)
909:     colnames(data) <- c("score", "class")
912:     plot <- ggplot(data, aes_string(x = 'class', y = 'score')) +
925:         plot <- plot + geom_jitter(aes_string(color = 'class'), size = 0.1)
933:     plot <- plot  + geom_boxplot(aes_string(color = 'class'),
9: #' CHETAH classifies an input dataset by comparing it to
60: #' @param plot.tree Plot the classification tree.
74: #'   \item \strong{classification} a named vector: the classified types
76: #'   \item \strong{tree} the hclust object of the classification tree
78: #'   \item \strong{nodecoor} the coordinates of the nodes of the classification tree
93: #' to produce a classification tree (ct).
99: #' If this is not the case, classification for the cell will stop in the current node.
101: #' these classifications are called \strong{final types}
102: #' For other cells, assignment will stop in a node. These classifications
169:         message("Running without reference cells: classification will only be based on correlations \n")
207:     ## Make an environment to store the classification information and variables in
216:                       tree = NULL, # will be filled with the classification tree
241:     ## For plotting purposes, find the x coordinates of the nodes of the classification tree
289:     ## Add the (visible) classification meta-data
298: # of the current node of the classification tree,
307:     ## (Re)construct the classification tree and cut at the highest node
648: #' (Re)classify after running \code{\link{CHETAHclassifier}} using a confidence threshold \cr
654: #' Selecting 0 will classify all cells, whereas 2 will result i
655: #' n (almost) no cells to be classified. \cr
657: #' @param return_clas Instead of returning the SingleCellExperiment, only return the classification vector
671: #' ## Return only the classification vector
690:     names(classification) <- rownames(prof[[1]])
691:     input$celltype_CHETAH <- classification
692:     if (return_clas) return(classification) else return(input)
721: #' Plots the chetah classification tree with nodes numbered
732: #' A ggplot object of the classification tree
859:         theme_classic() +
914:         theme_classic() +
939: #' Plot the CHETAH classification on 2D visulization like t-SNE
940: #' + the corresponding classification tree,
946: #' @param tree plot the tree, along with the classification
947: #' @param pt.size the point-size of the classication plot
949: #' the classification plot should be returned
986:         extra_nodes <- unique(classification)[!(unique(classification) %in% names(meta_data$nodetypes[[1]]))]
1012:     toplot <- classification
1102: #' Use a reference dataset to classify itself.
1115: #' the columns the classifion labels.
1118: #' classified to the type of the column name.
1120: #' that is classified to an intermediate type
1122: #' A good reference would classify nearly 100% of cells of type A to type A.
1181:     ## Do the classification of this node
1240: #' In the CHETAH classification, replace the name of a Node
1249: #' @param return_clas Instead of returning the SingleCellExperiment, only return the classification vector
1252: #' The SingleCellExperiment with the new classification or if `return_clas = TRUE` the classification vector.
1268:         classification[classification == nodename] <- replacement
1281:         classification[classification %in% replace] <- replacement
1282:         input$celltype_CHETAH <- classification
1283:         if (return_clas) return(classification) else return(input)
1290: #' Launch a web page to interactively go trough the classification
114: #' input_mel <- CHETAHclassifier(input = input_mel, ref_cells = headneck_ref)
294:     }     ### CHETAHclassifier
297: # Called by the CHETAHclassifier. Determines the branches
341: # Called by the CHETAHclassifier via SplitNode.
652: #' @param input a SingleCellExperiment on which \code{\link{CHETAHclassifier}} has been run
723: #' @param input a SingleCellExperiment on which \code{\link{CHETAHclassifier}} has been run
811: #' @param input a SingleCellExperiment on which \code{\link{CHETAHclassifier}} has been run
943: #' @param input a SingleCellExperiment on which \code{\link{CHETAHclassifier}} has been run
1032: #' \code{\link{CHETAHclassifier}}'s ref_cells
1034: #' \code{\link{CHETAHclassifier}}'s ref_profiles
1038: #' @param n_genes as in \code{\link{CHETAHclassifier}}
1039: #' @param fix_ngenes as in \code{\link{CHETAHclassifier}}
1040: #' @param print_steps as in \code{\link{CHETAHclassifier}}
1041: #' @param only_pos as in \code{\link{CHETAHclassifier}}
1107: #' \code{\link{CHETAHclassifier}}'s ref_cells
1112: #' \code{\link{CHETAHclassifier}}
1134:     input <- CHETAHclassifier(input = ref_cells,
1243: #' @param input a SingleCellExperiment on which \code{\link{CHETAHclassifier}} has been run
1292: #' @param input a SingleCellExperiment on which \code{\link{CHETAHclassifier}} has been run
1333:         if (is.null(input@int_metadata$CHETAH)) stop('Please run CHETAHclassifier on the SingleCellExperiment object before calling this funtion')
cTRAP:R/shinyInterface.R: [ ]
27:     alert <- tags$div(class=paste0("alert alert-", type), role="alert", ...)
115:         tags$div(class="container-fluid", style="padding-top: 15px;")
274:         class  <- class(dataset)[[1]]
1153:         class  <- "danger"
1584:                     tags$span(class="help-block", style="margin-top: -10px;",
1388:             corMatrix <- input$corMatrix
1404:             selectedCorMatrix <- loadExpressionDrugSensitivityAssociation(
11: .filterDatasetsByClass <- function(data, class, expected=FALSE) {
12:     selected <- sapply(data, is, class)
14:         # Return values that are expected to turn into the given class
15:         expected <- sapply(data, is, paste0("expected", capitalize(class)))
34:     class(data) <- c("diffExpr", class(data))
51:         title <- div(class="panel-heading", h3(class="panel-title", title))
55:     if (length(body) > 0) body <- div(class="panel-body", ...)
57:         body <- div(id="collapseOne", class="panel-collapse collapse in",
60:     if (!is.null(footer)) footer <- div(class="panel-footer", footer)
61:     div(class=paste0("panel panel-", type), title, body, footer)
132:         cols <- cols[!sapply(table, class)[cols] %in% c("character", "logical")]
162: .prepareReferenceComparisonDT <- function(data, class) {
163:     data <- .filterDatasetsByClass(req(data), class, expected=TRUE)
276:         tags   <- paste0("#", c(class, source), collapse=" ")
287: # Update dataset choices (optionally, filter datasets by class)
288: .updateDatasetChoices <- function(session, id, data, class=NULL) {
289:     if (!is.null(class)) data <- .filterDatasetsByClass(data, class)
332:         actionButton(ns("load"), "Load data", class="btn-primary"))
409:         actionButton(ns("load"), "Load data", class="btn-primary"))
573:         actionButton(ns("load"), "Load data", class="btn-primary"),
925:                                  class="compact hover stripe")
1158:         class  <- "danger"
1163:         class  <- "default"
1168:         class  <- "warning"
1173:         class  <- "success"
1180:         class  <- NULL
1183:         class  <- paste0(c("label label-"), class)
1185:     html   <- tags$span(style=colour, icon, state, ..., class=class)
1222:     class(ranking) <- c(paste0("expected", capitalize(mode)), "expected",
1223:                         class(ranking))
1260:         actionButton(ns("analyse"), "Rank by similarity", class="btn-primary"))
1370:                      class="btn-primary"))
1587:                                  class="btn-primary"))
1742:     elemClasses       <- sapply(lapply(list(...), class), "[[", 1)
100:     rapply(tag, FUN, how="replace", classes="character")
1207:                     selectedDiffExpr, selectedCorMatrix, method,
1355:         selectizeInput(ns("corMatrix"),
1389:             if (!is.null(corMatrix) || corMatrix != "") {
1390:                 dataset <- paste(corMatrix, tolower(dataset))
1397:             corMatrix       <- req(input$corMatrix)
1405:                 corMatrix, path=path)
1409:                         selectedDiffExpr, selectedCorMatrix, method,
1415:                     selectedDiffExpr, selectedCorMatrix, method,
1424:                 "Gene expression and drug sensitivity association"=corMatrix,
singleCellTK:inst/shiny/server.R: [ ]
1405:   shinyjs::addClass(id = "f_button1", class = "btn-block")
4471:       classes <- names(colData(hmTemp$sce))
5596:       classCol <- colData(vals$counts)[[input$deC1Class]]
5597:       classChoices <- sort(as.vector(unique(classCol)))
195:                          label = "Select Input Matrix:",
199:                          label = "Select Input Matrix:",
204:     updateSelectInputTag(session, "clustScranSNNMat", label = "Select Input Matrix:",
1406:   shinyjs::addClass(id = "f_button2", class = "btn-block")
1407:   shinyjs::addClass(id = "f_button3", class = "btn-block")
1408:   shinyjs::addClass(id = "f_button4", class = "btn-block")
1409:   shinyjs::addClass(id = "f_button5", class = "btn-block")
1410:   shinyjs::addClass(id = "f_button6", class = "btn-block")
1411:   shinyjs::addClass(id = "f_button7", class = "btn-block")
1412:   shinyjs::addClass(id = "filterData", class = "btn-block")
1413:   shinyjs::addClass(id = "resetData", class = "btn-block")
1414:   shinyjs::addClass(id = "convertGenes", class = "btn-block")
1415:   shinyjs::addClass(id = "deleterowDatabutton", class = "btn-block")
1416:   shinyjs::addClass(id = "downsampleGo", class = "btn-block")
2637:     shinyjs::show(selector = ".dimRedPCAICA_plotTabset_class")
3608:   shinyjs::addClass(id = "cv_button1", class = "btn-block")
3609:   shinyjs::addClass(id = "cv_button2", class = "btn-block")
3610:   shinyjs::addClass(id = "cv_button3", class = "btn-block")
3985:       pltVars$class <- "factor"
3987:       pltVars$class <- "numeric"
4040:                             conditionClass = pltVars$class, defaultTheme = as.logical(pltVars$defTheme))
4056: ...(44 bytes skipped)...ize = input$adjustlegendsize,legendTitleSize = input$adjustlegendtitlesize,conditionClass = pltVars$class)
4538: ...(7 bytes skipped)...            p("Since more than 12 unique values detected, discrete colors will be assigned for this class")
4561:                  p(paste0("Totally ", nUniq, " unique values in this class of annotation, which is too many to provide manual selection. Coloring will be provided by default....(3 bytes skipped)...
4594:                p("No effective category found for the class.")
4920:     selectInput("batchCheckCorrName", "Corrected Matrix",
5807:                                      class = input$deC1Class,
4472:       selectInput('hmCellAnn', 'Add cell annotation', classes,
4479:       classes <- names(rowData(hmTemp$sce))
4480:       selectInput('hmGeneAnn', 'Add feature annotation', classes,
5599:                   choices = classChoices, multiple = TRUE)
5609:       classCol <- colData(vals$counts)[[input$deC1Class]]
5610:       classChoices <- sort(as.vector(unique(classCol)))
5612:                   choices = classChoices, multiple = TRUE)
5808:                                      classGroup1 = input$deC1G1,
5809:                                      classGroup2 = input$deC1G2,
6673:         vals$effectSizes <- calcEffectSizes(countMatrix = expData(vals$counts, input$snapshotAssay), condition = colData(vals$counts)[, input$selectSnapsho...(12 bytes skipped)...
psichomics:R/groups.R: [ ]
342:             class="btn-group", role="group",
1674:             panel <- tags$div(class="panel panel-info",
2039:                         class="table table-condensed",
168:         div(class="alert alert-danger", role="alert",
335:         id=ns("setOperations"), class="btn-group",
343:             tags$button("More", id=ns(moreId), tags$span(class="caret"),
344:                         class="btn btn-default dropdown-toggle",
347:             tags$ul(class="dropdown-menu dropdown-menu-right",
352:         icon("user"), class=NULL, "Save selected groups",
356:         icon("users"), class=NULL, "Save all groups", id=ns(saveAllGroupsId),
364:         class="btn-group", role="group",
367:                     tags$span(class="caret"),
368:                     class="btn btn-default dropdown-toggle",
371:         tags$ul(class="dropdown-menu dropdown-menu-right",
373:                 tags$li(role="separator", class="divider"), loadGroupsLink))
386:             class="btn-group", role="group",
389:                         tags$span(class="caret"),
390:                         class="btn btn-default dropdown-toggle",
393:             tags$ul(class="dropdown-menu dropdown-menu-right",
398:                                     class="btn-danger",
403:                                    class="li-danger",
409:                                     class="pull-right", icon=icon("pencil-alt"))
421:         colourSelector, class="groups-colourpicker",
424:                                        class="pull-right", disable=FALSE,
428:         id=ns("singleGroupSelected"), class="alert", role="alert",
429:         class="alert-info",
434:                    div(class="input-group", nameField,
435:                        div(class="input-group-btn", renameButton))),
437:                    div(class="input-group", colourSelector,
438:                        div(class="input-group-btn", setColourButton)))))
441:         class="btn-group pull-right",
444:         tags$button(type="button", tags$span(class="caret"),
445:                     class="btn btn-danger dropdown-toggle",
449:         tags$ul(class="dropdown-menu",
490:                      class ="btn-primary"))
510:                      class="btn-primary")
582:                      class="btn-primary")
615:                      class="btn-primary")
631:                      class="btn-primary"))
658: #' @param new Matrix: groups to which colours will be assigned
659: #' @param groups Matrix: groups to check which colours are already assigned
807: #' @return Matrix with the group names and respective elements
827:         if ("simpleError" %in% class(set)) {
844:         if ("simpleError" %in% class(set)) {
891: #' @param dataset Matrix or data frame: dataset
966: #' @param new Matrix: new groups
967: #' @param old Matrix: pre-existing groups
988: #' @param groups Matrix: groups
1003: #' @return Matrix containing groups (new group is in the first row)
1181: #' @return Matrix with groups ordered (or \code{NULL} if there are no groups)
1279: #' @param groups Matrix with groups
1379: #' @return Matrix with groups
1671:                                     class="table table-condensed table-striped")
1676:                               tags$div(class="panel-heading", title), htmlTable)
1693:             plus <- '<i class="fa fa-plus-circle" aria-hidden="true"></i>'
2033:                     class="well-sm",
2291:     class(res) <- c(class(res), "groupIndependenceTest")
2375:     class(df) <- c(class(df), "multiGroupIndependenceTest")
1710:                      orderable=FALSE, className='details-control', targets=0)),
ChromSCape:inst/server.R: [ ]
2466:         DT::datatable(diff, options = list(dom='tpi'), class = "display",
2577:   MSIG.classes <- reactive({
53:     req(input$options.bpparam_class, input$options.nb_workers)
54:     BPPARAM = BiocParallel::bpparam(input$options.bpparam_class)
440:                                       you have to input a single Dense Matrix."),
566:             title = shiny::HTML(paste0("<span style='color: white'><h4> <i class='far fa-caret-square-down'",
578:         title = shiny::HTML(paste0("<span style='color: white'><h4> <i class='far fa-caret-square-down'",
878:     df = data.frame(coverage = sort(unname(Matrix::colSums(init$datamatrix)))) 
912:     df = data.frame(coverage = sort(unname(Matrix::rowSums(init$datamatrix)),decreasing = TRUE))
2019:       return( as.character(icon("check-circle", class = "large_icon")))}
2021:       return( as.character(icon("times-circle", class = "large_icon")))
2653:   output$enr_class_sel <- renderUI({
2656:     inputId = "enr_class_sel", inline = TRUE,
2664:       if(!is.null(scExp_cf()@metadata$enr) && !is.null(input$GSA_group_sel) && !is.null(input$enr_class_sel)){
2669:               enr_class_sel = input$enr_class_sel),
2670:               options = list(pageLength = 10,  dom = 'tpi'), class = 'display', rownames = FALSE)
2684:               enr_class_sel = input$enr_class_sel),
2685:               options = list(pageLength = 10,  dom = 'tpi'), class = 'display', rownames = FALSE)
2700:               enr_class_sel = input$enr_class_sel),
2701:               options = list(pageLength = 10,  dom = 'tpi'), class = 'display', rownames = FALSE)
2741:         most_diff[,"qval"] = Matrix::rowMeans(as.matrix(most_diff[,-1]))
188:     if(input$data_choice_box == "DenseMatrix"){
196:     else if (input$data_choice_box == "SparseMatrix"){
265:    if(input$data_choice_box != "DenseMatrix"){
284:     if(input$data_choice_box != "DenseMatrix"){
285:       if(input$data_choice_box == "SparseMatrix"){
433:         if(type_file == "DenseMatrix" & !is.null(input$datafile_matrix)){
466:           if(type_file == "SparseMatrix") {
481:           if(type_file == "SparseMatrix"){
2632:                                                 GeneSetClasses = MSIG.classes(),progress = progress))
2654:     req(MSIG.classes())
2657:     label =  "Select classes to display:",
2658:     selected = MSIG.classes(), choiceNames = MSIG.classes(),
2659:     choiceValues = MSIG.classes())
2793:     req(pathways(), annotation_id(), MSIG.classes())
2802:       database <- ChromSCape:::load_MSIGdb(annotation_id(), MSIG.classes())
Prostar:inst/ProstarApp/global.R: [ ]
462:     class = "progress",
507:     class = "progress-group",
644:   textEl <- tags$p(class = "navbar-text", text)
654:   form <- tags$form(class = "navbar-form", inputs)
271:     classID = getOption("shiny.table.id", "example")
270:       getOption("shiny.table.class", "table table-striped table-bordered")
280:                 paste("class=\"", classNames, "\" id=\"", classID, "\"", sep = ""),
416:     ,div(class="busy-indicator",p(text),img(src=img))
463:     class = if (!is.null(size)) paste0("progress-", size),
464:     class = if (vertical) "vertical",
465:     class = if (active) "active",
467:       class = "progress-bar",
468:       class = paste0("progress-bar-", color),
469:       class = if (striped) "progress-bar-striped",
478:         class = if (!label) "sr-only", 
508:     tags$span(class = "progress-text", text),
509:     tags$span(class = "progress-number", sprintf("%d / %d", value, max)),
152:                   "Whole matrix" = "WholeMatrix",
158: gFiltersListAnaDiff[["Whole matrix"]] <- "WholeMatrix"
269:     classNames <- 
309:                       "corrMatrix"="corrMatrix", 
320: #   Original = list("boxplot", "densityplot", "heatmap", "CVDistr", "violinplot", "corrMatrix", "MVPlot1","MVPlot2","MVPlot3", "PCA_Ind", "PCA_Var", "PCA_Eigen"),
321: #   Filtered = list("boxplot", "densityplot", "heatmap", "CVDistr", "violinplot", "corrMatrix", "MVPlot1","MVPlot2","MVPlot3", "PCA_Ind", "PCA_Var", "PCA_Eigen"),
322: #   Normalized = list("boxplot", "densityplot", "heatmap", "CVDistr", "violinplot", "corrMatrix", "MVPlot1","MVPlot2","MVPlot3", "PCA_Ind", "PCA_Var", "PCA_Eigen", "compNorm"),
323: #   Aggregated = list("boxplot", "densityplot", "heatmap", "CVDistr", "violinplot", "corrMatrix", "MVPlot1","MVPlot2","MVPlot3", "PCA_Ind", "PCA_Var", "PCA_Eigen"),
324: #   Imputed.peptide = list("boxplot", "densityplot", "heatmap", "CVDistr", "violinplot", "corrMatrix", "MVPlot1","MVPlot2","MVPlot3", "PCA_Ind", "PCA_Var", "PCA_Eigen"),
325: #   Imputed.protein = list("boxplot", "densityplot", "heatmap", "CVDistr", "violinplot", "corrMatrix", "MVPlot1","MVPlot2","MVPlot3", "PCA_Ind", "PCA_Var", "PCA_Eigen"),
326: #   HypothesisTest = list("boxplot", "densityplot", "heatmap", "CVDistr", "violinplot", "corrMatrix", "MVPlot1","MVPlot2","MVPlot3", "PCA_Ind", "PCA_Var", "PCA_Eigen","logFCDistr" )
343:   corrMatrix = "corrMatrix.png",
662: lstDescPlots <- c("intensity", "pca", "varDist", "corrMatrix", "heatmap", "mv", "quantiTable")
musicatk:inst/shiny/server.R: [ ]
15:                      class = "inactiveLink")
17:                      class = "inactiveLink")
19:                      class = "inactiveLink")
21:                      class = "inactiveLink")
23:                      class = "inactiveLink")
25:                      class = "inactiveLink")
27:                      class = "inactiveLink")
29:                      class = "inactiveLink")
31:                      class = "inactiveLink")
33:                      class = "inactiveLink")
35:                      class = "inactiveLink")
73:                        class = "inactiveLink")
118:                        class = "inactiveLink")
162:                        class = "inactiveLink")
164:                        class = "inactiveLink")
226:                        class = "inactiveLink")
228:                        class = "inactiveLink")
230:                        class = "inactiveLink")
232:                        class = "inactiveLink")
234:                        class = "inactiveLink")
246:                      class = "inactiveLink")
254:                      class = "inactiveLink")
256:                      class = "inactiveLink")
258:                      class = "inactiveLink")
262:                      class = "inactiveLink")
264:                      class = "inactiveLink")
272:                      class = "inactiveLink")
274:                      class = "inactiveLink")
276:                      class = "inactiveLink")
280:                      class = "inactiveLink")
282:                      class = "inactiveLink")
290:                      class = "inactiveLink")
292:                      class = "inactiveLink")
294:                      class = "inactiveLink")
296:                      class = "inactiveLink")
298:                      class = "inactiveLink")
300:                      class = "inactiveLink")
2299:         label = "Method for Dissimilarity Matrix",
ClassifyR:R/utilities.R: [ ]
794:   class <- factor(object$groups[min_scores], levels = object$groups)
9:     classColumn <- match(classes, colnames(measurements))
51:       classes <- dataTable[, "class"]
642:     classRow <- which(autoCharacteristics[, "characteristic"] == "Classifier Name")
2: { # DataFrame methods' class variable can be character or factor, so it's a bit involved.
3:   if(class(classes) == "character" && length(classes) > 1)
7:   if(class(classes) == "character")
14:     if(class(classes) != "factor")
31:   } else if("class" %in% colnames(MultiAssayExperiment::colData(measurements))) {
32:     clinicalColumns <- "class"
50:     if("class" %in% colnames(dataTable))
56:     classes <- dataTable[, "class"]
73:   dropColumns <- na.omit(match(c("primary", "class"), colnames(dataTable)))
93:   initialClass <- class(measurements)
114:       if(class(selection) == "SelectResult")
136:       if(class(featuresLists[[1]]) == "SelectResult") # No varieties were returned by the classifier used for resubstitution.
175:   initialClass <- class(measurements)
176:   if(!"list" %in% class(measurements))
189:   if("list" %in% class(transformed[[1]])) transformed <- unlist(transformed, recursive = FALSE)
197:   initialClass <- class(measurements)
198:   if(!"list" %in% class(measurements)) # Will be a DataFrame.
259:           initialTrainClass <- class(trained)
276:             if(class(predicted) != "list" || sum(grepl('=', names(predicted))) == 0)
279:             if(class(predicted[[1]]) == "data.frame") # Predictor returned both scores and classes; just use classes.
280:               predicted <- lapply(predicted, function(variety) variety[, sapply(variety, class) == "factor"])
281:             if(is.numeric(class(predicted[[1]]))) # Can't automatically decide on a threshold. Stop processing.
382:           if(class(trained) != "list" || sum(grepl('=', names(trained))) == 0)
386:           if(class(trained[[1]]) == "data.frame") # Predictor returned both scores and classes. Just use classes.
387:             predictedFactor <- lapply(trained, function(variety) variety[, sapply(variety, class) == "factor"])
388:           else if(class(trained[[1]]) == "factor")
390:           else if(is.numeric(class(trained[[1]]))) # Can't automatically decide on a threshold. Stop processing.
426:   if(!isS4(trained) && "list" %in% class(trained[[1]])) 
440:   initialClass <- class(measurements)
478:   if("list" %in% class(predicted[[1]])) predicted <- unlist(predicted, recursive = FALSE)
493:     if(!"Pairs" %in% class(featureSets))
501:     if(!"Pairs" %in% class(featureSets))
520:     if("list" %in% class(predictions)) # Multiple varieties of predictions.
522:       if(class(predictions[[1]]) == "data.frame")
523:         predictedClasses <- lapply(predictions, function(set) set[, sapply(set, class) == "factor"])
527:       if(class(predictions) == "data.frame")
528:         predictedClasses <- predictions[, sapply(predictions, class) == "factor"]
533:     if("list" %in% class(predictedClasses))
541:   if("numeric" %in% class(performances))
573:       if(!"Pairs" %in% class(featureSets))
586:   else if(!"Pairs" %in% class(featureSets))
627:   else if("Pairs" %in% class(importantFeatures[[1]]))
629:   else if(class(importantFeatures[[1]]) == "list" && is.character(importantFeatures[[1]][[1]])) # Two-level list, s...(42 bytes skipped)...
631:   else if(class(importantFeatures[[1]]) == "list" && is.data.frame(importantFeatures[[1]][[1]])) # Data set and fea...(16 bytes skipped)...
633:   else if(class(importantFeatures[[1]]) == "list" && "Pairs" %in% class(importantFeatures[[1]]))
691:   lapply(1:length(densities), function(densityIndex) # All crossing points with other class densities.
734:     stop("There must be at least 2 observations in each class.")
737:   # By default, we estimate the 'a priori' probabilities of class membership with
743:   # For each class, we calculate the MLEs (or specified alternative estimators)
745:   # estimators for each class.
761:   class(obj) <- "dlda"
767:     stop("object not of class 'dlda'")
774:     sapply(object$est, function(class_est) {
775:       with(class_est, sum((obs - xbar)^2 / object$var_pool) + log(prior))
796:   list(class = class, scores = scores, posterior = posterior)
1: .splitDataAndClasses <- function(measurements, classes)
4:     stop("'classes' is a character variable but has more than one element. Either provide a\n",
10:     if(is.na(classColumn))
11:       stop("Specified column name of classes is not present in the data table.")
12:     classes <- measurements[, classColumn]
13:     measurements <- measurements[, -classColumn]
15:       classes <- factor(classes)
17:   list(measurements = measurements, classes = classes)
53:       classes <- NULL
76:   if(!is.null(classes))
77:     list(dataTable = dataTable, classes = classes)
82: .checkVariablesAndSame <- function(trainingMatrix, testingMatrix)
84:   if(ncol(trainingMatrix) == 0)
86:   else if(ncol(trainingMatrix) != ncol(testingMatrix))
90: .doSelection <- function(measurements, classes, featureSets, metaFeatures, training, selectParams, trainParams,
97:   names(classes) <- rownames(measurements[[1]]) # In case training specified by sample IDs rather than numeric in...(6 bytes skipped)...
98:   trainClasses <- droplevels(classes[training])
193: .doTrain <- function(measurements, classes, training, testing, trainParams,
201:   names(classes) <- rownames(measurements[[1]]) # In case training or testing specified by sample IDs rather than...(17 bytes skipped)...
202:   trainClasses <- droplevels(classes[training])
213:       trainFormals <- names(.methodFormals(trainParams@classifier, "DataFrame"))
233:     if(trainParams@classifier@generic != "previousTrained")
235:     else # Don't pass the measurements and classes, because a pre-existing classifier is used.
244:         trained <- do.call(trainParams@classifier, paramList)
251: ...(79 bytes skipped)...", names(trainParams@otherParams))] # Don't pass the tuning optimisation parameters directly to the classifier.
258:           trained <- do.call(trainParams@classifier, paramList)
282:                stop("Only numeric predictions are available. Predicted classes must be provided.")
303:               # Concatenate in case the classifier interally did other parameter tuning and recorded it in the tune attribute.
327:     } else { # Some classifiers do training and testing with a single function.
368:         predictions <- do.call(trainParams@classifier, paramList)
374: ...(79 bytes skipped)...", names(trainParams@otherParams))] # Don't pass the tuning optimisation parameters directly to the classifier.
381:           trained <- do.call(trainParams@classifier, paramList)
391:             stop("Only numeric predictions are available. Predicted classes must be provided.")
418:           message("Parameter tuning and classification completed.")
482: .pickFeatures <- function(measurements, classes, featureSets, trainParams, predictParams,
504:       trained <- .doTrain(measurementsSubset, classes, 1:nrow(measurementsSubset), 1:nrow(measurementsSubset),
508:       trained <- .doTrain(measurements, classes, 1:nrow(measurements), 1:nrow(measurements),
535:       lapply(predictedClasses, function(classSet) calcExternalPerformance(classes, classSet, resubstituteParams@performanceType))
537:       calcExternalPerformance(classes, predictedClasses, resubstituteParams@performanceType)
644:     if(autoCharacteristics[classRow, "value"] == autoCharacteristics[predRow, "value"])
724:       stop("The number of 'prior' probabilities must match the number of classes in 'y'.")
744:   # for each parameter used in the DLDA classifier. The 'est' list contains the
754:   # Calculates the pooled variance across all classes.
829: .rebalanceTrainingClasses <- function(measurements, classes, training, testing, balancing)
831:   samplesPerClassTrain <- table(classes[training])
834:   trainBalanced <- as.vector(mapply(function(classSize, className)
836:     if(balancing == "downsample" && classSize > downsampleTo)
837:       sample(which(classes[training] == className), downsampleTo)
838:     else if(balancing == "upsample" && classSize < upsampleTo)
839:       sample(which(classes[training] == className), upsampleTo, replace = TRUE)
841:       which(classes[training] == className)
844:   classes <- classes[c(training[trainBalanced], testing)]
846:   testing <- (length(training) + 1):length(classes)
848:   list(measurements = measurements, classes = classes, training = training, testing = testing)
Pi:R/xMLrandomforest.r: [ ]
89: 	class <- as.factor(gs_targets[!is.na(ind)])
88: 	df_predictor_class <- as.data.frame(df_predictor[ind[!is.na(ind)],])
3: ...(283 bytes skipped)... in rows and predictors in columns, with their predictive scores inside it. It returns an object of class 'sTarget'.
9: ...(71 bytes skipped)...idataion. Per fold creates balanced splits of the data preserving the overall distribution for each class (GSP and GSN), therefore generating balanced cross-vallidation train sets and testing sets. By defa...(44 bytes skipped)...
20: #' an object of class "sTarget", a list with following components:
32: #'  \item{\code{evidence}: an object of the class "eTarget", a list with following components "evidence" and "metag"}
86: 	## predictors + class
90: 	df_predictor_class$class <- class
94: ...(40 bytes skipped)...ds (%d in GSP, %d in GSN) are used for supervised integration of %d predictors/features (%s).", sum(class==1), sum(class==0), ncol(df_predictor), as.character(now)), appendLF=TRUE)
104: 			message(sprintf("2. GS matrix of %d rows/genes X %d columns (predictors+class) are used as train set (%s) ...", nrow(df_predictor_class), ncol(df_predictor_class), as.character(now)), appendLF=TRUE)
106:         	message(sprintf("2. GS matrix of %d rows/genes X %d columns (predictors+class...(102 bytes skipped)...e remaining '1/%d' as test set. These spits are repeated over %d times (%s) ...", nrow(df_predictor_class), ncol(df_predictor_class), nfold, nfold-1, nfold, nfold, nrepeat, as.character(now)), appendLF=TRUE)
112: 	# preserve the overall class distribution
116: 		index_sets <- caret::createMultiFolds(y=df_predictor_class$class, k=nfold, times=nrepeat)
121: 			res_ls <- caret::createFolds(y=df_predictor_class$class, k=nfold, list=TRUE, returnTrain=TRUE)
143: 			trainset <- df_predictor_class[index_sets[[i]],]
146: 				message(sprintf("\tFold %d: %d GSP + %d GSN", i, table(trainset$class)[2], table(trainset$class)[1]), appendLF=TRUE)
159: 			#suppressMessages(rf.model <- randomForest::randomForest(class ~ ., data=trainset, importance=TRUE, ntree=ntree, mtry=mtry, ...))
160: 			suppressMessages(rf.model <- randomForest::randomForest(class ~ ., data=trainset, importance=TRUE, ntree=ntree, mtry=mtry))
166: 			trainset <- df_predictor_class[trainindex,]
169: 				message(sprintf("\tRepeatFold %d: %d GSP + %d GSN", i, table(trainset$class)[2], table(trainset$class)[1]), appendLF=TRUE)
183: 			#suppressMessages(rf.model <- randomForest::randomForest(class ~ ., data=trainset, importance=TRUE, ntree=ntree, mtry=mtry, ...))
184: 			suppressMessages(rf.model <- randomForest::randomForest(class ~ ., data=trainset, importance=TRUE, ntree=ntree, mtry=mtry))
194: ...(51 bytes skipped)...eature importance matrix of %d rows/predictors X %d columns/repeats*folds (%s).", ncol(df_predictor_class)-1, nfold*nrepeat, as.character(now)), appendLF=TRUE)
229: 	trainset <- df_predictor_class
240: 	suppressMessages(rf.model.overall <- randomForest::randomForest(class ~ ., data=trainset, importance=TRUE, ntree=ntree, mtry=mtry))
241: 	rf.model.overall.importance <- randomForest::importance(rf.model.overall, type=NULL, class=NULL, scale=TRUE)[,3:4]
249: ...(38 bytes skipped)...OC matrix of %d rows (Supervised + predictors) X %d columns/repeats*folds (%s).", ncol(df_predictor_class), nfold*nrepeat, as.character(now)), appendLF=TRUE)
259: 		testset <- df_predictor_class[-trainindex,]
351: ...(54 bytes skipped)...atrix of %d rows/genes X %d columns/repeats*folds, aggregated via '%s' (%s) ...", nrow(df_predictor_class), nfold*nrepeat, fold.aggregateBy, as.character(now)), appendLF=TRUE)
473:     class(sTarget) <- "sTarget"
37: #' @seealso \code{\link{xPierMatrix}}, \code{\link{xSparseMatrix}}, \code{\link{xPredictROCR}}, \code{\link{xPredictCompare}}, \code{\link{xSymbol2GeneID}}
58: 		df_predictor <- xPierMatrix(list_pNode, displayBy="score", combineBy="union", aggregateBy="none", RData.location=RData.location...(12 bytes skipped)...
62: 		eTarget <- xPierMatrix(list_pNode, displayBy="evidence", combineBy="union", aggregateBy="none", verbose=FALSE, RData.locat...(30 bytes skipped)...
206: 	df_res <- as.matrix(xSparseMatrix(df_res, verbose=FALSE))
294: 		df_res <- as.matrix(xSparseMatrix(df_res[,-4], verbose=FALSE))
317: 		df_res <- as.matrix(xSparseMatrix(df_res[,-3], verbose=FALSE))
362: 	df_full <- as.matrix(xSparseMatrix(df_full, verbose=FALSE))
pcaExplorer:R/pcaExplorer.R: [ ]
2684:     class = "footer",
84:                               class = "btn_no_border",
225:               # class = "btn btn-info"),
307:             downloadButton("downloadData", "Download", class = "btn btn-success"),
318:             actionButton("compute_pairwisecorr", "Run", class = "btn btn-primary"),
735:             actionButton("composemat", "Compose the matrix", icon = icon("spinner"), class = "btn btn-primary"),
818:                    actionButton("updatepreview_button", "Update report", class = "btn btn-primary"), p()
820:             column(3, downloadButton("saveRmd", "Generate & Save", class = "btn btn-success"))
971:                      class = "btn btn-primary", icon = icon("spinner")),
974:                      class = "btn btn-primary", icon = icon("spinner")),
977:                      class = "btn btn-primary", icon = icon("spinner"))
1130:       actionButton(inputId = "show_cm", label = HTML("Show </br>count matrix"), class = "btn btn-success")
1139:       actionButton(inputId = "show_metadata", label = HTML("Show </br>sample metadata"), class = "btn btn-success")
1148:       actionButton(inputId = "show_dds", label = HTML("Show </br><code>dds</code> object"), class = "btn btn-success")
1157:       actionButton(inputId = "show_annotation", label =  HTML("Show </br>gene annotation"), class = "btn btn-success")
1207:         actionButton("button_diydds", label = HTML("Generate the dds and </br>dst objects"), class = "btn btn-success"),
2008:         actionButton("computepca2go", "Compute the PCA2GO object", icon = icon("spinner"), class = "btn btn-primary")
2140:       class(input$pc_x)
2142:       class(datatable(values$mypca2go[[paste0("PC", input$pc_x)]][["posLoad"]]))
2687:       class = "foot-inner",
31: #' dds_airway <- DESeq2::DESeqDataSetFromMatrix(assay(airway),
1239:                        values$mydds <- DESeqDataSetFromMatrix(countData = values$mycountmatrix,
1295:           values$mydds <- DESeqDataSetFromMatrix(countData = values$mycountmatrix,
MotifDb:misc/hocomoco-v11/importV11.R: [ ]
382:    class <- substr(x, 12, 12)
302:   rawMatrixList <- readRawMatrices("./", dataDir)
384:    tbl.secondary$dataSource[unmapped.secondary.only] <- paste0("HOCOMOCOv11-secondary-", class[unmapped.secondary.only])
385:    tbl.secondary$dataSource[mapping] <-  paste0("HOCOMOCOv11-core-", class[mapping])
303:   length(rawMatrixList)
304:   matrices <- extractMatrices (rawMatrixList)
spatialHeatmap:inst/extdata/shinyApp/R/global.R: [ ]
287:   lapply(ft, function(i) { tag("span", list(class = class(i), tags$span(class = "glyphicon glyphicon-move"), i)) }
296:  span(class = "panel panel-default",
297:    div(class = "panel-heading", x), 
298:    div(class = "panel-body", id = ns(x))
303:  span(class = "panel panel-default",
304:    div(class = "panel-heading", names(x)), 
305:    div(class = "panel-body", id = ns(names(x)), ft2tag(x[[1]]))
156:   if (is(input, 'dgCMatrix')|is(input, 'matrix')) input <- as.data.frame(as.matrix(input))
debrowser:R/funcs.R: [ ]
278:     tags$button(id = inputId, type = "button", class = paste("btn action-button",
264:         btn.css.class <- paste("btn", styleclass, sep = "-")
268:         btn.size.class <- paste("btn", size, sep = "-")
299: getNormalizedMatrix <- function(M = NULL, method = "TMM") {
246: #' @param styleclass The Bootstrap styling class of the button--options are
251: #' @param css.class Any additional CSS class one wishes to add to the action
261:         block = FALSE, icon = NULL, css.class = "", ...) {
265:     } else btn.css.class = ""
269:     } else btn.size.class = ""
276:         icon.code <- HTML(paste0("<i class='fa fa-", icon, "'></i>"))
279:         btn.css.class, btn.size.class, btn.block, css.class, collapse = " "),
486:                       if($('#dataprepMenu').attr('class')!='active'){   
491:                       if($('#dataprepMethod').attr('class')!='active'){   
497:                       if($('#discoveryMenu').attr('class')!='active'){   
181:                actionButtonDE(paste0("show",tablename), "Show Data", styleclass = "primary", icon="show"),
260: actionButtonDE <- function(inputId, label, styleclass = "", size = "",
262:     if (styleclass %in% c("primary", "info", "success", "warning",
284: #' getNormalizedMatrix
289: #' @note \code{getNormalizedMatrix}
295: #'     x <- getNormalizedMatrix(mtcars)
313:         dds <- DESeqDataSetFromMatrix(countData = as.matrix(M),
355:         styleclass="info", size="small")
ISAnalytics:R/import-functions.R: [ ]
73:                     class = "unsup_comp_format"
442:         rlang::inform(summary_report, class = "summary_report")
47: import_single_Vispa2Matrix <- function(path,
45: #' matrix <- import_single_Vispa2Matrix(matrix_path)
87:             class = "malformed_ism"
132:         class = "ism_import_summary"
69:             ### If not, switch to classic for reading
70:             mode <- "classic"
pRolocGUI:R/pRolocVis_explore.R: [ ]
392:   ui <- tags$body(class="skin-blue right-sidebar-mini control-sidebar-open", dashboardPagePlus(header,
213:   myclasses <- colnames(pmarkers)
52:   else stop(paste("Object must be of class MSnSet or matrix"))  
80:   #           stop(paste("Matrix rownames and feature names don't match"))
246:                          or add the class labels on the spatial map click 
248:                          name. All class labels can be added back to the plot 
332:                 tabPanel("Profiles (by class)", value = "profilesPanel2",
417:     ## Get coords for proteins according to selectized marker class(es)
830:     #     addClass(selector = "body", class = "sidebar-collapse")
831:     #     removeClass(selector = "body", class = "control-sidebar-open")
833:     #     removeClass(selector = "body", class = "sidebar-collapse")
834:     #     addClass(selector = "body", class = "control-sidebar-open")
837:     # observeEvent(input$openright, {addClass(selector = "body", class = "control-sidebar-open")})
238:     p(strong("Subcellular classes")),
245:                          belong to pre-defined subcellular classes. To remove 
504:       ## get quantiles for subcellular classes
505: ...(12 bytes skipped)...fs <- lapply(mrkSel(), function(z) profs[z, , drop = FALSE])   # 5% and 95% quantiles for all other classes
696:           ## get quantiles for subcellular classes
697: ...(2 bytes skipped)...        mrkProfs <- lapply(mrkSel(), function(z) profs[z, ])   # 5% and 95% quantiles for all other classes
214:   colPicker <- function(x) {colourpicker::colourInput(col_ids[x], myclasses[x], value = appStockcol()[x])}
427:       names(cols_user) <-  myclasses
metaseqR2:R/main.R: [ ]
2745:             invisible(knitr::knit_meta(class=NULL,clean=TRUE))
1557:                 tempMatrix <- round(counts(normGenes,normalized=TRUE))
1586:                 classes <- asClassVector(sampleList)
1554:         switch(class(normGenes)[1], 
1585:                 # Dribble for taking a mtx out of SeqCountSet class
1636:             switch(class(normGenes)[1],                           
1873:     switch(class(normGenesExpr)[1],
1556:                 #tempMatrix <- round(DESeq::counts(normGenes,normalized=TRUE))
1560:                 tempMatrix <- round(DESeq2::counts(normGenes,normalized=TRUE))
1566:                 tempMatrix <- round(t(t(normGenes$counts)/scl)*mean(scl))
1569:                 tempMatrix <- normGenes
1572:                 tempMatrix <- as.matrix(normGenes)
1575:                 tempMatrix <- as.matrix(round(sweep(normGenes$counts,2,
1579:                 tempMatrix <- as.matrix(round(normGenes$pseudo.counts))
1582:                 tempMatrix <- as.matrix(round(excounts(normGenes)))
1587:                 theDesign <- data.frame(condition=classes,
1593:                 #tempMatrix <- as.matrix(round(DESeq::counts(cds,
1595:                 tempMatrix <- as.matrix(round(counts(cds,normalized=TRUE)))
1601:             geneFilterOut <- filterGenes(tempMatrix,geneData,geneFilters,
1629:             geneCountsDead <- tempMatrix[theDead,]
1635:             theDeadInd <- match(theDead,rownames(tempMatrix))  
1686:                     classes <- asClassVector(sampleList)
1687:                     theDesign <- data.frame(condition=classes,
1911:             classes <- asClassVector(sampleList)
1912:             theDesign <- data.frame(condition=classes,
hipathia:R/stats.R: [ ]
212:         class <- "0"
354:         class <- "0"
391:         class <- "0"
51: #' @return Matrix of gene expression whose values are in [0,1].
218:             class <- "DOWN" ## regarding DISEASE
220:             class <- "UP" ## regarding DISEASE
223:                 class <- "UP"
225:                 class <- "DOWN"
227:                 class <- 0
231:     result <- data.frame(pvalue, class, esti, stringsAsFactors = FALSE)
244: #' including the classes to compare, or a character vector with the class to
338:                            data2$class == "0" &
360:             class <- "UP"
362:             class <- "DOWN"
364:             class <- "0"
368:                          class = class,
398:             class <- "DOWN" ## regarding DISEASE
400:             class <- "UP" ## regarding DISEASE
403:                 class <- "UP"
405:                 class <- "DOWN"
407:                 class <- 0
411:     result <- data.frame(pvalue, class, stat,stringsAsFactors=FALSE)
427: #' @return \code{do_pca} returns a list with class \code{princomp}.
77:         stop("Only SummarizedExperiment or matrix classes accepted as data")
288:         stop("Only SummarizedExperiment or matrix classes accepted as data")
443:         stop("Only SummarizedExperiment or matrix classes accepted as data")
469:         stop("Only SummarizedExperiment or matrix classes accepted as data")
pcaMethods:R/pca.R: [ ]
122:     Matrix <- as.matrix(object[,num])
125:     Matrix <- t(exprs(object))
127:   Matrix <- as.matrix(object, rownames.force=TRUE)
130:     Matrix <- Matrix[,subset]
135:   if (nPcs > ncol(Matrix)) {
137:     nPcs <- min(dim(Matrix))
139:   if (nPcs > nrow(Matrix)) {
141:     nPcs <- min(dim(Matrix))
144:   if (!checkData(Matrix, verbose=interactive()))
148:   missing <- is.na(Matrix)
162:   prepres <- prep(Matrix, scale=scale, center=center, simple=FALSE, ...)
196:   rownames(res@scores) <- rownames(Matrix)
197:   if(all(dim(loadings(res)) == c(ncol(Matrix), nPcs))) {
199:     rownames(res@loadings) <- colnames(Matrix)
205:   res@nObs <- nrow(Matrix)
206:   res@nVar <- ncol(Matrix)
217:     cObs <- Matrix
219:       cObs[missing] <- fitted(res, Matrix, pre=TRUE, post=TRUE)[missing]
225:     res@cvstat <- Q2(res, Matrix, nruncv=1, ...)
344: ##' @param Matrix Pre-processed (centered and possibly scaled)
364: svdPca <- function(Matrix, nPcs=2, 
367:   pcs <- prcomp(Matrix, center=FALSE, scale.=FALSE)
4: ##' methods based on the classical model where the fitted data is a
31: ##' \describe{\item{svd:}{Uses classical \code{prcomp}. See
HPiP:R/FSmethod.R: [ ]
185:         x$class
2:       function(features, class, cor.cutoff = 0.7) {
23:           cbind(class, .)
33:     .rfeFS <- function(features, class, cor.cutoff = 0.7,
49:         y = as.factor(class),
68:       dataset_rfe <- cbind(class, dataset_rfe)
79:     #' @title Feature Selection via Matrix Correlation and
82:     #' class labels and features.
164:       if (all(colnames(x) != "class") == TRUE) {
165:         stop("class attribute is absent from the data.frame")
182:         dplyr::select(-PPI, -class)
184:       class <-
188:         result <- .filter.corr(features, class, cor.cutoff)
190:         result <- .rfeFS(features, class,
197:           .filter.corr(features, class, cor.cutoff)
204:           dplyr::select(-PPI, -class)
206:         df.class <-
207:           df$class
210:           .rfeFS(df.features, df.class,
HiCBricks:R/table_loader_v2.R: [ ]
372:             Matrix <- matrix(data = 0, 
158:     chr1_class <- class(a_dataframe[,1])
159:     chr2_class <- class(a_dataframe[,2])
160:     value_class <- class(a_dataframe[,3])
153: .check_column_classes <- function(a_dataframe){
32:     Matrix = NULL, group.path = NULL, chrom1 = NULL, chrom2 = NULL,   
36:     real.row.coords <- seq(1,nrow(Matrix),by = 1) + row.offset
37:     real.col.coords <- seq(1,ncol(Matrix),by = 1) + col.offset
38:     Values <- Matrix[cbind(row.pos,col.pos)]
42:             Values <- Matrix[cbind(row.pos,col.pos)]  
43:             Matrix[cbind(col.pos,row.pos)] <- Values  
47:             Count <- dim(t(Matrix))
49:                 Name = dataset.name, data = t(Matrix), Start = Start, 
51:             Matrix[is.na(Matrix) | is.infinite(Matrix) | is.nan(Matrix)] <- 0 
56:                 data = rowSums(t(Matrix)))
61:                 data = rowSums(t(Matrix) > 0))    
65:         Count <- dim(Matrix)
67:             Name = dataset.name, data = Matrix, Start = Start,    
69:         Matrix[is.na(Matrix) | is.infinite(Matrix) | is.nan(Matrix)] <- 0 
74:             data = rowSums(Matrix))   
79:             data = rowSums(Matrix > 0))   
83:         Count <- dim(Matrix)
85:             Name = dataset.name, data = Matrix, Start = Start,    
87:         Matrix[is.na(Matrix) | is.infinite(Matrix) | is.nan(Matrix)] <- 0 
92:                 data = rowSums(t(Matrix)))
97:                 data = rowSums(Matrix))
102:                 data = rowSums(t(Matrix) > 0))    
107:                 data = rowSums(Matrix > 0))
111:     if(min(Matrix) < Min | Min == 0){ 
112:         metrics.list[["extent"]][1] <- min(Matrix)
114:     if(max(Matrix) > Max){    
115:         metrics.list[["extent"]][2] <- max(Matrix)
162:             c(chr1_class, chr2_class, value_class))){
248: # Brick: A S4 object of class BrickContainer
250: # table_file: A vector of class character specifying the path to a tsv 
395:             Matrix[cbind(Temp_table_df$chr1, 
399:                 Matrix = Matrix,
35:     Reference.object <- GenomicMatrix$new()   
179:     .check_column_classes(a_dataframe = Test_table_df)
280:     Reference.object <- GenomicMatrix$new()
splatter:R/SCE-functions.R: [ ]
312:             class <- ifelse(is.logical(mat), "lgCMatrix", "dgCMatrix")
313:             as(mat, class)
338:             warning("matrix '", mat.name, "' is class '", class(mat),
53:     if (is(values, "dgCMatrix")) {
329:         } else if (is(mat, "dgCMatrix")) {
332:                         "' as it is already a dgCMatrix")
349:                 mat <- as(mat, "lgCMatrix")
351:                 mat <- as(mat, "dgCMatrix")
interactiveDisplay:R/ExpressionSet.R: [ ]
9:     shiny::tags$input(id = inputId1, class = "color", value = "EDF8B1",
16:     shiny::tags$input(id = inputId2, class = "color", value = "7FCDBB",
23:     shiny::tags$input(id = inputId3, class = "color", value = "2C7FB8",
252:               if(class(pkg)=="ChipDb"){
285:                 if(class(pkg)=="ChipDb"){
483:             "<div id=\"net\" class=\"shiny-network-output\"><svg /></div>",
554:         #  Distance Matrix
Prostar:inst/ProstarApp/modules/Plots/modulePlots.R: [ ]
49:           class="collapse", 
46:                    class = actionBtnClass),
72:              corrMatrix=ll[[i]] <- tags$div( style="display:inline-block;",imageOutput(ns("plotcorrMatrixsmall"), height='60', width='50')),
90:            corrMatrix=
91:              ll[[n]] <- shinyBS::bsModal("modalcorrMatrix", "Correlation matrix", ns("plotcorrMatrixsmall"), size = "large", uiOutput(ns("plotcorrMatrixlarge"))),
105:     # jqui_resizable("#modalcorrMatrix .modal-content", options = list(handles = 'e'))
18:   source(file.path(".", "modules/Plots/corrMatrixPlots.R"),  local = TRUE)$value
QUBIC:src/matrix.h: [ ]
7: template<typename T> class Matrix {
12:   Matrix(std::size_t reserved_count) {
DiscoRhythm:inst/app/code/ui/rowReplicateAnalysis.R: [ ]
66:                                 ", class = "text-muted")
39:                         p(class="text-muted","Results for this section were
80:                                 class = "text-muted")
91:                 title = "Inspect Final Averaged Data Matrix",
102:                             class = "text-muted"
89:             id = "rowRepMatrixDiv",
HDF5Array:R/H5SparseMatrixSeed-class.R: [ ]
276:         ans_class <- "CSC_H5SparseMatrixSeed"
656: .from_CSC_H5SparseMatrixSeed_to_dgCMatrix <- function(from)
672: .from_CSR_H5SparseMatrixSeed_to_dgCMatrix <- function(from)
61: t.CSC_H5SparseMatrixSeed <- function(x)
70: t.CSR_H5SparseMatrixSeed <- function(x)
255: H5SparseMatrixSeed <- function(filepath, group, subdata=NULL)
482: .extract_array_from_H5SparseMatrixSeed <- function(x, index)
526: .extract_sparse_array_from_H5SparseMatrixSeed <- function(x, index)
549: .read_sparse_block_from_H5SparseMatrixSeed <- function(x, viewport)
64:     class(x) <- "CSR_H5SparseMatrixSeed"
73:     class(x) <- "CSC_H5SparseMatrixSeed"
95:             stop(wmsg("changing the path of a ", class(object), " object ",
282:         ans_class <- "CSR_H5SparseMatrixSeed"
296:     new2(ans_class, filepath=filepath, group=group,
206:             msg2 <- c("H5ADMatrix() constructor if you are trying ",
653: ### Coercion to dgCMatrix
661:     sparseMatrix(i=row_indices, p=indptr, x=data, dims=dim(from),
665: setAs("CSC_H5SparseMatrixSeed", "dgCMatrix",
666:     .from_CSC_H5SparseMatrixSeed_to_dgCMatrix
668: setAs("CSC_H5SparseMatrixSeed", "sparseMatrix",
669:     .from_CSC_H5SparseMatrixSeed_to_dgCMatrix
677:     sparseMatrix(j=col_indices, p=indptr, x=data, dims=dim(from),
681: setAs("CSR_H5SparseMatrixSeed", "dgCMatrix",
682:     .from_CSR_H5SparseMatrixSeed_to_dgCMatrix
684: setAs("CSR_H5SparseMatrixSeed", "sparseMatrix",
685:     .from_CSR_H5SparseMatrixSeed_to_dgCMatrix
2: ### H5SparseMatrixSeed objects
6: setClass("H5SparseMatrixSeed",
33:     ## ------------- populated by specialized subclasses -------------
52: setClass("CSC_H5SparseMatrixSeed", contains="H5SparseMatrixSeed")
53: setClass("CSR_H5SparseMatrixSeed", contains="H5SparseMatrixSeed")
60: ### S3/S4 combo for t.CSC_H5SparseMatrixSeed
67: setMethod("t", "CSC_H5SparseMatrixSeed", t.CSC_H5SparseMatrixSeed)
69: ### S3/S4 combo for t.CSR_H5SparseMatrixSeed
76: setMethod("t", "CSR_H5SparseMatrixSeed", t.CSR_H5SparseMatrixSeed)
84: setMethod("path", "H5SparseMatrixSeed", function(object) object@filepath)
88: setReplaceMethod("path", "H5SparseMatrixSeed",
108: setMethod("dim", "H5SparseMatrixSeed", function(x) x@dim)
110: setMethod("dimnames", "H5SparseMatrixSeed",
253: ### Returns an H5SparseMatrixSeed derivative (can be either a
254: ### CSC_H5SparseMatrixSeed or CSR_H5SparseMatrixSeed object).
365: ### H5SparseMatrixSeed objects.
461: setMethod(".load_sparse_data", "CSC_H5SparseMatrixSeed",
469: setMethod(".load_sparse_data", "CSR_H5SparseMatrixSeed",
495: setMethod("extract_array", "H5SparseMatrixSeed",
496:     .extract_array_from_H5SparseMatrixSeed
505: setMethod("chunkdim", "CSC_H5SparseMatrixSeed", function(x) c(nrow(x), 1L))
507: setMethod("chunkdim", "CSR_H5SparseMatrixSeed", function(x) c(1L, ncol(x)))
514: setMethod("sparsity", "H5SparseMatrixSeed",
524: setMethod("is_sparse", "H5SparseMatrixSeed", function(x) TRUE)
532: setMethod("extract_sparse_array", "H5SparseMatrixSeed",
533:     .extract_sparse_array_from_H5SparseMatrixSeed
537: ### work just fine on an H5SparseMatrixSeed derivative (thanks to the
538: ### extract_sparse_array() method for H5SparseMatrixSeed objects defined
544: ### extract_sparse_array() method for H5SparseMatrixSeed objects would
553:     ## Unlike the extract_sparse_array() method for H5SparseMatrixSeed
559: setMethod("read_sparse_block", "H5SparseMatrixSeed",
560:     .read_sparse_block_from_H5SparseMatrixSeed
627: setMethod("extractNonzeroDataByCol", "CSC_H5SparseMatrixSeed",
642: setMethod("extractNonzeroDataByRow", "CSR_H5SparseMatrixSeed",
693: setMethod("show", "H5SparseMatrixSeed",
GenomicTuples:R/GTuples-class.R: [ ]
280:   ans_class <- class(x[[1L]])
252: ### From GenomicRanges-class.R "For an object with a pure S4 slot 
292:   new(ans_class, 
314:             # NOTE: "c" will error if there is no common class, e.g. 
318:             #   stop("Cannot combine ", paste0(unique(sapply(args, class)),
324:                    paste0(unique(vapply(args, class, character(1L))), 
328:             # "c" silently coerces to lowest common class, e.g., c(1, "next")
331: #             if (!all(sapply(args, class) == class(args[[1]]))) {
333: #                 paste0("Not all elements are same class: ", 
334: #                        paste0(unique(sapply(args, class)), 
337: #                        "class: ", 
454:               stop("Cannot compute IPD from an empty '", class(x), "'.")
480: #       (copied from GenomicRanges/GenomicRanges-class.R).
500:                      stop("replacement value must be a '", class(x), "' object")
647:     cat(class(x), " object with ", lx, " x ", 
653:     cat(class(x), " with 0 tuples and 0 metadata columns:\n", sep = "")
253: ### representation, these both map to initialize. Reference classes will want 
635: #       the print.classinfo argument.
638: showGTuples <- function(x, margin = "", print.classinfo = FALSE, 
640:   if (!identical(print.classinfo, FALSE)) {
641:     stop("'print.classinfo' not implemented")
637: #' @importFrom S4Vectors makePrettyMatrixForCompactPrinting
656:   out <- makePrettyMatrixForCompactPrinting(x, .makeNakedMatFromGTuples)
S4Vectors:R/DataFrame-class.R: [ ]
877:         to_class <- class(to)
939: make_class_info_for_DataFrame_display <- function(x)
17: ## class, as well as some of its methods e.g. names(), as.list() and lapply().
55:         ## class attribute.
56:         if (class(object) == "DataFrame") {
59:             ## change of the internals, only a change of the class attribute.
61:                 message("[updateObject] Setting class attribute of DataFrame ",
63:             class(object) <- class(new("DFrame"))
68:                 message("[updateObject] ", class(object), " object ",
211:     "Note that starting with BioC 3.10, the class attribute ",
220:   ## class() is broken when used within a validity method. See:
222:   #if (class(x) == "DataFrame")
320:         stop("cannot coerce class \"", class(var)[1L], "\" to a DataFrame")
702:     hasNonDefaultMethod(droplevels, class(xi)[1L]) ||
703:       hasS3Method("droplevels", class(xi))
798:         class(from) <- NULL
823:         class(from) <- "table"
878:         if (class(from) == "list") {
882:             if (is(ans, to_class))
884:             ans <- as(ans, to_class, strict=FALSE)
885:             ## Even though coercion from DataFrame to 'class(to)' "worked", it
902:             if (is(from, to_class))
904:             ans <- as(from, to_class, strict=FALSE)
906:                 stop(wmsg("coercion of ", class(from), " object to ", to_class,
927:     function(x) if (class(x) == "DFrame") "DataFrame" else class(x)
970:         m <- rbind(make_class_info_for_DataFrame_display(x), m)
979:         if (class(object) == "DataFrame") {
15: ## DFrame is a concrete DataFrame subclass for representation of in-memory
796: ### But unclass() causes deep copy
891:             ## DataFrame to a DataFrame subclass is that it will set the
926: setMethod("classNameForDisplay", "DFrame",
941:     vapply(x, function(xi) paste0("<", classNameForDisplay(xi), ">"),
951:     cat(classNameForDisplay(x), " with ",
930: setMethod("makeNakedCharacterMatrixForDisplay", "DataFrame",
959:             m <- makeNakedCharacterMatrixForDisplay(x)
963:             m <- rbind(makeNakedCharacterMatrixForDisplay(head(x, nhead)),
965:                        makeNakedCharacterMatrixForDisplay(tail(x, ntail)))
IRanges:R/IPos-class.R: [ ]
495:     object_class <- classNameForDisplay(object)
535:         classinfo <- makeClassinfoRowForCompactPrinting(x, .COL2CLASS)
15: ### Combine the new "parallel slots" with those of the parent class. Make
16: ### sure to put the new parallel slots **first**. See R/Vector-class.R file
30: ### Combine the new "parallel slots" with those of the parent class. Make
31: ### sure to put the new parallel slots **first**. See R/Vector-class.R file
52:     "Starting with BioC 3.10, the class attribute of all ",
60:     if (class(x) == "IPos")
110:     if (class(object) != "IPos")
121:             message("[updateObject] ", class(object), " object is current.\n",
127:         message("[updateObject] ", class(object), " object ",
132:     if (class(object) == "UnstitchedIPos") {
379:         stop(wmsg("all the ranges in the ", class(from), " object to ",
499:     paste0(object_class, " object with ", object_len, " ",
522:         stop(c(wmsg("This ", class(x), " object uses internal representation ",
518: show_IPos <- function(x, margin="", print.classinfo=FALSE)
533:     if (print.classinfo) {
537:         stopifnot(identical(colnames(classinfo), colnames(out)))
538:         out <- rbind(classinfo, out)
549:     function(object) show_IPos(object, print.classinfo=TRUE)
514: setMethod("makeNakedCharacterMatrixForDisplay", "IPos",
529:     ## makePrettyMatrixForCompactPrinting() assumes that head() and tail()
532:     out <- makePrettyMatrixForCompactPrinting(xx)
SummarizedExperiment:R/Assays-class.R: [ ]
190:         ans_class <- class(x)
207:         ans_class <- class(x)
13: ###       - Matrix-like methods: dim, [, [<-, rbind, cbind
46: ### Assays class
192:         as(callGeneric(), ans_class)
209:         ans <- as(callGeneric(), ans_class)
241:     as(endoapply(assays, extract_assay_subset), class(x))
264:     as(mendoapply(replace_assay_subset, assays, values), class(x))
314:     as(SimpleList(res), class(getListElement(objects, 1L)))
333: ### Having "arbind" and "acbind" methods for Matrix objects will make rbind()
334: ### and cbind() work on Assays objects with Matrix list elements.
337: ### to make IRanges depend on the Matrix package.
338: setMethod("arbind", "Matrix", function(...) rbind(...))
339: setMethod("acbind", "Matrix", function(...) cbind(...))
343: ### SimpleAssays class
365: ### ShallowSimpleListAssays class
394: ### AssaysInEnv class
418:         value <- S4Vectors:::normarg_names(value, class(x), length(x))
15: ### An Assays concrete subclass needs to implement (b) (required) plus
367: ### WARNING: Looks like reference classes as implemented in the methods
rhdf5client:R/HSDS_Matrix.R: [ ]
41: HSDS_Matrix = function(url, path, title) {
16: HSDS_Matrix_OLD = function(url, path) {
6: #' This class is deprecated and will be defunct in the next release.
13: #' HSDS_Matrix
30: #' This class is deprecated and will be defunct in the next release.
38: #' HSDS_Matrix(URL_hsds(), "/shared/bioconductor/darmgcls.h5")
4: #' simplify construction of DelayedMatrix from url and path in HSDS
28: #' simplify construction of DelayedMatrix from url and path in HSDS
GenomicAlignments:R/OverlapEncodings-class.R: [ ]
242:     x_class <- class(x)
259:         classinfo <- S4Vectors:::makeClassinfoRowForCompactPrinting(x,
22: ### Combine the new "parallel slots" with those of the parent class. Make
23: ### sure to put the new parallel slots **first**. See R/Vector-class.R file
240: showOverlapEncodings <- function(x, margin="", print.classinfo=FALSE)
246:     cat(classNameForDisplay(x), " object of length ", x_len,
252:     if (print.classinfo) {
262:         stopifnot(identical(colnames(classinfo), colnames(out)))
263:         out <- rbind(classinfo, out)
275:         showOverlapEncodings(object, margin="  ", print.classinfo=TRUE)
250:     out <- S4Vectors:::makePrettyMatrixForCompactPrinting(x,
IRanges:R/IPosRanges-class.R: [ ]
122:     object_class <- classNameForDisplay(object)
164:         classinfo <- makeClassinfoRowForCompactPrinting(x, .COL2CLASS)
38:         target <- new(class(object))@elementType
43:                         class(object), " object is current.\n",
47:                 message("[updateObject] elementType slot of ", class(object),
126:     paste0(object_class, " object with ", object_len, " ",
193:         stop(wmsg(class(x), " objects don't support [[, as.list(), ",
147: show_IPosRanges <- function(x, margin="", print.classinfo=FALSE)
158:     if (print.classinfo) {
166:         stopifnot(identical(colnames(classinfo), colnames(out)))
167:         out <- rbind(classinfo, out)
178:     function(object) show_IPosRanges(object, print.classinfo=TRUE)
8: ### The direct IPosRanges subclasses defined in the IRanges package are:
143: setMethod("makeNakedCharacterMatrixForDisplay", "IPosRanges",
150:     ## makePrettyMatrixForCompactPrinting() assumes that 'x' is subsettable
157:     out <- makePrettyMatrixForCompactPrinting(x)
ComplexHeatmap:R/AnnotationFunction-function.R: [ ]
469: 	image_class = vector("character", n_image)
81: # Subset the Matrix by Rows
88: # Mainly used for constructing the `AnnotationFunction-class` object.
100: # Mainly used for constructing the `AnnotationFunction-class` object.
112: # Mainly used for constructing the `AnnotationFunction-class` object.
473: 			image_class[i] = NA
479: 			image_class[i] = "raster"
485: 			image_class[i] = "raster"
491: 			image_class[i] = "raster"
500: 			image_class[i] = "grImport::Picture"
516: 			image_class[i] = "grImport2::Picture"
556: 			if(image_class[ index[i] ] == "raster") {
558: 			} else if(image_class[ index[i] ] == "grImport::Picture") {
561: 			} else if(image_class[ index[i] ] == "grImport2::Picture") {
585: 			if(image_class[ index[i] ] == "raster") {
587: 			} else if(image_class[ index[i] ] == "grImport::Picture") {
590: 			} else if(image_class[ index[i] ] == "grImport2::Picture") {
613: 		var_import = list(gp, border, space, yx_asp, image_list, image_class)
618: 	anno@subset_rule$image_class = subset_vector
3659: 	# 1. a vector of class labels that the length should be same as the nrow of the matrix
GSgalgoR:R/galgo.R: [ ]
390:         class_results <- mapply(cluster_classify, test_a, centroids,
392:         cluster_class <- unlist(class_results)
44: #' Galgo Object class
53: galgo.Obj <- setClass( # Set the name for the class
118:         if (class(y)[1] == "Surv") {y <- y[, "time"]}
393:         cluster_class <- cluster_class[order(as.vector(unlist(flds)))]
394:         fit_silhouette <- mean(cluster::silhouette(cluster_class,
396:         fit_differences <- surv_fitness(surv_obj, cluster_class, period)
684:     # Matrix with random TRUE false with uniform distribution,
2: #' robust transcriptomic classifiers associated with patient outcome across
13: #' classification of tumors is a difficult task and the results obtained
227: #' @param clustclass a numeric vector with the group label for each patient
254: #' surv_fitness(OS, clustclass = clinical$grade, period = 3650)
255: surv_fitness <- function(OS, clustclass, period) {
259:                 RMST(survival::survfit(OS ~ clustclass), rmean = period)
EnMCB:R/utils.R: [ ]
756:   class.vector <- as.factor(class_vector)
28: removeobjectclass<- function(x){
804: buildIncidenceMatrix<-function (gene.ids, annotation) 
19:   class(x) <- c("ridgemat", class(x))
24:   class(x) <- c("mcb.coxph.penal", class(x))
29:   class(x) <- setdiff(class(x),"mcb.coxph.penal")
465:   if (class(ensemble_model$stacking)[1] == "cv.glmnet")
467:   else if (class(ensemble_model$stacking)[1] == "cph")
705: #error metrics -- Confusion Matrix
749: findAttractors<-function (methylation_matrix, annotation, class_vector, 
764:   new.order <- order(class.vector, colnames(dat.detect.w))
766:   class.vector <- class.vector[new.order]
780:     }, x = class.vector)
786:     }, x = class.vector)
59:     object = removeobjectclass(object)
761:   incidence.matrix <- buildIncidenceMatrix(rownames(dat.detect.w), annotation)
canceR:R/GSEA.1.0.R: [ ]
65:      class.labels1 <- matrix(0, nrow=Ns, ncol=nperm)
66:      class.labels2 <- matrix(0, nrow=Ns, ncol=nperm)
85:      class1.size <- length(C[[1]])
86:      class2.size <- length(C[[2]])
87:      class1.index <- seq(1, class1.size, 1)
88:      class2.index <- seq(class1.size + 1, class1.size + class2.size, 1)
91:         class1.subset <- sample(class1.index, size = ceiling(class1.size*fraction), replace = replace)
92:         class2.subset <- sample(class2.index, size = ceiling(class2.size*fraction), replace = replace)
93:         class1.subset.size <- length(class1.subset)
94:         class2.subset.size <- length(class2.subset)
134:            class1.label1.subset <- sample(class1.subset, size = ceiling(class1.subset.size*fraction.class1))
135:            class2.label1.subset <- sample(class2.subset, size = floor(class2.subset.size*fraction.class1))
500:         class1.size <- length(C[[1]])
501:         class2.size <- length(C[[2]])
612:       class.list <- unlist(strsplit(cls.cont[[3]], " "))
618:       class.v <- vector(length=s, mode="numeric")
995:   class.labels <- CLS$class.v
996:   class.phen <- CLS$phen
63:      reshuffled.class.labels1 <- matrix(0, nrow=Ns, ncol=nperm)
64:      reshuffled.class.labels2 <- matrix(0, nrow=Ns, ncol=nperm)
95:         subset.class1 <- rep(0, class1.size)
101:         subset.class2 <- rep(0, class2.size)
108:         fraction.class1 <- class1.size/Ns
109:         fraction.class2 <- class2.size/Ns
16: GSEA.GeneRanking <- function(A, class.labels, gene.labels, nperm, permutation.type = 0, sigma.correction = "GeneCluster", fraction=1.0, r...(38 bytes skipped)...
31: #   A: Matrix of gene expression values (rows are genes, columns are samples) 
32: #   class.labels: Phenotype of class disticntion of interest. A vector of binary labels having first the 1's and then the 0's 
42: #   s2n.matrix: Matrix with random permuted or bootstraps signal to noise ratios (rows are genes, columns are permutations...(26 bytes skipped)...
43: #   obs.s2n.matrix: Matrix with observed signal to noise ratios (rows are genes, columns are boostraps subsamplings. If fracti...(58 bytes skipped)...
44: #   order.matrix: Matrix with the orderings that will sort the columns of the obs.s2n.matrix in decreasing s2n order
45: #   obs.order.matrix: Matrix with the orderings that will sort the columns of the s2n.matrix in decreasing s2n order
84:      C <- split(class.labels, class.labels)
96:         for (i in 1:class1.size) {
97:             if (is.element(class1.index[i], class1.subset)) {
98:                 subset.class1[i] <- 1
102:         for (i in 1:class2.size) {
103:             if (is.element(class2.index[i], class2.subset)) {
104:                 subset.class2[i] <- 1
107:         subset.mask[, r] <- as.numeric(c(subset.class1, subset.class2))
112:            full.subset <- c(class1.subset, class2.subset)
113:            label1.subset <- sample(full.subset, size = Ns * fraction.class1)
114:            reshuffled.class.labels1[, r] <- rep(0, Ns)
115:            reshuffled.class.labels2[, r] <- rep(0, Ns)
116:            class.labels1[, r] <- rep(0, Ns)
117:            class.labels2[, r] <- rep(0, Ns)
121:                reshuffled.class.labels1[i, r] <- m1
122:                reshuffled.class.labels2[i, r] <- m2 - m1
123:                if (i <= class1.size) {
124:                  class.labels1[i, r] <- m2
125:                  class.labels2[i, r] <- 0
127:                   class.labels1[i, r] <- 0
128:                   class.labels2[i, r] <- m2
136:            reshuffled.class.labels1[, r] <- rep(0, Ns)
137:            reshuffled.class.labels2[, r] <- rep(0, Ns)
138:            class.labels1[, r] <- rep(0, Ns)
139:            class.labels2[, r] <- rep(0, Ns)
141:                if (i <= class1.size) {
142:                   m1 <- sum(!is.na(match(class1.label1.subset, i)))
143:                   m2 <- sum(!is.na(match(class1.subset, i)))
144:                   reshuffled.class.labels1[i, r] <- m1
145:                   reshuffled.class.labels2[i, r] <- m2 - m1
146:                   class.labels1[i, r] <- m2
147:                   class.labels2[i, r] <- 0
149:                   m1 <- sum(!is.na(match(class2.label1.subset, i)))
150:                   m2 <- sum(!is.na(match(class2.subset, i)))
151:                   reshuffled.class.labels1[i, r] <- m1
152:                   reshuffled.class.labels2[i, r] <- m2 - m1
153:                   class.labels1[i, r] <- 0
154:                   class.labels2[i, r] <- m2
162:      P <- reshuffled.class.labels1 * subset.mask
172:      P <- reshuffled.class.labels2 * subset.mask
213:      P <- class.labels1 * subset.mask
223:      P <- class.labels2 * subset.mask
475: ...(159 bytes skipped)...", "#FF0D1D", "#FF0000") # blue-pinkogram colors. The first and last are the colors to indicate the class vector (phenotype). This is the 1998-vintage, pre-gene cluster, original pinkogram color map
502:         axis(3, at=c(floor(class1.size/2),class1.size + floor(class2.size/2)), labels=col.classes, tick=FALSE, las = 1, cex.axis=1.25, font.axis=2, line=-1)
598: # Reads a class vector CLS file and defines phenotype and class labels vectors for the samples in a gene expression file (RES or GCT format)
613:       s <- length(class.list)
614:       t <- table(class.list)
625:              if (class.list[i] == phen[j]) {
626:                 class.v[i] <- phen.label[j]
630:       return(list(phen = phen, class.v = class.v))
795: #   input.cls:  Input class vector (phenotype) file in CLS format 
988:   # Read input class vector
999:      phen1 <- class.phen[2]
1000:      phen2 <- class.phen[1]
1002:      phen1 <- class.phen[1]
1003:      phen2 <- class.phen[2]
1008:  col.index <- order(class.labels, decreasing= FALSE)
1009:  class.labels <- class.labels[col.index]
1166:    O <- GSEA.GeneRanking(A, class.labels, gene.labels, call.nperm, permutation.type = perm.type, sigma.correction = "GeneCluster", fr...(62 bytes skipped)...
1831:       GSEA.HeatMapPlot(V = C, col.labels = class.labels, col.classes = class.phen, main = "Heat Map for Genes in Dataset")
2032:             GSEA.HeatMapPlot(V = pinko, row.names = pinko.gene.names, col.labels = class.labels, col.classes = class.phen, col.names = sample.names, main =" Heat Map for Genes in Gene Set", xlab=" ", ylab=" ")
446: GSEA.HeatMapPlot <- function(V, row.names = FALSE, col.labels, col.classes, col.names = FALSE, main = " ", xlab=" ", ylab=" ") {