Learn R Programming

VariantTools (version 1.14.1)

pileupVariants: 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.

See Also

tallyVariants for more statistics.

Examples

Run this code
     bams <- LungCancerLines::LungCancerBamFiles()
     param <- Rsamtools::ApplyPileupsParam(which=gmapR::TP53Which())
     pileup <- pileupVariants(bams, gmapR::TP53Genome(), param)

Run the code above in your browser using DataLab