alleleCounts {BaalChIP} | R Documentation

## Method alleleCounts

### Description

Generates allele-specific read count data from each BAM ChIP-seq dataset for each variant.

### Usage

    alleleCounts(.Object, min_base_quality = 10, min_mapq = 15, verbose = TRUE)

    ## S4 method for signature 'BaalChIP'
    alleleCounts(.Object, min_base_quality = 10, min_mapq = 15, verbose = TRUE)

### Arguments

`.Object` | An object of the `BaalChIP` class.
`min_base_quality` | A numeric value indicating the minimum read base quality below which the base is ignored when summarizing pileup information (default 10).
`min_mapq` | A numeric value indicating the minimum mapping quality (MAPQ) below which the entire read is ignored (default 15).
`verbose` | logical. If TRUE reports extra information on the process

### Details

Utilizes the information within the `samples` slot of a BaalChIP object. Will primarily find all variants overlapping peaks. Then, for each variant, computes the number of reads carrying the reference (REF) and alternative (ALT) alleles.

### Value

An updated `BaalChIP` object with the slot `alleleCounts` containing a list of GRanges objects.

### Note

BaalChIP computes allelic counts at each variant position with Rsamtools pileup function. The algorithm follows pileup::Rsamtools by automatically excluding reads flagged as unmapped, secondary, duplicate, or not passing quality controls.

### Author(s)

Ines de Santiago

### See Also

`BaalChIP.get`

### Examples

    samplesheet <- system.file("test", "exampleChIP.tsv", package = "BaalChIP")
    hets <- c("MCF7"= system.file("test", "MCF7_hetSNP.txt", package = "BaalChIP"),
             "GM12891"= system.file("test", "GM12891_hetSNP.txt", package = "BaalChIP"))
    res <- BaalChIP(samplesheet=samplesheet, hets=hets)
    res <- alleleCounts(res, min_base_quality=10, min_mapq=15)

    #retrieve alleleCounts:
    counts <- BaalChIP.get(res, 'alleleCountsPerBam')

    #alleleCounts are grouped by bam_name and group_name:
    names(counts)
    names(counts[['MCF7']])

    #check out the result for one of the bam files:
    counts[['MCF7']][[1]]

[Package BaalChIP version 1.18.0 Index]