predict_pmol {spiky} | R Documentation |
FIXME: this could be made MUCH faster by precomputing CpG/GC stats per bin
predict_pmol(fit, ssb_res, bsgenome = NULL, ret = c("gr", "df"), slide = FALSE)
fit |
result of model_glm_pmol |
ssb_res |
the data / new data |
bsgenome |
BSgenome name (if null, will guess from ssb_res) |
ret |
return a data.frame ("df") or GRanges ("gr")? ("gr") |
slide |
compute a sliding window estimate for GCfrac (1/3 width)? |
Using GRanges as the return value is (perhaps counterintuitively) much faster than the data.frame, since the sequence of the bins gets converted from a BSgenome representation to characters in the latter (it is implied by the bin start, stop, and genome when left as a GRanges).
object with read count, fraglen, GC%, CpG**(1/3), and concentration
data(ssb_res) data(spike, package="spiky") fit <- model_glm_pmol(covg_to_df(ssb_res, spike=spike),spike=spike) preddf <- predict_pmol(fit, ssb_res, ret="df") pred <- predict_pmol(fit, ssb_res, ret="gr") bin_pmol(pred)