R/spkPairNS.R

Defines functions spkPairNS

Documented in spkPairNS

## compute all pairwise array comparisons for 1000 non-spikein probes
## only returns the positive fold change for each pairing
spkPairNS <- function(object,output="M"){
            tmp <- spkSplit(object)
            ns <- tmp$ns
            e <- exprs(ns)
            p <- combinations(n=ncol(e),r=2)
            m <- matrix(nrow=nrow(e),ncol=nrow(p))
            ## rows are probes
            ## cols are arraypairs
            if(output=="M"){
              for(k in 1:nrow(p)){
                m[,k] <- abs(e[,p[k,1]]-e[,p[k,2]])
              }
            }
            if(output=="A"){
              for(k in 1:nrow(p)){
                m[,k] <- (e[,p[k,1]]+e[,p[k,2]])/2
              }
            } 
            return(m)
          }
          

Try the spkTools package in your browser

Any scripts or data that you put into this service are public.

spkTools documentation built on Nov. 8, 2020, 6:55 p.m.