genogam {GenoGAM} | R Documentation

## genogam

### Description

This is the fitting function for GenoGAMDataSet. It processes the data in GenoGAMDataSet, estimates the overdispersion and the penalization parameter, passes all information to mgcv::gam in parallel fashion and extracts the results. So far the model is restricted to Negativ Binomial distribution (mgcv::nb()).

### Usage

    genogam(ggd, lambda = NULL, family = mgcv::nb(), bpknots = 20,
      kfolds = 10, intervallSize = 20, m = 2)

### Arguments

`ggd` | A GenoGAMDataSet object to be fitted.
`lambda` | The penalization parameter. Will be estimated if missing.
`family` | A distribution family object. So far only mgcv::nb() is allowed.
`bpknots` | Number of basepairs per one knot, that is, how dense should the knots be placed. The denser the knots, the more sensitive the fit. Note however, that computation time increases approximately cubic with every additional knot.
`kfolds` | An integer number giving the number of k-folds to be used in cross validation, if parameters need to be estimated.
`intervallSize` | The size of the intervalls to be used in cross validation. Short intervalls are used instead of single points to be left out due to spatial correlation. If replicates are present it is advised to make them bigger, e.g. 2*fragment size. Otherwise, depending on the density of the data, they should not exceed the size of a short read.
`m` | The penalization order of the P-Splines.

### Value

A GenoGAM object containing the fits and parameters.

### Author(s)

Georg Stricker georg.stricker@in.tum.de

### Examples

    ## Not run:
    ## simple example
    config <- data.frame(ID = c("input", "IP"),
                         file = c("myInput.bam",
                                  "myIP.bam"),,
                        paired = c(FALSE, FALSE),
                        type = c(0,1), stringsAsFactors = FALSE)
    bpk <- 100 ## basepairs per one knot
    chunkSize <- 5000
    overhang <- round(7*chunkSize/bpk) ##overhang with 7 knots
    knots <- chunkSize/bpk
    ## build the GenoGAMDataSet
    gtiles <- GenoGAMDataSet(config = config, chunkSize = chunkSize, overhangSize = overhang,
                             design = ~ s(x) + s(x, by = type))
    gtiles <- computeSizeFactors(gtiles)
    fits <- genogam(gtiles, bpknots = bpk)

    ## End(Not run)

[Package GenoGAM version 1.8.0 Index]