R/fitSample.R

Defines functions fitSample

Documented in fitSample

fitSample <- function(T, references, threshold =.135, ..., verbose = verbose) {
  # This is an internal function. Because of this, we will assume that
  # all arguments are valid and correct.  No validation will be done.

  thr <- references > threshold;
  thr[thr==FALSE] <- NA;
  
  if(sum(is.na(thr))==length(thr)){
    thr[1:length(thr)] <- TRUE;
  }
  
  ref <- median(T*thr, na.rm=TRUE);
  res <- 2*T/ref;
  
  res;
} # fitSample()

###########################################################################
# HISTORY:
# 2010-06-29 [MO]
# o Created from fitSNPSN.R.
###########################################################################

Try the NSA package in your browser

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

NSA documentation built on May 2, 2019, 4:58 p.m.