bamreadcounts {maftools} | R Documentation

## extract nucleotide counts for targeted variants from the BAM file.

### Description

Given a BAM file and target loci, 'bamreadcounts' fetches redcounts for A, T, G, C, Ins, and Del. Function name is an homage to https://github.com/genome/bam-readcount

### Usage

    bamreadcounts(
      bam = NULL,
      loci = NULL,
      zerobased = FALSE,
      mapq = 10,
      sam_flag = 1024,
      op = NULL,
      fa = NULL,
      nthreads = 4
    )

### Arguments

`bam` | Input bam file(s). Required.
`loci` | Loci file. Can be a tsv file or a data.frame. First two columns should contain chromosome and position (by default assumes coordinates are 1-based)
`zerobased` | are coordinates zero-based. Default FALSE.
`mapq` | Map quality. Default 10
`sam_flag` | SAM FLAG to filter reads. Default 1024
`op` | Output file basename. Default parses from BAM file
`fa` | Indexed fasta file. If provided, extracts and adds reference base to the output tsv.
`nthreads` | Number of threads to use. Each BAM file will be launched on a separate thread. Works only on Unix and macOS.

[Package maftools version 2.10.05 Index]