pileupVariants {VariantTools} | R Documentation

## Nucleotide pileup from alignments

### Description

This is an alternative to `tallyVariants` for generating a `VRanges` from a set of alignments (BAM file) by counting the nucleotides at each position. This function uses the samtools-based `applyPileups` function, instead of `bam_tally`. Fewer dependencies, with fewer statistics (none beyond the fixed columns) available in the output.

### Usage

    pileupVariants(bams, genome, param = ApplyPileupsParam(), minAltDepth = 1L,
                   baseOnly = TRUE, BPPARAM = defaultBPPARAM())

### Arguments

`bams` | A vector/list of BAM files as interpreted by `PileupFiles`.
`genome` | An object that provides sequence information via `getSeq`.
`param` | A `ApplyPileupsParam` object that specifies the mode of iteration and various filters.
`minAltDepth` | Minimal alt depth to be included in the output. The default avoids outputting results for positions/alleles that show no differences.
`baseOnly` | Whether to drop records with “N” in either the ref or alt.
`BPPARAM` | Not yet supported.

### Value

A VRanges object with read depth information for each position, allele, and sample.

### Author(s)

Michael Lawrence

### See Also

`tallyVariants` for more statistics.

### Examples

    bams <- LungCancerLines::LungCancerBamFiles()
    if (requireNamespace("gmapR")) {
        param <- Rsamtools::ApplyPileupsParam(which=gmapR::TP53Which())
        pileup <- pileupVariants(bams, gmapR::TP53Genome(), param)
    }

[Package VariantTools version 1.22.0 Index]