diff --git a/DESCRIPTION b/DESCRIPTION index 390729f..266cc05 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -24,4 +24,4 @@ Imports: dplyr, cowplot, reshape2 -RoxygenNote: 6.1.1 +RoxygenNote: 7.2.3 diff --git a/NAMESPACE b/NAMESPACE index 1b44fd1..ad3349d 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,6 +1,5 @@ # Generated by roxygen2: do not edit by hand -export() export(GEP_makeMean) export(addRandToSampTab) export(addToST) @@ -26,12 +25,12 @@ export(findAvgLabel) export(findBestPairs) export(findClassyGenes) export(findVarGenes) -export(get_cate) export(getGenesFromGO) export(getSpecGenes) export(getTopGenes) export(getTopGenesList) export(getUniqueGenes) +export(get_cate) export(gnrAll) export(gnrBP) export(harmonize) @@ -109,7 +108,5 @@ export(utils_strip_fname) export(utils_stripwhite) export(weighted_down) import(parallel) -import(umap) -import(viridis) importFrom(RColorBrewer,brewer.pal) importFrom(randomForest,randomForest) diff --git a/R/utils.R b/R/utils.R index e15a77f..1143989 100644 --- a/R/utils.R +++ b/R/utils.R @@ -25,7 +25,7 @@ ctRename<-function(sampTab, annCol, oldName, newName){ xnot<-which(colnames(sampTab)!=annCol) ans<-sampTab[,xnot] cbind(ans, newAnn=newann) -} +} #' @title #' Split Sample Table @@ -41,13 +41,13 @@ ctRename<-function(sampTab, annCol, oldName, newName){ #' #' @export splitCommon<-function(sampTab, ncells = 50, dLevel="cell_ontology_class", cells_reserved = 3){ - + cts<-unique(as.vector(sampTab[,dLevel])) if(sum(is.na(cts)) > 0){ stop("There are NAs in your training labels, please remove them first!") } - + trainingids<-vector() for(ct in cts){ cat(ct,": ") @@ -102,7 +102,7 @@ loadLoomExpCluster<-function# load a loom object containing expression + cluste expMat<- t(lfile[["matrix"]][1:length(cellNames),]) rownames(expMat)<-geneNames colnames(expMat)<-cellNames - + cluster_old <- lfile[['col_attrs']][[xname]][] sampTab <- data.frame(cell_name=cellNames, cluster=cluster_old) @@ -117,7 +117,7 @@ loadLoomExpCluster<-function# load a loom object containing expression + cluste #' @export getGenesFromGO<-function# return the entrez gene ids of a given a GOID, for now assumes mouse (GOID, # GO id to find genes for - annList + annList ){ sort(as.vector(unlist(annList[['egSymbols']][annList[['goegs']][[GOID]]]))); } @@ -149,15 +149,15 @@ GEP_makeMean<-function groupings, type='mean' ){ - - + + ans<-data.frame(); grps<-unique(groupings); if(type=='mean'){ for(grp in grps){ gi<-which(groupings==grp); if(length(gi)==1){ - + if(nrow(ans)==0){ ans<-data.frame(exp[,gi]); }else{ @@ -187,7 +187,7 @@ GEP_makeMean<-function } } } - + colnames(ans)<-grps; ans; ### data.frame of mean or median-ed data based on given groupings @@ -215,8 +215,8 @@ library(GO.db) #' #' 1-PCC distance #' @param x numeric matrix -#' -#' @return distance matrix +#' +#' @return distance matrix #' #' @examples #' xdist<-utils_myDist(t(expDat)) @@ -254,7 +254,7 @@ utils_loadObject<-function #' #' @export utils_stripwhite<-function -### +### (string #### string ){ @@ -268,7 +268,7 @@ utils_stripwhite<-function #' #' @export utils_myDate<-function -### +### () { format(Sys.time(), "%b_%d_%Y"); @@ -299,11 +299,11 @@ zscore<-function ### compute zscore (x, ### numeric vector - meanVal, - ### mean of distribution to compute zscore of x against + meanVal, + ### mean of distribution to compute zscore of x against sdVal ### standard deviation of distribution to compute zscore of x agains - ){ + ){ (x-meanVal)/sdVal; ### zscore } @@ -363,7 +363,7 @@ cn_correctZmat<-function downSampleW<-function (vector, total=1e5, - dThresh=0){ + dThresh=0){ totalSignal<-sum(vector) wAve<-vector/totalSignal @@ -403,7 +403,7 @@ weighted_down<-function tmpAns <- expDat - t(props * rrids) tmpAns[which(tmpAns