predict_pmol {spiky} | R Documentation

## predict picomoles of DNA from a fit and read counts (coverage)

### Description

FIXME: this could be made MUCH faster by precomputing CpG/GC stats per bin

### Usage

    predict_pmol(fit, ssb_res, bsgenome = NULL, ret = c("gr", "df"), slide = FALSE)

### Arguments

`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)?

### Details

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).

### Value

object with read count, fraglen, GC%, CpG**(1/3), and concentration

### Examples

    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)

[Package spiky version 1.0.0 Index]