Learn R Programming

TitanCNA (version 1.10.0)

extractAlleleReadCounts: Function to extract allele read counts from a sequence alignment (BAM) file

Description

Function to extract allele read counts from a sequence alignment (BAM) file at specific positions of interest. The positions are passed in as the file path to a file in variant call format (VCF).

Usage

extractAlleleReadCounts(bamFile, bamIndex, positions, outputFilename = NULL, pileupParam = PileupParam())

Arguments

bamFile
File path location to the sequencing alignment file (BAM format) from which to extract read counts.
bamIndex
File path location to the BAM index file (usually with extension .bai) corresponding to the sequencing alignment file bamFile.
positions
File path location to the variant call format (VCF) file containing the positions at which read counts are to be extracted.
outputFilename
If given, will specify the file path to which the result will be output as tab-delimited text. Otherwise, the no output is written to file.
pileupParam
PileupParam object from the Rsamtools. See Details.

Value

data.frame containing columns:
chr
Chromosome; character
position
Position; numeric
ref
Reference counts; character
refCount
Reference counts; numeric
Nref
Non-reference counts; character
NrefCount
Non-reference counts; numeric

Details

The pileupParam object allows users to specify the sequencing parameters to consider when generating the pileup from which read counts are extracted. This includes ‘max_depth’, ‘min_base_quality’, ‘min_mapq’, ‘min_nucleotide_depth’=10 (recommended), ‘min_minor_allele_depth’, ‘distinguish_strands’, ‘distinguish_nucleotides’=TRUE (must be TRUE).

References

Ha, G., Roth, A., Khattra, J., Ho, J., Yap, D., Prentice, L. M., Melnyk, N., McPherson, A., Bashashati, A., Laks, E., Biele, J., Ding, J., Le, A., Rosner, J., Shumansky, K., Marra, M. A., Huntsman, D. G., McAlpine, J. N., Aparicio, S. A. J. R., and Shah, S. P. (2014). TITAN: Inference of copy number architectures in clonal cell populations from tumour whole genome sequence data. Genome Research, 24: 1881-1893. (PMID: 25060187)

See Also

PileupParam; http://samtools.sourceforge.net/

Examples

Run this code
  ## Not run: 
# 	countsDF <- extractAlleleReadCounts(bamFile, bamIndex, 
# 				positions, outputFilename = NULL, 
# 				pileupParam = PileupParam())
# 	data <- loadAlleleCounts(countsDF, symmetric = TRUE, 
#   				genomeStyle = "NCBI")
#   ## End(Not run)

Run the code above in your browser using DataLab