diff --git a/DESCRIPTION b/DESCRIPTION index 4776545..8e3af6a 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: flowClust Type: Package Title: Clustering for Flow Cytometry Version: 3.29.1 -Author: Raphael Gottardo , Kenneth Lo , Greg +Author: Raphael Gottardo, Kenneth Lo , Greg Finak Maintainer: Greg Finak , Mike Jiang Depends: @@ -15,7 +15,6 @@ Imports: ellipse, flowViz, flowCore, - clue, corpcor, mnormt, parallel @@ -41,7 +40,6 @@ Collate: 'hist.R' 'miscellaneous.R' 'mkPriors.R' - 'peakMatch.R' 'plot.R' 'split.R' License: Artistic-2.0 @@ -49,5 +47,5 @@ Packaged: 2012-07-13 20:14:40 UTC; finak biocViews: ImmunoOncology, Clustering, Visualization, FlowCytometry SystemRequirements: GNU make Encoding: UTF-8 -RoxygenNote: 6.1.1 +RoxygenNote: 7.1.1 VignetteBuilder: knitr diff --git a/NAMESPACE b/NAMESPACE index 0a3af77..5fd1aea 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -18,7 +18,6 @@ export(flowClust2Prior) export(getEstimates) export(importance) export(mkPrior) -export(peakMatch) export(plot) export(plotPrior) export(posterior) @@ -49,7 +48,6 @@ import(graph) import(methods) importClassesFrom(Biobase,AssayData) importFrom(BiocGenerics,density) -importFrom(clue,solve_LSAP) importFrom(corpcor,cov.shrink) importFrom(ellipse,ellipse) importFrom(grDevices,cm.colors) diff --git a/R/peakMatch.R b/R/peakMatch.R deleted file mode 100644 index 6a02379..0000000 --- a/R/peakMatch.R +++ /dev/null @@ -1,42 +0,0 @@ -#' Function to match peaks across samples -#' -#' Uses the hungarian algorithm to match peaks across samples, one at a time -#' using a template sample. -#' -#' -#' @param peaks is the matrix of peaks in the columns and samples in the rows -#' @param target.index is the index of the template sample. -#' @param max.fill is the value to substitute for NAs in the distance matrix. -#' Should be very large, but if too large, will overflow and give an incorrect -#' matching -#' @importFrom clue solve_LSAP -#' @export -peakMatch<-function(peaks,target.index,max.fill=1e12){ - if(any(is.na(peaks[target.index,]))){ - stop("template sample must have a full set of peaks detected.") - } - result<-matrix(NA,ncol=ncol(peaks),nrow=nrow(peaks)) - sapply(setdiff(1:nrow(peaks),target.index),function(test){ - M<-as.matrix(dist(c(peaks[target.index,],peaks[test,]))) - #browser() - M[1:ncol(peaks),1:ncol(peaks)]<-1e12 - M[(ncol(peaks)+1):(2*ncol(peaks)),(ncol(peaks)+1):(2*ncol(peaks))]<-1e12 - M[is.na(M)]<-1e12 - sol<-as.vector(solve_LSAP(M))[1:ncol(peaks)]-ncol(peaks) - result[test,]<<-peaks[test,sol] - }) - result[target.index,]<-peaks[target.index,] - result[,order(result[target.index,],decreasing=FALSE)] -} -# -# #Some test code -# require(clue) -# peaks<-cbind(rnorm(5,12,sd=0.5),rnorm(5,8,sd=0.5),rnorm(5,4,sd=0.5),rnorm(5,1,sd=0.5)) -# peaks<-t(apply(peaks,1,sample)) #reorder each column -# peaks[sample(1:length(peaks),5)]<-NA #add some NA -# -# #The candidate template rows should all give the same output below -# candidates<-which(!apply(peaks,1,function(x)any(is.na(x)))) -# sapply(candidates,function(C){ -# list(peakMatch(peaks,C)) -# })