counts,SNPhood-method {SNPhood} | R Documentation

## Extract count data from a `SNPhood` object.

### Description

`counts` extracts count data from a `SNPhood` object. The full count data or only a subset can be extracted by settings the parameters `type`, `readGroup` and `dataset` accordingly. Either the count data for the unbinned or binned SNP regions can be extracted.

### Usage

    ## S4 method for signature 'SNPhood'
    counts(object, type = "binned", readGroup = NULL,
      dataset = NULL, ...)

### Arguments

`object` | Object of class `SNPhood`
`type` | Character(1). Default "binned". Either "binned" or "unbinned" to extract counts after or before binning the SNP regions, respectively.
`readGroup` | Character(1). Default NULL. Read group that should be plotted, specified by its name as obtained by the function `annotationReadGroups`). If only one read group is defined in the object, this may also be NULL for user conveniance.
`dataset` | Numeric(1) or Character(1). Single dataset that should be used for plotting, either specified as integer (such as 1, value must be between 1 and the total number of datasets as defined in the object) or its annotation (name must appear in the dataset names as obtained via the function `annotationDatasets`).
`...` | not used

### Value

A named nested list with the requested count data, organized after read group and dataset.

### See Also

`SNPhood`, `enrichment`

### Examples

    data(SNPhood.o, package="SNPhood")
    str(counts(SNPhood.o))
    str(counts(SNPhood.o, readGroup = "paternal", dataset = 1))
    str(counts(SNPhood.o, readGroup = c("maternal", "paternal"), dataset = 1))

[Package SNPhood version 1.22.0 Index]