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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.