BAM_pileup: Calculate pileup for each position of reference from BAM file

View source: R/VSeqTools_pileup.R

BAM_pileupR Documentation

Calculate pileup for each position of reference from BAM file

Description

Using the Rsamtools pileup function, the counts of A,C,G,T,i,d are determined at each position on reference

Usage

BAM_pileup(
  bam_file,
  bai_file = NULL,
  max_depth = 20000,
  min_base_quality = 30,
  min_mapq = 30,
  strand = NULL
)

Arguments

bam_file

bam file

bai_file

If not passed, then assumed to be same as bam_file with .bai appendix.

max_depth

maximum number of reads from which to form the pileup. This parameter is passed to RSamTools PileupParam function.

min_base_quality

Passed to PileupParam

min_mapq

Passed to PileupParam

strand

If BAM file is paired end, which strand to use: "plus" or "minus". Should be set to NULL if all reads to be used or if BAM file is not paired.

start_pos

Start position of pileup relative to reference.

end_pos

End position of pileup relative to reference.

Value

a VSeqTools_pileup object which inherits data.frame and has columns: pos, A, C, G, T, i, d, Coverage. pos gives the position on the reference. Coverage is total reads at that position. The rest of the columns give read freq at that position with the particular nt value.


SLeviyang/RegressHaplo documentation built on June 1, 2022, 10:48 p.m.