findGuideHits | R Documentation |
Given a table of counts per guide/bin and a bin model for an experiment, calculate the optimal mean expression for each guide
findGuideHits( countTable, curBinBounds, pseudocount = 10, meanFunction = mean, sortBins = c("A", "B", "C", "D", "E", "F"), unsortedBin = "NS", negativeControl = "NT", limits = c(-4, 4) )
countTable |
a table containing one column for each bin (A-F) and another column for non-targeting guide (logical-"NT"), and unsorted abundance (NS) |
curBinBounds |
a bin model as created by makeBinModel |
pseudocount |
the count to be added to each bin count, per 1e6 reads/bin total (default=10 pseudo reads per 1e6 reads total) |
meanFunction |
how to calculate the mean of the non-targeting guides for centering Z-scores. Defaults to 'mean' |
sortBins |
the names in countTable of the sorting bins. Defaults to c("A","B","C","D","E","F") |
unsortedBin |
the name in countTable of the unsorted bin. Defaults to "NS" |
negativeControl |
the name in countTable containing a logical representing whether or not the guide is non-Targeting (i.e. a negative control guide). Defaults to "NT" |
limits |
the limits to the mu optimization. Defaults to c(-4,4) |
a data.frame containing the guide-level statistics, including the Z score 'Z', log likelihood ratio 'llRatio', and estimated mean expression 'mean'.
curSortBins = makeBinModel(data.frame(Bin = c("A","B","C","D","E","F"), fraction = rep(0.1,6))) fakeReadData = data.frame(id=1:1000, A=rpois(1000, lambda = 100), B=rpois(1000, lambda = 100), C=rpois(1000, lambda = 100), D=rpois(1000, lambda = 100), E=rpois(1000, lambda = 100), F=rpois(1000, lambda = 100), NotSorted=rpois(1000, lambda = 100), negControl = rnorm(1000)>0) guideHits = findGuideHits(fakeReadData, curSortBins, unsortedBin = "NotSorted", negativeControl="negControl") if(require("ggplot2")){ p=ggplot(guideHits, aes(x=Z, colour=negControl))+geom_density(); print(p) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.