bam_to_variant_calls.pipeline: Given a bam file, create variant call file

View source: R/RegressHaplo_workflow.R

bam_to_variant_calls.pipelineR Documentation

Given a bam file, create variant call file

Description

Given a bam file, create variant call file

Usage

bam_to_variant_calls.pipeline(
  bam_file,
  out_dir,
  start_pos = NULL,
  end_pos = NULL,
  sig = 0.01,
  heavy_tail = T
)

Arguments

bam_file

path to bam file

out_dir

output directory, will be created if needed. variant call file will be placed in the output directory

start_pos

position on reference at which to start looking for variant calls

end_pos

position on reference at which to end looking for variant calls

sig

significance level at which variants will be called. An automatic bonferroni correction is applied to account for the number of positions in the reference.

heavy_tail

If T, then a betabinomial is used to call errors following Gerstung et al 2011. If F, then a poisson is used to call variants following Wang et al 2007

Details

variant calls are given by a data.frame with 6 columns named c("pos", "A", "C", "G", "T", "-") pos gives the position at which a true variant exists. The other columns have logical entries, with TRUE meaning that a true variant exists with the corresponding nucleotide.

Value

path to variant call file

References

Wang,C. et al. (2007) Characterization of mutation spectra with ultra-deep pyrosequencing: application to HIV-1 drug resistance. Genome Res., 17, 1195–1201,

Gerstung et al. (2011) Reliable detection of subclonal single-nucleotide variants in tumour cell populations. Nature Communications.


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