inst/Mixture_Creation/pdist_gen.R

pdDist_gen <- function(fragSizeFile,lmax){
  md = read.table(fragSizeFile)
  if (ncol(md) != 2) {
    stop(fragSizeFile, " should have 2 columns for Freq and Len\n")
  }
  names(md) = c("Freq", "Len")
  pd = rep(0, lmax)
  w2 = which(md$Len <= lmax)
  pd[md$Len[w2]] = md$Freq[w2]
  pdDist = pd/sum(pd)
  return(pdDist)
}
hheiling/IsoDeconvMM documentation built on March 11, 2020, 7:28 p.m.