read5endCoverage {gcapc} | R Documentation

## Reads Coverage Using 5-end Base

### Description

Reads coverage in single base pair resolution using only 5-prime end of BAM file records. Coverages are reported for forward and reverse strands separately. Options for customized filtering of BAM records are provided.

### Usage

    read5endCoverage(bam, chroms = NULL, mapq = 30L, duplicate = FALSE,
      flag = scanBamFlag(isUnmappedQuery = FALSE, isSecondaryAlignment = FALSE,
      isNotPassingQualityControls = FALSE))

### Arguments

`bam` | The path to a BAM file, which is sorted and indexed.
`chroms` | NULL or a vector of chromosome names that compatible with the provided BAM file. Reads coverage will be generated for these chromosomes. Default (NULL) will use all chromosomes in BAM file.
`mapq` | A non-negative integer specifying the minimum mapping quality to include. BAM records with mapping qualities less than `mapq` are discarded.
`duplicate` | A logical vector which, when FALSE (Default), returns maximum coverage of 1 for every base pair. Reads that start at the same position but on different strands are not treated as duplicates.
`flag` | A returned object by `Rsamtools::scanBamFlag`. Additional options for BAM records filtering.

### Value

A list of two objects by `GenomicRanges::coverage`

`fwd` | Coverage object for forward strand.
`rev` | Coverage object for reverse strand.

### Examples

    bam <- system.file("extdata", "chipseq.bam", package="gcapc")
    read5endCoverage(bam)

[Package gcapc version 1.12.0 Index]