NormRCountConfig-class {normr} | R Documentation

## Container for configuration of read counting with bamsignals in normR

### Description

This S4 class is a small wrapper for a configuration on obtaining counts from bamfiles with `bamProfile`. Herein, two functions provide help for creating an instance of this class: `countConfigSingleEnd` creates a configuration for single end reads; and `countConfigPairedEnd` creates a configuration for paired end reads.

### Usage

    ## S4 method for signature 'ANY'
    countConfigSingleEnd(binsize = 250L, mapq = 20L,
      filteredFlag = 1024L, shift = 0L)

    ## S4 method for signature 'ANY'
    countConfigPairedEnd(binsize = 250L, mapq = 20L,
      filteredFlag = 1024L, shift = 0L, midpoint = TRUE, tlenFilter = c(70L,
      200L))

    ## S4 method for signature 'NormRCountConfig'
    getFilter(x)

    ## S4 method for signature 'NormRCountConfig'
    print(x, ...)

    ## S4 method for signature 'NormRCountConfig'
    show(object)

### Arguments

`binsize` | An `integer()` specifying the binsize in bp.
`mapq` | An `integer()` specifying the minimal mapping quality for a read to be counted.
`filteredFlag` | An `integer()` to filter for in the SAMFLAG field. For example, 1024 filters out marked duplicates (default). Refer to https://broadinstitute.github.io/picard/explain-flags.html for details.
`shift` | An `integer()` specifing a shift of the read counting position in 3'-direction. This can be handy in the analysis of chip-seq data.
`midpoint` | Paired End data only: A `logical()` indicating whether fragment midpoints instead of 5'-ends should be counted.
`tlenFilter` | An `integer()` of length two specifying the lower and upper length bound for a fragment to be considered. The fragment length as estimated from alignment in paired end experiments and written into the TLEN column.
`x` | A `NormRCountConfig` object.
`...` | optional arguments to be passed directly to the inherited function without alteration and with the original names preserved.
`object` | A `NormRCountConfig` object.

### Value

A `NormRCountConfig` with specified counting parameters for `normr` methods (`enrichR`, `diffR`, `regimeR`

### Methods (by generic)

- `countConfigSingleEnd`: Setup single end count configuration

- `countConfigPairedEnd`: Setup paired end count configuration

- `getFilter`: Get the filter compliant to `bamProfile`

- `print`: Prints a given BamCounConfig

- `show`: Shows a given BamCounConfig

### Slots

`type`

  A `character` of value `paired.end` or `single.end`.

`binsize`

  An `integer` specifying the binsize in bp.

`mapq`

  An `integer` specifying the minimal mapping quality for a read to be counted.

`filteredFlag`

  An `integer` to filter for in the SAMFLAG field. For example, 1024 filters out marked duplicates (default). Refer to https://broadinstitute.github.io/picard/explain-flags.html for details.

`shift`

  An `integer` specifing a shift of the read counting position in 3'-direction. This can be handy in the analysis of chip-seq data.

`midpoint`

  Paired End data only: A `logical` indicating whether fragment midpoints instead of 5'-ends should be counted.

`tlenFilter`

  Paired End data only: An `integer` of length two specifying the lower and upper length bound for a fragment to be considered. The fragment length as estimated from alignment in paired end experiments and written into the TLEN column.

### Author(s)

Johannes Helmuth helmuth@molgen.mpg.de

### See Also

normr for functions that use this object.

### Examples

    ### Create an instance of this class (see below for helper functions)
    # 250bp bins; single end reads; MAPQ>=10; no duplicates
    countConfig <- new("NormRCountConfig",
                       type = "single.end", binsize = 250L, mapq = 10L,
                       filteredFlag = 1024L, shift = 0L, midpoint = FALSE,
                       tlenFilter = NULL)

    ### Counting configuration for Single End alignment files
    # 250bp bins (default); only reads with MAPQ>=20; move counting position 100bp
    countConfigurationSE <- countConfigSingleEnd(mapq = 20, shift = 100)
    countConfigurationSE

    ### Counting configuration for Paired End alignment files
    # 250bp bins; count center of fragments; only fragments with 70bp<=length<=200
    countConfigurationPE <- countConfigPairedEnd(midpoint = TRUE,
                                                 tlenFilter = c(70, 200))
    countConfigurationPE

[Package normr version 1.12.0 Index]